diff --git a/pkg/asset/machines/vsphere/capimachines.go b/pkg/asset/machines/vsphere/capimachines.go index d89ad11e967..3f498625e7a 100644 --- a/pkg/asset/machines/vsphere/capimachines.go +++ b/pkg/asset/machines/vsphere/capimachines.go @@ -19,6 +19,7 @@ import ( "github.com/openshift/installer/pkg/asset/installconfig/vsphere" "github.com/openshift/installer/pkg/asset/manifests/capiutils" "github.com/openshift/installer/pkg/types" + "github.com/openshift/installer/pkg/utils" ) const ( @@ -69,8 +70,9 @@ func GenerateMachines(ctx context.Context, clusterID string, config *types.Insta capvMachines := make([]*capv.VSphereMachine, 0, len(machines)) result := make([]*asset.RuntimeFile, 0, len(machines)) + staticIP := false - for _, machine := range machines { + for mIndex, machine := range machines { providerSpec, ok := machine.Spec.ProviderSpec.Value.Object.(*machinev1.VSphereMachineProviderSpec) if !ok { return nil, errors.New("unable to convert ProviderSpec to VSphereMachineProviderSpec") @@ -79,22 +81,33 @@ func GenerateMachines(ctx context.Context, clusterID string, config *types.Insta vcenterContext := metadata.VCenterContexts[providerSpec.Workspace.Server] resourcePool := providerSpec.Workspace.ResourcePool + customVMXKeys := map[string]string{ + "guestinfo.hostname": machine.Name, + "guestinfo.domain": strings.TrimSuffix(config.ClusterDomain(), "."), + "stealclock.enable": "TRUE", + } + capvNetworkDevices := []capv.NetworkDeviceSpec{} for _, networkDevice := range providerSpec.Network.Devices { networkName, err := getNetworkInventoryPath(vcenterContext, networkDevice.NetworkName, providerSpec) if err != nil { return nil, fmt.Errorf("unable to get network inventory path: %w", err) } - capvNetworkDevices = append(capvNetworkDevices, capv.NetworkDeviceSpec{ + deviceSpec := capv.NetworkDeviceSpec{ NetworkName: networkName, DHCP4: true, - }) - } + } - customVMXKeys := map[string]string{ - "guestinfo.hostname": machine.Name, - "guestinfo.domain": strings.TrimSuffix(config.ClusterDomain(), "."), - "stealclock.enable": "TRUE", + // Static IP configured. Add kargs. + if len(networkDevice.AddressesFromPools) > 0 { + staticIP = true + kargs, err := utils.ConstructNetworkKargsFromMachine(data.IPClaims, data.IPAddresses, &machines[mIndex], networkDevice) + if err != nil { + return nil, fmt.Errorf("unable to get static ip config for machine %v: %w", machine.Name, err) + } + customVMXKeys["guestinfo.afterburn.initrd.network-kargs"] = kargs + } + capvNetworkDevices = append(capvNetworkDevices, deviceSpec) } vsphereMachine := &capv.VSphereMachine{ @@ -166,6 +179,15 @@ func GenerateMachines(ctx context.Context, clusterID string, config *types.Insta if role == masterRole { customVMXKeys := map[string]string{} + // If we detected static IP for masters, lets apply to bootstrap as well. + if staticIP { + kargs, err := utils.ConstructKargsForBootstrap(config) + if err != nil { + return nil, fmt.Errorf("unable to get static ip config for bootstrap: %w", err) + } + customVMXKeys["guestinfo.afterburn.initrd.network-kargs"] = kargs + } + bootstrapSpec := capvMachines[0].Spec bootstrapSpec.CustomVMXKeys = customVMXKeys bootstrapVSphereMachine := &capv.VSphereMachine{ diff --git a/pkg/utils/vmware.go b/pkg/utils/vmware.go index 1a23bae4b48..96ac8581005 100644 --- a/pkg/utils/vmware.go +++ b/pkg/utils/vmware.go @@ -9,48 +9,27 @@ import ( "strings" "github.com/sirupsen/logrus" - "sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1" + ipamv1 "sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1" machinev1beta1 "github.com/openshift/api/machine/v1beta1" "github.com/openshift/installer/pkg/types" ) -func getIPAddressForClaim(claim v1alpha1.IPAddressClaim, addresses []v1alpha1.IPAddress) (*v1alpha1.IPAddress, error) { - for _, address := range addresses { - if address.Name == claim.Status.AddressRef.Name { - return &address, nil - } - } - return nil, fmt.Errorf("unable to find address for claim %s", claim.Name) -} - // ConstructNetworkKargsFromMachine does something. -func ConstructNetworkKargsFromMachine(claims []v1alpha1.IPAddressClaim, addresses []v1alpha1.IPAddress, machine *machinev1beta1.Machine) (string, error) { - var addressList []string - var gatewayList []string - var nameserverList []string - - for _, claim := range claims { - for _, ownerReference := range claim.OwnerReferences { - if ownerReference.Name != machine.Name { - continue - } - address, err := getIPAddressForClaim(claim, addresses) - if err != nil { - return "", fmt.Errorf("unable to get address for claim %s: %w", claim.Name, err) - } - - addressList = append(addressList, fmt.Sprintf("%s/%d", address.Spec.Address, address.Spec.Prefix)) - gatewayList = append(gatewayList, address.Spec.Gateway) - for _, networkDevices := range machine.Spec.ProviderSpec.Value.Object.(*machinev1beta1.VSphereMachineProviderSpec).Network.Devices { - if networkDevices.Nameservers == nil { - continue - } - nameserverList = append(nameserverList, networkDevices.Nameservers...) +func ConstructNetworkKargsFromMachine(claims []ipamv1.IPAddressClaim, addresses []ipamv1.IPAddress, machine *machinev1beta1.Machine, network machinev1beta1.NetworkDeviceSpec) (string, error) { + var ipAddresses []string + var gateways []string + for idx := range network.AddressesFromPools { + for _, address := range addresses { + logrus.Debugf("Checking IPAdress %v. Does it match? %v", address.Name, fmt.Sprintf("%s-claim-%d-%d", machine.Name, 0, idx)) + if address.Name == fmt.Sprintf("%s-claim-%d-%d", machine.Name, 0, idx) { + ipAddresses = append(ipAddresses, fmt.Sprintf("%v/%v", address.Spec.Address, address.Spec.Prefix)) + gateways = append(gateways, address.Spec.Gateway) + break } } } - return ConstructKargsFromNetworkConfig(addressList, nameserverList, gatewayList) + return ConstructKargsFromNetworkConfig(ipAddresses, network.Nameservers, gateways) } func getSubnetMask(prefix netip.Prefix) (string, error) { diff --git a/vendor/modules.txt b/vendor/modules.txt index 4828025982e..f1a489c54bc 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -9849,7 +9849,6 @@ sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1 sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3 sigs.k8s.io/cluster-api/errors sigs.k8s.io/cluster-api/exp/api/v1beta1 -sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1 sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1 sigs.k8s.io/cluster-api/feature sigs.k8s.io/cluster-api/util diff --git a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/conversion.go b/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/conversion.go deleted file mode 100644 index 72df082a539..00000000000 --- a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/conversion.go +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - "sigs.k8s.io/controller-runtime/pkg/conversion" - - ipamv1 "sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1" -) - -func (src *IPAddress) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*ipamv1.IPAddress) - - return Convert_v1alpha1_IPAddress_To_v1beta1_IPAddress(src, dst, nil) -} - -func (dst *IPAddress) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*ipamv1.IPAddress) - - return Convert_v1beta1_IPAddress_To_v1alpha1_IPAddress(src, dst, nil) -} - -func (src *IPAddressList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*ipamv1.IPAddressList) - - return Convert_v1alpha1_IPAddressList_To_v1beta1_IPAddressList(src, dst, nil) -} - -func (dst *IPAddressList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*ipamv1.IPAddressList) - - return Convert_v1beta1_IPAddressList_To_v1alpha1_IPAddressList(src, dst, nil) -} - -func (src *IPAddressClaim) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*ipamv1.IPAddressClaim) - - return Convert_v1alpha1_IPAddressClaim_To_v1beta1_IPAddressClaim(src, dst, nil) -} - -func (dst *IPAddressClaim) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*ipamv1.IPAddressClaim) - - return Convert_v1beta1_IPAddressClaim_To_v1alpha1_IPAddressClaim(src, dst, nil) -} - -func (src *IPAddressClaimList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*ipamv1.IPAddressClaimList) - - return Convert_v1alpha1_IPAddressClaimList_To_v1beta1_IPAddressClaimList(src, dst, nil) -} - -func (dst *IPAddressClaimList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*ipamv1.IPAddressClaimList) - - return Convert_v1beta1_IPAddressClaimList_To_v1alpha1_IPAddressClaimList(src, dst, nil) -} diff --git a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/doc.go b/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/doc.go deleted file mode 100644 index ce54c843f19..00000000000 --- a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha1 contains API Schema definitions for the exp v1alpha1 IPAM API. -// +k8s:conversion-gen=sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1 -package v1alpha1 diff --git a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/groupversion_info.go b/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/groupversion_info.go deleted file mode 100644 index 610dd03741d..00000000000 --- a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/groupversion_info.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// +kubebuilder:object:generate=true -// +groupName=ipam.cluster.x-k8s.io - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -var ( - // GroupVersion is group version used to register these objects. - GroupVersion = schema.GroupVersion{Group: "ipam.cluster.x-k8s.io", Version: "v1alpha1"} - - // schemeBuilder is used to add go types to the GroupVersionKind scheme. - schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = schemeBuilder.AddToScheme - - objectTypes = []runtime.Object{} - - // localSchemeBuilder is used for type conversions. - localSchemeBuilder = schemeBuilder -) - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(GroupVersion, objectTypes...) - metav1.AddToGroupVersion(scheme, GroupVersion) - return nil -} diff --git a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/ipaddress_types.go b/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/ipaddress_types.go deleted file mode 100644 index 172f2b7240d..00000000000 --- a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/ipaddress_types.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// IPAddressSpec is the desired state of an IPAddress. -type IPAddressSpec struct { - // ClaimRef is a reference to the claim this IPAddress was created for. - ClaimRef corev1.LocalObjectReference `json:"claimRef"` - - // PoolRef is a reference to the pool that this IPAddress was created from. - PoolRef corev1.TypedLocalObjectReference `json:"poolRef"` - - // Address is the IP address. - Address string `json:"address"` - - // Prefix is the prefix of the address. - Prefix int `json:"prefix"` - - // Gateway is the network gateway of the network the address is from. - // +optional - Gateway string `json:"gateway,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=ipaddresses,scope=Namespaced,categories=cluster-api -// +kubebuilder:printcolumn:name="Address",type="string",JSONPath=".spec.address",description="Address" -// +kubebuilder:printcolumn:name="Pool Name",type="string",JSONPath=".spec.poolRef.name",description="Name of the pool the address is from" -// +kubebuilder:printcolumn:name="Pool Kind",type="string",JSONPath=".spec.poolRef.kind",description="Kind of the pool the address is from" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of IPAdress" - -// IPAddress is the Schema for the ipaddress API. -type IPAddress struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec IPAddressSpec `json:"spec,omitempty"` -} - -// +kubebuilder:object:root=true - -// IPAddressList is a list of IPAddress. -type IPAddressList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []IPAddress `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &IPAddress{}, &IPAddressList{}) -} diff --git a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/ipaddressclaim_types.go b/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/ipaddressclaim_types.go deleted file mode 100644 index b66a8748d64..00000000000 --- a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/ipaddressclaim_types.go +++ /dev/null @@ -1,80 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" -) - -// IPAddressClaimSpec is the desired state of an IPAddressClaim. -type IPAddressClaimSpec struct { - // PoolRef is a reference to the pool from which an IP address should be created. - PoolRef corev1.TypedLocalObjectReference `json:"poolRef"` -} - -// IPAddressClaimStatus is the observed status of a IPAddressClaim. -type IPAddressClaimStatus struct { - // AddressRef is a reference to the address that was created for this claim. - // +optional - AddressRef corev1.LocalObjectReference `json:"addressRef,omitempty"` - - // Conditions summarises the current state of the IPAddressClaim - // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=ipaddressclaims,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Pool Name",type="string",JSONPath=".spec.poolRef.name",description="Name of the pool to allocate an address from" -// +kubebuilder:printcolumn:name="Pool Kind",type="string",JSONPath=".spec.poolRef.kind",description="Kind of the pool to allocate an address from" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of IPAdressClaim" - -// IPAddressClaim is the Schema for the ipaddressclaim API. -type IPAddressClaim struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec IPAddressClaimSpec `json:"spec,omitempty"` - Status IPAddressClaimStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (m *IPAddressClaim) GetConditions() clusterv1.Conditions { - return m.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (m *IPAddressClaim) SetConditions(conditions clusterv1.Conditions) { - m.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true - -// IPAddressClaimList is a list of IPAddressClaims. -type IPAddressClaimList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []IPAddressClaim `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &IPAddressClaim{}, &IPAddressClaimList{}) -} diff --git a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/zz_generated.conversion.go b/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/zz_generated.conversion.go deleted file mode 100644 index 50d181393b9..00000000000 --- a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/zz_generated.conversion.go +++ /dev/null @@ -1,283 +0,0 @@ -//go:build !ignore_autogenerated_core_exp_ipam -// +build !ignore_autogenerated_core_exp_ipam - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - unsafe "unsafe" - - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" - v1beta1 "sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*IPAddress)(nil), (*v1beta1.IPAddress)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_IPAddress_To_v1beta1_IPAddress(a.(*IPAddress), b.(*v1beta1.IPAddress), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.IPAddress)(nil), (*IPAddress)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IPAddress_To_v1alpha1_IPAddress(a.(*v1beta1.IPAddress), b.(*IPAddress), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IPAddressClaim)(nil), (*v1beta1.IPAddressClaim)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_IPAddressClaim_To_v1beta1_IPAddressClaim(a.(*IPAddressClaim), b.(*v1beta1.IPAddressClaim), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.IPAddressClaim)(nil), (*IPAddressClaim)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IPAddressClaim_To_v1alpha1_IPAddressClaim(a.(*v1beta1.IPAddressClaim), b.(*IPAddressClaim), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IPAddressClaimList)(nil), (*v1beta1.IPAddressClaimList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_IPAddressClaimList_To_v1beta1_IPAddressClaimList(a.(*IPAddressClaimList), b.(*v1beta1.IPAddressClaimList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.IPAddressClaimList)(nil), (*IPAddressClaimList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IPAddressClaimList_To_v1alpha1_IPAddressClaimList(a.(*v1beta1.IPAddressClaimList), b.(*IPAddressClaimList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IPAddressClaimSpec)(nil), (*v1beta1.IPAddressClaimSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_IPAddressClaimSpec_To_v1beta1_IPAddressClaimSpec(a.(*IPAddressClaimSpec), b.(*v1beta1.IPAddressClaimSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.IPAddressClaimSpec)(nil), (*IPAddressClaimSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IPAddressClaimSpec_To_v1alpha1_IPAddressClaimSpec(a.(*v1beta1.IPAddressClaimSpec), b.(*IPAddressClaimSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IPAddressClaimStatus)(nil), (*v1beta1.IPAddressClaimStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_IPAddressClaimStatus_To_v1beta1_IPAddressClaimStatus(a.(*IPAddressClaimStatus), b.(*v1beta1.IPAddressClaimStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.IPAddressClaimStatus)(nil), (*IPAddressClaimStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IPAddressClaimStatus_To_v1alpha1_IPAddressClaimStatus(a.(*v1beta1.IPAddressClaimStatus), b.(*IPAddressClaimStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IPAddressList)(nil), (*v1beta1.IPAddressList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_IPAddressList_To_v1beta1_IPAddressList(a.(*IPAddressList), b.(*v1beta1.IPAddressList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.IPAddressList)(nil), (*IPAddressList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IPAddressList_To_v1alpha1_IPAddressList(a.(*v1beta1.IPAddressList), b.(*IPAddressList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*IPAddressSpec)(nil), (*v1beta1.IPAddressSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_IPAddressSpec_To_v1beta1_IPAddressSpec(a.(*IPAddressSpec), b.(*v1beta1.IPAddressSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.IPAddressSpec)(nil), (*IPAddressSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_IPAddressSpec_To_v1alpha1_IPAddressSpec(a.(*v1beta1.IPAddressSpec), b.(*IPAddressSpec), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha1_IPAddress_To_v1beta1_IPAddress(in *IPAddress, out *v1beta1.IPAddress, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_IPAddressSpec_To_v1beta1_IPAddressSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_IPAddress_To_v1beta1_IPAddress is an autogenerated conversion function. -func Convert_v1alpha1_IPAddress_To_v1beta1_IPAddress(in *IPAddress, out *v1beta1.IPAddress, s conversion.Scope) error { - return autoConvert_v1alpha1_IPAddress_To_v1beta1_IPAddress(in, out, s) -} - -func autoConvert_v1beta1_IPAddress_To_v1alpha1_IPAddress(in *v1beta1.IPAddress, out *IPAddress, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_IPAddressSpec_To_v1alpha1_IPAddressSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_IPAddress_To_v1alpha1_IPAddress is an autogenerated conversion function. -func Convert_v1beta1_IPAddress_To_v1alpha1_IPAddress(in *v1beta1.IPAddress, out *IPAddress, s conversion.Scope) error { - return autoConvert_v1beta1_IPAddress_To_v1alpha1_IPAddress(in, out, s) -} - -func autoConvert_v1alpha1_IPAddressClaim_To_v1beta1_IPAddressClaim(in *IPAddressClaim, out *v1beta1.IPAddressClaim, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_IPAddressClaimSpec_To_v1beta1_IPAddressClaimSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha1_IPAddressClaimStatus_To_v1beta1_IPAddressClaimStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_IPAddressClaim_To_v1beta1_IPAddressClaim is an autogenerated conversion function. -func Convert_v1alpha1_IPAddressClaim_To_v1beta1_IPAddressClaim(in *IPAddressClaim, out *v1beta1.IPAddressClaim, s conversion.Scope) error { - return autoConvert_v1alpha1_IPAddressClaim_To_v1beta1_IPAddressClaim(in, out, s) -} - -func autoConvert_v1beta1_IPAddressClaim_To_v1alpha1_IPAddressClaim(in *v1beta1.IPAddressClaim, out *IPAddressClaim, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_IPAddressClaimSpec_To_v1alpha1_IPAddressClaimSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_IPAddressClaimStatus_To_v1alpha1_IPAddressClaimStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_IPAddressClaim_To_v1alpha1_IPAddressClaim is an autogenerated conversion function. -func Convert_v1beta1_IPAddressClaim_To_v1alpha1_IPAddressClaim(in *v1beta1.IPAddressClaim, out *IPAddressClaim, s conversion.Scope) error { - return autoConvert_v1beta1_IPAddressClaim_To_v1alpha1_IPAddressClaim(in, out, s) -} - -func autoConvert_v1alpha1_IPAddressClaimList_To_v1beta1_IPAddressClaimList(in *IPAddressClaimList, out *v1beta1.IPAddressClaimList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1beta1.IPAddressClaim)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha1_IPAddressClaimList_To_v1beta1_IPAddressClaimList is an autogenerated conversion function. -func Convert_v1alpha1_IPAddressClaimList_To_v1beta1_IPAddressClaimList(in *IPAddressClaimList, out *v1beta1.IPAddressClaimList, s conversion.Scope) error { - return autoConvert_v1alpha1_IPAddressClaimList_To_v1beta1_IPAddressClaimList(in, out, s) -} - -func autoConvert_v1beta1_IPAddressClaimList_To_v1alpha1_IPAddressClaimList(in *v1beta1.IPAddressClaimList, out *IPAddressClaimList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]IPAddressClaim)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_IPAddressClaimList_To_v1alpha1_IPAddressClaimList is an autogenerated conversion function. -func Convert_v1beta1_IPAddressClaimList_To_v1alpha1_IPAddressClaimList(in *v1beta1.IPAddressClaimList, out *IPAddressClaimList, s conversion.Scope) error { - return autoConvert_v1beta1_IPAddressClaimList_To_v1alpha1_IPAddressClaimList(in, out, s) -} - -func autoConvert_v1alpha1_IPAddressClaimSpec_To_v1beta1_IPAddressClaimSpec(in *IPAddressClaimSpec, out *v1beta1.IPAddressClaimSpec, s conversion.Scope) error { - out.PoolRef = in.PoolRef - return nil -} - -// Convert_v1alpha1_IPAddressClaimSpec_To_v1beta1_IPAddressClaimSpec is an autogenerated conversion function. -func Convert_v1alpha1_IPAddressClaimSpec_To_v1beta1_IPAddressClaimSpec(in *IPAddressClaimSpec, out *v1beta1.IPAddressClaimSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_IPAddressClaimSpec_To_v1beta1_IPAddressClaimSpec(in, out, s) -} - -func autoConvert_v1beta1_IPAddressClaimSpec_To_v1alpha1_IPAddressClaimSpec(in *v1beta1.IPAddressClaimSpec, out *IPAddressClaimSpec, s conversion.Scope) error { - out.PoolRef = in.PoolRef - return nil -} - -// Convert_v1beta1_IPAddressClaimSpec_To_v1alpha1_IPAddressClaimSpec is an autogenerated conversion function. -func Convert_v1beta1_IPAddressClaimSpec_To_v1alpha1_IPAddressClaimSpec(in *v1beta1.IPAddressClaimSpec, out *IPAddressClaimSpec, s conversion.Scope) error { - return autoConvert_v1beta1_IPAddressClaimSpec_To_v1alpha1_IPAddressClaimSpec(in, out, s) -} - -func autoConvert_v1alpha1_IPAddressClaimStatus_To_v1beta1_IPAddressClaimStatus(in *IPAddressClaimStatus, out *v1beta1.IPAddressClaimStatus, s conversion.Scope) error { - out.AddressRef = in.AddressRef - out.Conditions = *(*apiv1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1alpha1_IPAddressClaimStatus_To_v1beta1_IPAddressClaimStatus is an autogenerated conversion function. -func Convert_v1alpha1_IPAddressClaimStatus_To_v1beta1_IPAddressClaimStatus(in *IPAddressClaimStatus, out *v1beta1.IPAddressClaimStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_IPAddressClaimStatus_To_v1beta1_IPAddressClaimStatus(in, out, s) -} - -func autoConvert_v1beta1_IPAddressClaimStatus_To_v1alpha1_IPAddressClaimStatus(in *v1beta1.IPAddressClaimStatus, out *IPAddressClaimStatus, s conversion.Scope) error { - out.AddressRef = in.AddressRef - out.Conditions = *(*apiv1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1beta1_IPAddressClaimStatus_To_v1alpha1_IPAddressClaimStatus is an autogenerated conversion function. -func Convert_v1beta1_IPAddressClaimStatus_To_v1alpha1_IPAddressClaimStatus(in *v1beta1.IPAddressClaimStatus, out *IPAddressClaimStatus, s conversion.Scope) error { - return autoConvert_v1beta1_IPAddressClaimStatus_To_v1alpha1_IPAddressClaimStatus(in, out, s) -} - -func autoConvert_v1alpha1_IPAddressList_To_v1beta1_IPAddressList(in *IPAddressList, out *v1beta1.IPAddressList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1beta1.IPAddress)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha1_IPAddressList_To_v1beta1_IPAddressList is an autogenerated conversion function. -func Convert_v1alpha1_IPAddressList_To_v1beta1_IPAddressList(in *IPAddressList, out *v1beta1.IPAddressList, s conversion.Scope) error { - return autoConvert_v1alpha1_IPAddressList_To_v1beta1_IPAddressList(in, out, s) -} - -func autoConvert_v1beta1_IPAddressList_To_v1alpha1_IPAddressList(in *v1beta1.IPAddressList, out *IPAddressList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]IPAddress)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_IPAddressList_To_v1alpha1_IPAddressList is an autogenerated conversion function. -func Convert_v1beta1_IPAddressList_To_v1alpha1_IPAddressList(in *v1beta1.IPAddressList, out *IPAddressList, s conversion.Scope) error { - return autoConvert_v1beta1_IPAddressList_To_v1alpha1_IPAddressList(in, out, s) -} - -func autoConvert_v1alpha1_IPAddressSpec_To_v1beta1_IPAddressSpec(in *IPAddressSpec, out *v1beta1.IPAddressSpec, s conversion.Scope) error { - out.ClaimRef = in.ClaimRef - out.PoolRef = in.PoolRef - out.Address = in.Address - out.Prefix = in.Prefix - out.Gateway = in.Gateway - return nil -} - -// Convert_v1alpha1_IPAddressSpec_To_v1beta1_IPAddressSpec is an autogenerated conversion function. -func Convert_v1alpha1_IPAddressSpec_To_v1beta1_IPAddressSpec(in *IPAddressSpec, out *v1beta1.IPAddressSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_IPAddressSpec_To_v1beta1_IPAddressSpec(in, out, s) -} - -func autoConvert_v1beta1_IPAddressSpec_To_v1alpha1_IPAddressSpec(in *v1beta1.IPAddressSpec, out *IPAddressSpec, s conversion.Scope) error { - out.ClaimRef = in.ClaimRef - out.PoolRef = in.PoolRef - out.Address = in.Address - out.Prefix = in.Prefix - out.Gateway = in.Gateway - return nil -} - -// Convert_v1beta1_IPAddressSpec_To_v1alpha1_IPAddressSpec is an autogenerated conversion function. -func Convert_v1beta1_IPAddressSpec_To_v1alpha1_IPAddressSpec(in *v1beta1.IPAddressSpec, out *IPAddressSpec, s conversion.Scope) error { - return autoConvert_v1beta1_IPAddressSpec_To_v1alpha1_IPAddressSpec(in, out, s) -} diff --git a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index 650f11b0d32..00000000000 --- a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,199 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime" - "sigs.k8s.io/cluster-api/api/v1beta1" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IPAddress) DeepCopyInto(out *IPAddress) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddress. -func (in *IPAddress) DeepCopy() *IPAddress { - if in == nil { - return nil - } - out := new(IPAddress) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *IPAddress) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IPAddressClaim) DeepCopyInto(out *IPAddressClaim) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressClaim. -func (in *IPAddressClaim) DeepCopy() *IPAddressClaim { - if in == nil { - return nil - } - out := new(IPAddressClaim) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *IPAddressClaim) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IPAddressClaimList) DeepCopyInto(out *IPAddressClaimList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]IPAddressClaim, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressClaimList. -func (in *IPAddressClaimList) DeepCopy() *IPAddressClaimList { - if in == nil { - return nil - } - out := new(IPAddressClaimList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *IPAddressClaimList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IPAddressClaimSpec) DeepCopyInto(out *IPAddressClaimSpec) { - *out = *in - in.PoolRef.DeepCopyInto(&out.PoolRef) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressClaimSpec. -func (in *IPAddressClaimSpec) DeepCopy() *IPAddressClaimSpec { - if in == nil { - return nil - } - out := new(IPAddressClaimSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IPAddressClaimStatus) DeepCopyInto(out *IPAddressClaimStatus) { - *out = *in - out.AddressRef = in.AddressRef - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(v1beta1.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressClaimStatus. -func (in *IPAddressClaimStatus) DeepCopy() *IPAddressClaimStatus { - if in == nil { - return nil - } - out := new(IPAddressClaimStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IPAddressList) DeepCopyInto(out *IPAddressList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]IPAddress, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressList. -func (in *IPAddressList) DeepCopy() *IPAddressList { - if in == nil { - return nil - } - out := new(IPAddressList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *IPAddressList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IPAddressSpec) DeepCopyInto(out *IPAddressSpec) { - *out = *in - out.ClaimRef = in.ClaimRef - in.PoolRef.DeepCopyInto(&out.PoolRef) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressSpec. -func (in *IPAddressSpec) DeepCopy() *IPAddressSpec { - if in == nil { - return nil - } - out := new(IPAddressSpec) - in.DeepCopyInto(out) - return out -}