diff --git a/Makefile b/Makefile index 3b828ba4634..9f807382871 100644 --- a/Makefile +++ b/Makefile @@ -337,7 +337,6 @@ create-aks-cluster: $(KUSTOMIZE) $(ENVSUBST) $(KUBECTL) ## Create a aks cluster. .PHONY: create-cluster create-cluster: ## Create a workload development Kubernetes cluster on Azure in a kind management cluster. EXP_CLUSTER_RESOURCE_SET=true \ - EXP_AKS=true \ EXP_MACHINE_POOL=true \ $(MAKE) create-management-cluster \ create-workload-cluster @@ -707,7 +706,7 @@ kind-create: $(KUBECTL) ## Create capz kind cluster if needed. .PHONY: tilt-up tilt-up: install-tools kind-create ## Start tilt and build kind cluster if needed. - EXP_CLUSTER_RESOURCE_SET=true EXP_AKS=true EXP_MACHINE_POOL=true tilt up + EXP_CLUSTER_RESOURCE_SET=true EXP_MACHINE_POOL=true tilt up .PHONY: delete-cluster delete-cluster: delete-workload-cluster ## Deletes the example kind cluster "capz". diff --git a/exp/api/v1alpha3/azuremanagedcluster_conversion.go b/api/v1alpha3/azuremanagedcluster_conversion.go similarity index 86% rename from exp/api/v1alpha3/azuremanagedcluster_conversion.go rename to api/v1alpha3/azuremanagedcluster_conversion.go index 383eba37172..eaecbf00ec6 100644 --- a/exp/api/v1alpha3/azuremanagedcluster_conversion.go +++ b/api/v1alpha3/azuremanagedcluster_conversion.go @@ -17,20 +17,20 @@ limitations under the License. package v1alpha3 import ( - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" "sigs.k8s.io/controller-runtime/pkg/conversion" ) // ConvertTo converts this AzureManagedCluster to the Hub version (v1beta1). func (src *AzureManagedCluster) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1exp.AzureManagedCluster) + dst := dstRaw.(*infrav1.AzureManagedCluster) if err := Convert_v1alpha3_AzureManagedCluster_To_v1beta1_AzureManagedCluster(src, dst, nil); err != nil { return err } // Manually restore data. - restored := &infrav1exp.AzureManagedCluster{} + restored := &infrav1.AzureManagedCluster{} if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { return err } @@ -40,7 +40,7 @@ func (src *AzureManagedCluster) ConvertTo(dstRaw conversion.Hub) error { // ConvertFrom converts from the Hub version (v1beta1) to this version. func (dst *AzureManagedCluster) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1exp.AzureManagedCluster) + src := srcRaw.(*infrav1.AzureManagedCluster) if err := Convert_v1beta1_AzureManagedCluster_To_v1alpha3_AzureManagedCluster(src, dst, nil); err != nil { return err @@ -52,12 +52,12 @@ func (dst *AzureManagedCluster) ConvertFrom(srcRaw conversion.Hub) error { // ConvertTo converts this AzureManagedClusterList to the Hub version (v1beta1). func (src *AzureManagedClusterList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1exp.AzureManagedClusterList) + dst := dstRaw.(*infrav1.AzureManagedClusterList) return Convert_v1alpha3_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(src, dst, nil) } // ConvertFrom converts from the Hub version (v1beta1) to this version. func (dst *AzureManagedClusterList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1exp.AzureManagedClusterList) + src := srcRaw.(*infrav1.AzureManagedClusterList) return Convert_v1beta1_AzureManagedClusterList_To_v1alpha3_AzureManagedClusterList(src, dst, nil) } diff --git a/exp/api/v1alpha3/azuremanagedcluster_types.go b/api/v1alpha3/azuremanagedcluster_types.go similarity index 100% rename from exp/api/v1alpha3/azuremanagedcluster_types.go rename to api/v1alpha3/azuremanagedcluster_types.go diff --git a/exp/api/v1alpha3/azuremanagedcontrolplane_conversion.go b/api/v1alpha3/azuremanagedcontrolplane_conversion.go similarity index 76% rename from exp/api/v1alpha3/azuremanagedcontrolplane_conversion.go rename to api/v1alpha3/azuremanagedcontrolplane_conversion.go index 7b3a45620e7..b08b18362a4 100644 --- a/exp/api/v1alpha3/azuremanagedcontrolplane_conversion.go +++ b/api/v1alpha3/azuremanagedcontrolplane_conversion.go @@ -18,20 +18,20 @@ package v1alpha3 import ( apiconversion "k8s.io/apimachinery/pkg/conversion" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" "sigs.k8s.io/controller-runtime/pkg/conversion" ) // ConvertTo converts this AzureManagedControlPlane to the Hub version (v1beta1). func (src *AzureManagedControlPlane) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1exp.AzureManagedControlPlane) + dst := dstRaw.(*infrav1.AzureManagedControlPlane) if err := Convert_v1alpha3_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(src, dst, nil); err != nil { return err } // Manually restore data. - restored := &infrav1exp.AzureManagedControlPlane{} + restored := &infrav1.AzureManagedControlPlane{} if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { return err } @@ -53,7 +53,7 @@ func (src *AzureManagedControlPlane) ConvertTo(dstRaw conversion.Hub) error { // ConvertFrom converts from the Hub version (v1beta1) to this version. func (dst *AzureManagedControlPlane) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1exp.AzureManagedControlPlane) + src := srcRaw.(*infrav1.AzureManagedControlPlane) if err := Convert_v1beta1_AzureManagedControlPlane_To_v1alpha3_AzureManagedControlPlane(src, dst, nil); err != nil { return err @@ -64,29 +64,29 @@ func (dst *AzureManagedControlPlane) ConvertFrom(srcRaw conversion.Hub) error { } // Convert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha3_AzureManagedControlPlaneSpec is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha3_AzureManagedControlPlaneSpec(in *infrav1exp.AzureManagedControlPlaneSpec, out *AzureManagedControlPlaneSpec, s apiconversion.Scope) error { +func Convert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha3_AzureManagedControlPlaneSpec(in *infrav1.AzureManagedControlPlaneSpec, out *AzureManagedControlPlaneSpec, s apiconversion.Scope) error { return autoConvert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha3_AzureManagedControlPlaneSpec(in, out, s) } // Convert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha3_AzureManagedControlPlaneStatus is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha3_AzureManagedControlPlaneStatus(in *infrav1exp.AzureManagedControlPlaneStatus, out *AzureManagedControlPlaneStatus, s apiconversion.Scope) error { +func Convert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha3_AzureManagedControlPlaneStatus(in *infrav1.AzureManagedControlPlaneStatus, out *AzureManagedControlPlaneStatus, s apiconversion.Scope) error { return autoConvert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha3_AzureManagedControlPlaneStatus(in, out, s) } // ConvertTo converts this AzureManagedControlPlane to the Hub version (v1beta1). func (src *AzureManagedControlPlaneList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1exp.AzureManagedControlPlaneList) + dst := dstRaw.(*infrav1.AzureManagedControlPlaneList) return Convert_v1alpha3_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(src, dst, nil) } // ConvertFrom converts from the Hub version (v1beta1) to this version. func (dst *AzureManagedControlPlaneList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1exp.AzureManagedControlPlaneList) + src := srcRaw.(*infrav1.AzureManagedControlPlaneList) return Convert_v1beta1_AzureManagedControlPlaneList_To_v1alpha3_AzureManagedControlPlaneList(src, dst, nil) } // Convert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha3_ManagedControlPlaneVirtualNetwork converts v1beta1 ManagedControlPlaneVirtualNetwork to v1alpha3 ManagedControlPlaneVirtualNetwork. -func Convert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha3_ManagedControlPlaneVirtualNetwork(in *infrav1exp.ManagedControlPlaneVirtualNetwork, out *ManagedControlPlaneVirtualNetwork, s apiconversion.Scope) error { +func Convert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha3_ManagedControlPlaneVirtualNetwork(in *infrav1.ManagedControlPlaneVirtualNetwork, out *ManagedControlPlaneVirtualNetwork, s apiconversion.Scope) error { out.Name = in.Name out.Subnet.Name = in.Subnet.Name out.Subnet.CIDRBlock = in.Subnet.CIDRBlock @@ -94,3 +94,8 @@ func Convert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha3_ManagedContro return nil } + +// Convert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha3_ManagedControlPlaneSubnet is a conversion function. +func Convert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha3_ManagedControlPlaneSubnet(in *infrav1.ManagedControlPlaneSubnet, out *ManagedControlPlaneSubnet, s apiconversion.Scope) error { + return autoConvert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha3_ManagedControlPlaneSubnet(in, out, s) +} diff --git a/exp/api/v1alpha3/azuremanagedcontrolplane_types.go b/api/v1alpha3/azuremanagedcontrolplane_types.go similarity index 97% rename from exp/api/v1alpha3/azuremanagedcontrolplane_types.go rename to api/v1alpha3/azuremanagedcontrolplane_types.go index 85fe8a0ffe1..2cfe68ec7b9 100644 --- a/exp/api/v1alpha3/azuremanagedcontrolplane_types.go +++ b/api/v1alpha3/azuremanagedcontrolplane_types.go @@ -18,7 +18,6 @@ package v1alpha3 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1alpha3 "sigs.k8s.io/cluster-api-provider-azure/api/v1alpha3" clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" ) @@ -52,7 +51,7 @@ type AzureManagedControlPlaneSpec struct { // AdditionalTags is an optional set of tags to add to Azure resources managed by the Azure provider, in addition to the // ones added by default. // +optional - AdditionalTags infrav1alpha3.Tags `json:"additionalTags,omitempty"` + AdditionalTags Tags `json:"additionalTags,omitempty"` // NetworkPlugin used for building Kubernetes network. // +kubebuilder:validation:Enum=azure;kubenet diff --git a/exp/api/v1alpha3/azuremanagedmachinepool_conversion.go b/api/v1alpha3/azuremanagedmachinepool_conversion.go similarity index 85% rename from exp/api/v1alpha3/azuremanagedmachinepool_conversion.go rename to api/v1alpha3/azuremanagedmachinepool_conversion.go index 29126e7e938..3958c37aee4 100644 --- a/exp/api/v1alpha3/azuremanagedmachinepool_conversion.go +++ b/api/v1alpha3/azuremanagedmachinepool_conversion.go @@ -18,20 +18,20 @@ package v1alpha3 import ( apiconversion "k8s.io/apimachinery/pkg/conversion" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" "sigs.k8s.io/controller-runtime/pkg/conversion" ) // ConvertTo converts this AzureManagedMachinePool to the Hub version (v1beta1). func (src *AzureManagedMachinePool) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1exp.AzureManagedMachinePool) + dst := dstRaw.(*infrav1.AzureManagedMachinePool) if err := Convert_v1alpha3_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(src, dst, nil); err != nil { return err } // Manually restore data. - restored := &infrav1exp.AzureManagedMachinePool{} + restored := &infrav1.AzureManagedMachinePool{} if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { return err } @@ -62,7 +62,7 @@ func (src *AzureManagedMachinePool) ConvertTo(dstRaw conversion.Hub) error { // ConvertFrom converts from the Hub version (v1beta1) to this version. func (dst *AzureManagedMachinePool) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1exp.AzureManagedMachinePool) + src := srcRaw.(*infrav1.AzureManagedMachinePool) if err := Convert_v1beta1_AzureManagedMachinePool_To_v1alpha3_AzureManagedMachinePool(src, dst, nil); err != nil { return err } @@ -72,23 +72,23 @@ func (dst *AzureManagedMachinePool) ConvertFrom(srcRaw conversion.Hub) error { } // Convert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha3_AzureManagedMachinePoolSpec is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha3_AzureManagedMachinePoolSpec(in *infrav1exp.AzureManagedMachinePoolSpec, out *AzureManagedMachinePoolSpec, s apiconversion.Scope) error { +func Convert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha3_AzureManagedMachinePoolSpec(in *infrav1.AzureManagedMachinePoolSpec, out *AzureManagedMachinePoolSpec, s apiconversion.Scope) error { return autoConvert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha3_AzureManagedMachinePoolSpec(in, out, s) } // Convert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha3_AzureManagedMachinePoolStatus is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha3_AzureManagedMachinePoolStatus(in *infrav1exp.AzureManagedMachinePoolStatus, out *AzureManagedMachinePoolStatus, s apiconversion.Scope) error { +func Convert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha3_AzureManagedMachinePoolStatus(in *infrav1.AzureManagedMachinePoolStatus, out *AzureManagedMachinePoolStatus, s apiconversion.Scope) error { return autoConvert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha3_AzureManagedMachinePoolStatus(in, out, s) } // ConvertTo converts this AzureManagedMachinePoolList to the Hub version (v1beta1). func (src *AzureManagedMachinePoolList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1exp.AzureManagedMachinePoolList) + dst := dstRaw.(*infrav1.AzureManagedMachinePoolList) return Convert_v1alpha3_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(src, dst, nil) } // ConvertFrom converts from the Hub version (v1beta1) to this version. func (dst *AzureManagedMachinePoolList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1exp.AzureManagedMachinePoolList) + src := srcRaw.(*infrav1.AzureManagedMachinePoolList) return Convert_v1beta1_AzureManagedMachinePoolList_To_v1alpha3_AzureManagedMachinePoolList(src, dst, nil) } diff --git a/exp/api/v1alpha3/azuremanagedmachinepool_types.go b/api/v1alpha3/azuremanagedmachinepool_types.go similarity index 100% rename from exp/api/v1alpha3/azuremanagedmachinepool_types.go rename to api/v1alpha3/azuremanagedmachinepool_types.go diff --git a/api/v1alpha3/conversion_test.go b/api/v1alpha3/conversion_test.go index 32e3cebaf67..c4eabcbe1db 100644 --- a/api/v1alpha3/conversion_test.go +++ b/api/v1alpha3/conversion_test.go @@ -62,6 +62,24 @@ func TestFuzzyConversion(t *testing.T) { Spoke: &AzureClusterIdentity{}, FuzzerFuncs: []fuzzer.FuzzerFuncs{overrideDeprecatedAndRemovedFieldsFuncs}, })) + + t.Run("for AzureManagedCluster", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &infrav1.AzureManagedCluster{}, + Spoke: &AzureManagedCluster{}, + })) + + t.Run("for AzureManagedControlPlane", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &infrav1.AzureManagedControlPlane{}, + Spoke: &AzureManagedControlPlane{}, + })) + + t.Run("for AzureManagedMachinePool", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &infrav1.AzureManagedMachinePool{}, + Spoke: &AzureManagedMachinePool{}, + })) } func overrideDeprecatedAndRemovedFieldsFuncs(codecs runtimeserializer.CodecFactory) []interface{} { diff --git a/api/v1alpha3/zz_generated.conversion.go b/api/v1alpha3/zz_generated.conversion.go index 62ead6593c4..9453d5ed5b2 100644 --- a/api/v1alpha3/zz_generated.conversion.go +++ b/api/v1alpha3/zz_generated.conversion.go @@ -41,6 +41,16 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*AADProfile)(nil), (*v1beta1.AADProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AADProfile_To_v1beta1_AADProfile(a.(*AADProfile), b.(*v1beta1.AADProfile), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AADProfile)(nil), (*AADProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AADProfile_To_v1alpha3_AADProfile(a.(*v1beta1.AADProfile), b.(*AADProfile), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*AddressRecord)(nil), (*v1beta1.AddressRecord)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha3_AddressRecord_To_v1beta1_AddressRecord(a.(*AddressRecord), b.(*v1beta1.AddressRecord), scope) }); err != nil { @@ -156,6 +166,106 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*AzureManagedCluster)(nil), (*v1beta1.AzureManagedCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AzureManagedCluster_To_v1beta1_AzureManagedCluster(a.(*AzureManagedCluster), b.(*v1beta1.AzureManagedCluster), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedCluster)(nil), (*AzureManagedCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedCluster_To_v1alpha3_AzureManagedCluster(a.(*v1beta1.AzureManagedCluster), b.(*AzureManagedCluster), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedClusterList)(nil), (*v1beta1.AzureManagedClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(a.(*AzureManagedClusterList), b.(*v1beta1.AzureManagedClusterList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedClusterList)(nil), (*AzureManagedClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedClusterList_To_v1alpha3_AzureManagedClusterList(a.(*v1beta1.AzureManagedClusterList), b.(*AzureManagedClusterList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedClusterSpec)(nil), (*v1beta1.AzureManagedClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(a.(*AzureManagedClusterSpec), b.(*v1beta1.AzureManagedClusterSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedClusterSpec)(nil), (*AzureManagedClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedClusterSpec_To_v1alpha3_AzureManagedClusterSpec(a.(*v1beta1.AzureManagedClusterSpec), b.(*AzureManagedClusterSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedClusterStatus)(nil), (*v1beta1.AzureManagedClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(a.(*AzureManagedClusterStatus), b.(*v1beta1.AzureManagedClusterStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedClusterStatus)(nil), (*AzureManagedClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedClusterStatus_To_v1alpha3_AzureManagedClusterStatus(a.(*v1beta1.AzureManagedClusterStatus), b.(*AzureManagedClusterStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedControlPlane)(nil), (*v1beta1.AzureManagedControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(a.(*AzureManagedControlPlane), b.(*v1beta1.AzureManagedControlPlane), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedControlPlane)(nil), (*AzureManagedControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedControlPlane_To_v1alpha3_AzureManagedControlPlane(a.(*v1beta1.AzureManagedControlPlane), b.(*AzureManagedControlPlane), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedControlPlaneList)(nil), (*v1beta1.AzureManagedControlPlaneList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(a.(*AzureManagedControlPlaneList), b.(*v1beta1.AzureManagedControlPlaneList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedControlPlaneList)(nil), (*AzureManagedControlPlaneList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedControlPlaneList_To_v1alpha3_AzureManagedControlPlaneList(a.(*v1beta1.AzureManagedControlPlaneList), b.(*AzureManagedControlPlaneList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedControlPlaneSpec)(nil), (*v1beta1.AzureManagedControlPlaneSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(a.(*AzureManagedControlPlaneSpec), b.(*v1beta1.AzureManagedControlPlaneSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedControlPlaneStatus)(nil), (*v1beta1.AzureManagedControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(a.(*AzureManagedControlPlaneStatus), b.(*v1beta1.AzureManagedControlPlaneStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedMachinePool)(nil), (*v1beta1.AzureManagedMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(a.(*AzureManagedMachinePool), b.(*v1beta1.AzureManagedMachinePool), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedMachinePool)(nil), (*AzureManagedMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedMachinePool_To_v1alpha3_AzureManagedMachinePool(a.(*v1beta1.AzureManagedMachinePool), b.(*AzureManagedMachinePool), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedMachinePoolList)(nil), (*v1beta1.AzureManagedMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(a.(*AzureManagedMachinePoolList), b.(*v1beta1.AzureManagedMachinePoolList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedMachinePoolList)(nil), (*AzureManagedMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedMachinePoolList_To_v1alpha3_AzureManagedMachinePoolList(a.(*v1beta1.AzureManagedMachinePoolList), b.(*AzureManagedMachinePoolList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedMachinePoolSpec)(nil), (*v1beta1.AzureManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(a.(*AzureManagedMachinePoolSpec), b.(*v1beta1.AzureManagedMachinePoolSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedMachinePoolStatus)(nil), (*v1beta1.AzureManagedMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(a.(*AzureManagedMachinePoolStatus), b.(*v1beta1.AzureManagedMachinePoolStatus), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*AzureSharedGalleryImage)(nil), (*v1beta1.AzureSharedGalleryImage)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha3_AzureSharedGalleryImage_To_v1beta1_AzureSharedGalleryImage(a.(*AzureSharedGalleryImage), b.(*v1beta1.AzureSharedGalleryImage), scope) }); err != nil { @@ -206,6 +316,16 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*ManagedControlPlaneSubnet)(nil), (*v1beta1.ManagedControlPlaneSubnet)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(a.(*ManagedControlPlaneSubnet), b.(*v1beta1.ManagedControlPlaneSubnet), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ManagedControlPlaneVirtualNetwork)(nil), (*v1beta1.ManagedControlPlaneVirtualNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(a.(*ManagedControlPlaneVirtualNetwork), b.(*v1beta1.ManagedControlPlaneVirtualNetwork), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*PublicIPSpec)(nil), (*v1beta1.PublicIPSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha3_PublicIPSpec_To_v1beta1_PublicIPSpec(a.(*PublicIPSpec), b.(*v1beta1.PublicIPSpec), scope) }); err != nil { @@ -356,6 +476,26 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddConversionFunc((*v1beta1.AzureManagedControlPlaneSpec)(nil), (*AzureManagedControlPlaneSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha3_AzureManagedControlPlaneSpec(a.(*v1beta1.AzureManagedControlPlaneSpec), b.(*AzureManagedControlPlaneSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta1.AzureManagedControlPlaneStatus)(nil), (*AzureManagedControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha3_AzureManagedControlPlaneStatus(a.(*v1beta1.AzureManagedControlPlaneStatus), b.(*AzureManagedControlPlaneStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta1.AzureManagedMachinePoolSpec)(nil), (*AzureManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha3_AzureManagedMachinePoolSpec(a.(*v1beta1.AzureManagedMachinePoolSpec), b.(*AzureManagedMachinePoolSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta1.AzureManagedMachinePoolStatus)(nil), (*AzureManagedMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha3_AzureManagedMachinePoolStatus(a.(*v1beta1.AzureManagedMachinePoolStatus), b.(*AzureManagedMachinePoolStatus), scope) + }); err != nil { + return err + } if err := s.AddConversionFunc((*v1beta1.AzureMarketplaceImage)(nil), (*AzureMarketplaceImage)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_AzureMarketplaceImage_To_v1alpha3_AzureMarketplaceImage(a.(*v1beta1.AzureMarketplaceImage), b.(*AzureMarketplaceImage), scope) }); err != nil { @@ -386,6 +526,16 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddConversionFunc((*v1beta1.ManagedControlPlaneSubnet)(nil), (*ManagedControlPlaneSubnet)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha3_ManagedControlPlaneSubnet(a.(*v1beta1.ManagedControlPlaneSubnet), b.(*ManagedControlPlaneSubnet), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta1.ManagedControlPlaneVirtualNetwork)(nil), (*ManagedControlPlaneVirtualNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha3_ManagedControlPlaneVirtualNetwork(a.(*v1beta1.ManagedControlPlaneVirtualNetwork), b.(*ManagedControlPlaneVirtualNetwork), scope) + }); err != nil { + return err + } if err := s.AddConversionFunc((*v1beta1.ManagedDiskParameters)(nil), (*ManagedDisk)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_ManagedDiskParameters_To_v1alpha3_ManagedDisk(a.(*v1beta1.ManagedDiskParameters), b.(*ManagedDisk), scope) }); err != nil { @@ -434,6 +584,28 @@ func RegisterConversions(s *runtime.Scheme) error { return nil } +func autoConvert_v1alpha3_AADProfile_To_v1beta1_AADProfile(in *AADProfile, out *v1beta1.AADProfile, s conversion.Scope) error { + out.Managed = in.Managed + out.AdminGroupObjectIDs = *(*[]string)(unsafe.Pointer(&in.AdminGroupObjectIDs)) + return nil +} + +// Convert_v1alpha3_AADProfile_To_v1beta1_AADProfile is an autogenerated conversion function. +func Convert_v1alpha3_AADProfile_To_v1beta1_AADProfile(in *AADProfile, out *v1beta1.AADProfile, s conversion.Scope) error { + return autoConvert_v1alpha3_AADProfile_To_v1beta1_AADProfile(in, out, s) +} + +func autoConvert_v1beta1_AADProfile_To_v1alpha3_AADProfile(in *v1beta1.AADProfile, out *AADProfile, s conversion.Scope) error { + out.Managed = in.Managed + out.AdminGroupObjectIDs = *(*[]string)(unsafe.Pointer(&in.AdminGroupObjectIDs)) + return nil +} + +// Convert_v1beta1_AADProfile_To_v1alpha3_AADProfile is an autogenerated conversion function. +func Convert_v1beta1_AADProfile_To_v1alpha3_AADProfile(in *v1beta1.AADProfile, out *AADProfile, s conversion.Scope) error { + return autoConvert_v1beta1_AADProfile_To_v1alpha3_AADProfile(in, out, s) +} + func autoConvert_v1alpha3_AddressRecord_To_v1beta1_AddressRecord(in *AddressRecord, out *v1beta1.AddressRecord, s conversion.Scope) error { out.Hostname = in.Hostname out.IP = in.IP @@ -1082,6 +1254,405 @@ func Convert_v1beta1_AzureMachineTemplateSpec_To_v1alpha3_AzureMachineTemplateSp return autoConvert_v1beta1_AzureMachineTemplateSpec_To_v1alpha3_AzureMachineTemplateSpec(in, out, s) } +func autoConvert_v1alpha3_AzureManagedCluster_To_v1beta1_AzureManagedCluster(in *AzureManagedCluster, out *v1beta1.AzureManagedCluster, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha3_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_AzureManagedCluster_To_v1beta1_AzureManagedCluster is an autogenerated conversion function. +func Convert_v1alpha3_AzureManagedCluster_To_v1beta1_AzureManagedCluster(in *AzureManagedCluster, out *v1beta1.AzureManagedCluster, s conversion.Scope) error { + return autoConvert_v1alpha3_AzureManagedCluster_To_v1beta1_AzureManagedCluster(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedCluster_To_v1alpha3_AzureManagedCluster(in *v1beta1.AzureManagedCluster, out *AzureManagedCluster, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_AzureManagedClusterSpec_To_v1alpha3_AzureManagedClusterSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_AzureManagedClusterStatus_To_v1alpha3_AzureManagedClusterStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AzureManagedCluster_To_v1alpha3_AzureManagedCluster is an autogenerated conversion function. +func Convert_v1beta1_AzureManagedCluster_To_v1alpha3_AzureManagedCluster(in *v1beta1.AzureManagedCluster, out *AzureManagedCluster, s conversion.Scope) error { + return autoConvert_v1beta1_AzureManagedCluster_To_v1alpha3_AzureManagedCluster(in, out, s) +} + +func autoConvert_v1alpha3_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(in *AzureManagedClusterList, out *v1beta1.AzureManagedClusterList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta1.AzureManagedCluster, len(*in)) + for i := range *in { + if err := Convert_v1alpha3_AzureManagedCluster_To_v1beta1_AzureManagedCluster(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1alpha3_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList is an autogenerated conversion function. +func Convert_v1alpha3_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(in *AzureManagedClusterList, out *v1beta1.AzureManagedClusterList, s conversion.Scope) error { + return autoConvert_v1alpha3_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedClusterList_To_v1alpha3_AzureManagedClusterList(in *v1beta1.AzureManagedClusterList, out *AzureManagedClusterList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedCluster, len(*in)) + for i := range *in { + if err := Convert_v1beta1_AzureManagedCluster_To_v1alpha3_AzureManagedCluster(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_AzureManagedClusterList_To_v1alpha3_AzureManagedClusterList is an autogenerated conversion function. +func Convert_v1beta1_AzureManagedClusterList_To_v1alpha3_AzureManagedClusterList(in *v1beta1.AzureManagedClusterList, out *AzureManagedClusterList, s conversion.Scope) error { + return autoConvert_v1beta1_AzureManagedClusterList_To_v1alpha3_AzureManagedClusterList(in, out, s) +} + +func autoConvert_v1alpha3_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(in *AzureManagedClusterSpec, out *v1beta1.AzureManagedClusterSpec, s conversion.Scope) error { + if err := apiv1alpha3.Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec is an autogenerated conversion function. +func Convert_v1alpha3_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(in *AzureManagedClusterSpec, out *v1beta1.AzureManagedClusterSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedClusterSpec_To_v1alpha3_AzureManagedClusterSpec(in *v1beta1.AzureManagedClusterSpec, out *AzureManagedClusterSpec, s conversion.Scope) error { + if err := apiv1alpha3.Convert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AzureManagedClusterSpec_To_v1alpha3_AzureManagedClusterSpec is an autogenerated conversion function. +func Convert_v1beta1_AzureManagedClusterSpec_To_v1alpha3_AzureManagedClusterSpec(in *v1beta1.AzureManagedClusterSpec, out *AzureManagedClusterSpec, s conversion.Scope) error { + return autoConvert_v1beta1_AzureManagedClusterSpec_To_v1alpha3_AzureManagedClusterSpec(in, out, s) +} + +func autoConvert_v1alpha3_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(in *AzureManagedClusterStatus, out *v1beta1.AzureManagedClusterStatus, s conversion.Scope) error { + out.Ready = in.Ready + return nil +} + +// Convert_v1alpha3_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus is an autogenerated conversion function. +func Convert_v1alpha3_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(in *AzureManagedClusterStatus, out *v1beta1.AzureManagedClusterStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedClusterStatus_To_v1alpha3_AzureManagedClusterStatus(in *v1beta1.AzureManagedClusterStatus, out *AzureManagedClusterStatus, s conversion.Scope) error { + out.Ready = in.Ready + return nil +} + +// Convert_v1beta1_AzureManagedClusterStatus_To_v1alpha3_AzureManagedClusterStatus is an autogenerated conversion function. +func Convert_v1beta1_AzureManagedClusterStatus_To_v1alpha3_AzureManagedClusterStatus(in *v1beta1.AzureManagedClusterStatus, out *AzureManagedClusterStatus, s conversion.Scope) error { + return autoConvert_v1beta1_AzureManagedClusterStatus_To_v1alpha3_AzureManagedClusterStatus(in, out, s) +} + +func autoConvert_v1alpha3_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(in *AzureManagedControlPlane, out *v1beta1.AzureManagedControlPlane, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha3_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane is an autogenerated conversion function. +func Convert_v1alpha3_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(in *AzureManagedControlPlane, out *v1beta1.AzureManagedControlPlane, s conversion.Scope) error { + return autoConvert_v1alpha3_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedControlPlane_To_v1alpha3_AzureManagedControlPlane(in *v1beta1.AzureManagedControlPlane, out *AzureManagedControlPlane, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha3_AzureManagedControlPlaneSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha3_AzureManagedControlPlaneStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AzureManagedControlPlane_To_v1alpha3_AzureManagedControlPlane is an autogenerated conversion function. +func Convert_v1beta1_AzureManagedControlPlane_To_v1alpha3_AzureManagedControlPlane(in *v1beta1.AzureManagedControlPlane, out *AzureManagedControlPlane, s conversion.Scope) error { + return autoConvert_v1beta1_AzureManagedControlPlane_To_v1alpha3_AzureManagedControlPlane(in, out, s) +} + +func autoConvert_v1alpha3_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(in *AzureManagedControlPlaneList, out *v1beta1.AzureManagedControlPlaneList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta1.AzureManagedControlPlane, len(*in)) + for i := range *in { + if err := Convert_v1alpha3_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1alpha3_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList is an autogenerated conversion function. +func Convert_v1alpha3_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(in *AzureManagedControlPlaneList, out *v1beta1.AzureManagedControlPlaneList, s conversion.Scope) error { + return autoConvert_v1alpha3_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedControlPlaneList_To_v1alpha3_AzureManagedControlPlaneList(in *v1beta1.AzureManagedControlPlaneList, out *AzureManagedControlPlaneList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedControlPlane, len(*in)) + for i := range *in { + if err := Convert_v1beta1_AzureManagedControlPlane_To_v1alpha3_AzureManagedControlPlane(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_AzureManagedControlPlaneList_To_v1alpha3_AzureManagedControlPlaneList is an autogenerated conversion function. +func Convert_v1beta1_AzureManagedControlPlaneList_To_v1alpha3_AzureManagedControlPlaneList(in *v1beta1.AzureManagedControlPlaneList, out *AzureManagedControlPlaneList, s conversion.Scope) error { + return autoConvert_v1beta1_AzureManagedControlPlaneList_To_v1alpha3_AzureManagedControlPlaneList(in, out, s) +} + +func autoConvert_v1alpha3_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(in *AzureManagedControlPlaneSpec, out *v1beta1.AzureManagedControlPlaneSpec, s conversion.Scope) error { + out.Version = in.Version + out.ResourceGroupName = in.ResourceGroupName + out.NodeResourceGroupName = in.NodeResourceGroupName + if err := Convert_v1alpha3_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(&in.VirtualNetwork, &out.VirtualNetwork, s); err != nil { + return err + } + out.SubscriptionID = in.SubscriptionID + out.Location = in.Location + if err := apiv1alpha3.Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + return err + } + out.AdditionalTags = *(*v1beta1.Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.NetworkPlugin = (*string)(unsafe.Pointer(in.NetworkPlugin)) + out.NetworkPolicy = (*string)(unsafe.Pointer(in.NetworkPolicy)) + out.SSHPublicKey = in.SSHPublicKey + out.DNSServiceIP = (*string)(unsafe.Pointer(in.DNSServiceIP)) + out.LoadBalancerSKU = (*string)(unsafe.Pointer(in.LoadBalancerSKU)) + out.AADProfile = (*v1beta1.AADProfile)(unsafe.Pointer(in.AADProfile)) + return nil +} + +// Convert_v1alpha3_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec is an autogenerated conversion function. +func Convert_v1alpha3_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(in *AzureManagedControlPlaneSpec, out *v1beta1.AzureManagedControlPlaneSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha3_AzureManagedControlPlaneSpec(in *v1beta1.AzureManagedControlPlaneSpec, out *AzureManagedControlPlaneSpec, s conversion.Scope) error { + out.Version = in.Version + out.ResourceGroupName = in.ResourceGroupName + out.NodeResourceGroupName = in.NodeResourceGroupName + if err := Convert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha3_ManagedControlPlaneVirtualNetwork(&in.VirtualNetwork, &out.VirtualNetwork, s); err != nil { + return err + } + out.SubscriptionID = in.SubscriptionID + out.Location = in.Location + if err := apiv1alpha3.Convert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + return err + } + out.AdditionalTags = *(*Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.NetworkPlugin = (*string)(unsafe.Pointer(in.NetworkPlugin)) + out.NetworkPolicy = (*string)(unsafe.Pointer(in.NetworkPolicy)) + out.SSHPublicKey = in.SSHPublicKey + out.DNSServiceIP = (*string)(unsafe.Pointer(in.DNSServiceIP)) + out.LoadBalancerSKU = (*string)(unsafe.Pointer(in.LoadBalancerSKU)) + // WARNING: in.IdentityRef requires manual conversion: does not exist in peer-type + out.AADProfile = (*AADProfile)(unsafe.Pointer(in.AADProfile)) + // WARNING: in.AddonProfiles requires manual conversion: does not exist in peer-type + // WARNING: in.SKU requires manual conversion: does not exist in peer-type + // WARNING: in.LoadBalancerProfile requires manual conversion: does not exist in peer-type + // WARNING: in.APIServerAccessProfile requires manual conversion: does not exist in peer-type + // WARNING: in.AutoScalerProfile requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1alpha3_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(in *AzureManagedControlPlaneStatus, out *v1beta1.AzureManagedControlPlaneStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.Initialized = in.Initialized + return nil +} + +// Convert_v1alpha3_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus is an autogenerated conversion function. +func Convert_v1alpha3_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(in *AzureManagedControlPlaneStatus, out *v1beta1.AzureManagedControlPlaneStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha3_AzureManagedControlPlaneStatus(in *v1beta1.AzureManagedControlPlaneStatus, out *AzureManagedControlPlaneStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.Initialized = in.Initialized + // WARNING: in.Conditions requires manual conversion: does not exist in peer-type + // WARNING: in.LongRunningOperationStates requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1alpha3_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(in *AzureManagedMachinePool, out *v1beta1.AzureManagedMachinePool, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha3_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool is an autogenerated conversion function. +func Convert_v1alpha3_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(in *AzureManagedMachinePool, out *v1beta1.AzureManagedMachinePool, s conversion.Scope) error { + return autoConvert_v1alpha3_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedMachinePool_To_v1alpha3_AzureManagedMachinePool(in *v1beta1.AzureManagedMachinePool, out *AzureManagedMachinePool, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha3_AzureManagedMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha3_AzureManagedMachinePoolStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AzureManagedMachinePool_To_v1alpha3_AzureManagedMachinePool is an autogenerated conversion function. +func Convert_v1beta1_AzureManagedMachinePool_To_v1alpha3_AzureManagedMachinePool(in *v1beta1.AzureManagedMachinePool, out *AzureManagedMachinePool, s conversion.Scope) error { + return autoConvert_v1beta1_AzureManagedMachinePool_To_v1alpha3_AzureManagedMachinePool(in, out, s) +} + +func autoConvert_v1alpha3_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(in *AzureManagedMachinePoolList, out *v1beta1.AzureManagedMachinePoolList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta1.AzureManagedMachinePool, len(*in)) + for i := range *in { + if err := Convert_v1alpha3_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1alpha3_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList is an autogenerated conversion function. +func Convert_v1alpha3_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(in *AzureManagedMachinePoolList, out *v1beta1.AzureManagedMachinePoolList, s conversion.Scope) error { + return autoConvert_v1alpha3_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedMachinePoolList_To_v1alpha3_AzureManagedMachinePoolList(in *v1beta1.AzureManagedMachinePoolList, out *AzureManagedMachinePoolList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedMachinePool, len(*in)) + for i := range *in { + if err := Convert_v1beta1_AzureManagedMachinePool_To_v1alpha3_AzureManagedMachinePool(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_AzureManagedMachinePoolList_To_v1alpha3_AzureManagedMachinePoolList is an autogenerated conversion function. +func Convert_v1beta1_AzureManagedMachinePoolList_To_v1alpha3_AzureManagedMachinePoolList(in *v1beta1.AzureManagedMachinePoolList, out *AzureManagedMachinePoolList, s conversion.Scope) error { + return autoConvert_v1beta1_AzureManagedMachinePoolList_To_v1alpha3_AzureManagedMachinePoolList(in, out, s) +} + +func autoConvert_v1alpha3_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(in *AzureManagedMachinePoolSpec, out *v1beta1.AzureManagedMachinePoolSpec, s conversion.Scope) error { + out.Mode = in.Mode + out.SKU = in.SKU + out.OSDiskSizeGB = (*int32)(unsafe.Pointer(in.OSDiskSizeGB)) + out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) + return nil +} + +// Convert_v1alpha3_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec is an autogenerated conversion function. +func Convert_v1alpha3_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(in *AzureManagedMachinePoolSpec, out *v1beta1.AzureManagedMachinePoolSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha3_AzureManagedMachinePoolSpec(in *v1beta1.AzureManagedMachinePoolSpec, out *AzureManagedMachinePoolSpec, s conversion.Scope) error { + // WARNING: in.AdditionalTags requires manual conversion: does not exist in peer-type + // WARNING: in.Name requires manual conversion: does not exist in peer-type + out.Mode = in.Mode + out.SKU = in.SKU + out.OSDiskSizeGB = (*int32)(unsafe.Pointer(in.OSDiskSizeGB)) + // WARNING: in.AvailabilityZones requires manual conversion: does not exist in peer-type + // WARNING: in.NodeLabels requires manual conversion: does not exist in peer-type + // WARNING: in.Taints requires manual conversion: does not exist in peer-type + out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) + // WARNING: in.Scaling requires manual conversion: does not exist in peer-type + // WARNING: in.MaxPods requires manual conversion: does not exist in peer-type + // WARNING: in.OsDiskType requires manual conversion: does not exist in peer-type + // WARNING: in.EnableUltraSSD requires manual conversion: does not exist in peer-type + // WARNING: in.OSType requires manual conversion: does not exist in peer-type + // WARNING: in.EnableNodePublicIP requires manual conversion: does not exist in peer-type + // WARNING: in.NodePublicIPPrefixID requires manual conversion: does not exist in peer-type + // WARNING: in.ScaleSetPriority requires manual conversion: does not exist in peer-type + // WARNING: in.KubeletConfig requires manual conversion: does not exist in peer-type + // WARNING: in.KubeletDiskType requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1alpha3_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(in *AzureManagedMachinePoolStatus, out *v1beta1.AzureManagedMachinePoolStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.Replicas = in.Replicas + out.ErrorReason = (*errors.MachineStatusError)(unsafe.Pointer(in.ErrorReason)) + out.ErrorMessage = (*string)(unsafe.Pointer(in.ErrorMessage)) + return nil +} + +// Convert_v1alpha3_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus is an autogenerated conversion function. +func Convert_v1alpha3_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(in *AzureManagedMachinePoolStatus, out *v1beta1.AzureManagedMachinePoolStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha3_AzureManagedMachinePoolStatus(in *v1beta1.AzureManagedMachinePoolStatus, out *AzureManagedMachinePoolStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.Replicas = in.Replicas + out.ErrorReason = (*errors.MachineStatusError)(unsafe.Pointer(in.ErrorReason)) + out.ErrorMessage = (*string)(unsafe.Pointer(in.ErrorMessage)) + // WARNING: in.Conditions requires manual conversion: does not exist in peer-type + // WARNING: in.LongRunningOperationStates requires manual conversion: does not exist in peer-type + return nil +} + func autoConvert_v1alpha3_AzureMarketplaceImage_To_v1beta1_AzureMarketplaceImage(in *AzureMarketplaceImage, out *v1beta1.AzureMarketplaceImage, s conversion.Scope) error { // WARNING: in.Publisher requires manual conversion: does not exist in peer-type // WARNING: in.Offer requires manual conversion: does not exist in peer-type @@ -1376,6 +1947,48 @@ func autoConvert_v1beta1_LoadBalancerSpec_To_v1alpha3_LoadBalancerSpec(in *v1bet return nil } +func autoConvert_v1alpha3_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(in *ManagedControlPlaneSubnet, out *v1beta1.ManagedControlPlaneSubnet, s conversion.Scope) error { + out.Name = in.Name + out.CIDRBlock = in.CIDRBlock + return nil +} + +// Convert_v1alpha3_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet is an autogenerated conversion function. +func Convert_v1alpha3_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(in *ManagedControlPlaneSubnet, out *v1beta1.ManagedControlPlaneSubnet, s conversion.Scope) error { + return autoConvert_v1alpha3_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(in, out, s) +} + +func autoConvert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha3_ManagedControlPlaneSubnet(in *v1beta1.ManagedControlPlaneSubnet, out *ManagedControlPlaneSubnet, s conversion.Scope) error { + out.Name = in.Name + out.CIDRBlock = in.CIDRBlock + // WARNING: in.ServiceEndpoints requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1alpha3_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(in *ManagedControlPlaneVirtualNetwork, out *v1beta1.ManagedControlPlaneVirtualNetwork, s conversion.Scope) error { + out.Name = in.Name + out.CIDRBlock = in.CIDRBlock + if err := Convert_v1alpha3_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(&in.Subnet, &out.Subnet, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork is an autogenerated conversion function. +func Convert_v1alpha3_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(in *ManagedControlPlaneVirtualNetwork, out *v1beta1.ManagedControlPlaneVirtualNetwork, s conversion.Scope) error { + return autoConvert_v1alpha3_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(in, out, s) +} + +func autoConvert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha3_ManagedControlPlaneVirtualNetwork(in *v1beta1.ManagedControlPlaneVirtualNetwork, out *ManagedControlPlaneVirtualNetwork, s conversion.Scope) error { + out.Name = in.Name + out.CIDRBlock = in.CIDRBlock + if err := Convert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha3_ManagedControlPlaneSubnet(&in.Subnet, &out.Subnet, s); err != nil { + return err + } + // WARNING: in.ResourceGroup requires manual conversion: does not exist in peer-type + return nil +} + func autoConvert_v1alpha3_NetworkSpec_To_v1beta1_NetworkSpec(in *NetworkSpec, out *v1beta1.NetworkSpec, s conversion.Scope) error { if err := Convert_v1alpha3_VnetSpec_To_v1beta1_VnetSpec(&in.Vnet, &out.Vnet, s); err != nil { return err diff --git a/api/v1alpha3/zz_generated.deepcopy.go b/api/v1alpha3/zz_generated.deepcopy.go index 25868ace721..ea5533c632f 100644 --- a/api/v1alpha3/zz_generated.deepcopy.go +++ b/api/v1alpha3/zz_generated.deepcopy.go @@ -28,6 +28,26 @@ import ( "sigs.k8s.io/cluster-api/errors" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AADProfile) DeepCopyInto(out *AADProfile) { + *out = *in + if in.AdminGroupObjectIDs != nil { + in, out := &in.AdminGroupObjectIDs, &out.AdminGroupObjectIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AADProfile. +func (in *AADProfile) DeepCopy() *AADProfile { + if in == nil { + return nil + } + out := new(AADProfile) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AddressRecord) DeepCopyInto(out *AddressRecord) { *out = *in @@ -544,6 +564,328 @@ func (in *AzureMachineTemplateSpec) DeepCopy() *AzureMachineTemplateSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedCluster) DeepCopyInto(out *AzureManagedCluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedCluster. +func (in *AzureManagedCluster) DeepCopy() *AzureManagedCluster { + if in == nil { + return nil + } + out := new(AzureManagedCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedCluster) 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 *AzureManagedClusterList) DeepCopyInto(out *AzureManagedClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterList. +func (in *AzureManagedClusterList) DeepCopy() *AzureManagedClusterList { + if in == nil { + return nil + } + out := new(AzureManagedClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedClusterList) 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 *AzureManagedClusterSpec) DeepCopyInto(out *AzureManagedClusterSpec) { + *out = *in + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterSpec. +func (in *AzureManagedClusterSpec) DeepCopy() *AzureManagedClusterSpec { + if in == nil { + return nil + } + out := new(AzureManagedClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedClusterStatus) DeepCopyInto(out *AzureManagedClusterStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterStatus. +func (in *AzureManagedClusterStatus) DeepCopy() *AzureManagedClusterStatus { + if in == nil { + return nil + } + out := new(AzureManagedClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedControlPlane) DeepCopyInto(out *AzureManagedControlPlane) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlane. +func (in *AzureManagedControlPlane) DeepCopy() *AzureManagedControlPlane { + if in == nil { + return nil + } + out := new(AzureManagedControlPlane) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedControlPlane) 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 *AzureManagedControlPlaneList) DeepCopyInto(out *AzureManagedControlPlaneList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedControlPlane, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneList. +func (in *AzureManagedControlPlaneList) DeepCopy() *AzureManagedControlPlaneList { + if in == nil { + return nil + } + out := new(AzureManagedControlPlaneList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedControlPlaneList) 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 *AzureManagedControlPlaneSpec) DeepCopyInto(out *AzureManagedControlPlaneSpec) { + *out = *in + out.VirtualNetwork = in.VirtualNetwork + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint + if in.AdditionalTags != nil { + in, out := &in.AdditionalTags, &out.AdditionalTags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.NetworkPlugin != nil { + in, out := &in.NetworkPlugin, &out.NetworkPlugin + *out = new(string) + **out = **in + } + if in.NetworkPolicy != nil { + in, out := &in.NetworkPolicy, &out.NetworkPolicy + *out = new(string) + **out = **in + } + if in.DNSServiceIP != nil { + in, out := &in.DNSServiceIP, &out.DNSServiceIP + *out = new(string) + **out = **in + } + if in.LoadBalancerSKU != nil { + in, out := &in.LoadBalancerSKU, &out.LoadBalancerSKU + *out = new(string) + **out = **in + } + if in.AADProfile != nil { + in, out := &in.AADProfile, &out.AADProfile + *out = new(AADProfile) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneSpec. +func (in *AzureManagedControlPlaneSpec) DeepCopy() *AzureManagedControlPlaneSpec { + if in == nil { + return nil + } + out := new(AzureManagedControlPlaneSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedControlPlaneStatus) DeepCopyInto(out *AzureManagedControlPlaneStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneStatus. +func (in *AzureManagedControlPlaneStatus) DeepCopy() *AzureManagedControlPlaneStatus { + if in == nil { + return nil + } + out := new(AzureManagedControlPlaneStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedMachinePool) DeepCopyInto(out *AzureManagedMachinePool) { + *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 AzureManagedMachinePool. +func (in *AzureManagedMachinePool) DeepCopy() *AzureManagedMachinePool { + if in == nil { + return nil + } + out := new(AzureManagedMachinePool) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedMachinePool) 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 *AzureManagedMachinePoolList) DeepCopyInto(out *AzureManagedMachinePoolList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedMachinePool, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolList. +func (in *AzureManagedMachinePoolList) DeepCopy() *AzureManagedMachinePoolList { + if in == nil { + return nil + } + out := new(AzureManagedMachinePoolList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedMachinePoolList) 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 *AzureManagedMachinePoolSpec) DeepCopyInto(out *AzureManagedMachinePoolSpec) { + *out = *in + if in.OSDiskSizeGB != nil { + in, out := &in.OSDiskSizeGB, &out.OSDiskSizeGB + *out = new(int32) + **out = **in + } + if in.ProviderIDList != nil { + in, out := &in.ProviderIDList, &out.ProviderIDList + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolSpec. +func (in *AzureManagedMachinePoolSpec) DeepCopy() *AzureManagedMachinePoolSpec { + if in == nil { + return nil + } + out := new(AzureManagedMachinePoolSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedMachinePoolStatus) DeepCopyInto(out *AzureManagedMachinePoolStatus) { + *out = *in + if in.ErrorReason != nil { + in, out := &in.ErrorReason, &out.ErrorReason + *out = new(errors.MachineStatusError) + **out = **in + } + if in.ErrorMessage != nil { + in, out := &in.ErrorMessage, &out.ErrorMessage + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolStatus. +func (in *AzureManagedMachinePoolStatus) DeepCopy() *AzureManagedMachinePoolStatus { + if in == nil { + return nil + } + out := new(AzureManagedMachinePoolStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AzureMarketplaceImage) DeepCopyInto(out *AzureMarketplaceImage) { *out = *in @@ -804,6 +1146,37 @@ func (in *LoadBalancerSpec) DeepCopy() *LoadBalancerSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedControlPlaneSubnet) DeepCopyInto(out *ManagedControlPlaneSubnet) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedControlPlaneSubnet. +func (in *ManagedControlPlaneSubnet) DeepCopy() *ManagedControlPlaneSubnet { + if in == nil { + return nil + } + out := new(ManagedControlPlaneSubnet) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedControlPlaneVirtualNetwork) DeepCopyInto(out *ManagedControlPlaneVirtualNetwork) { + *out = *in + out.Subnet = in.Subnet +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedControlPlaneVirtualNetwork. +func (in *ManagedControlPlaneVirtualNetwork) DeepCopy() *ManagedControlPlaneVirtualNetwork { + if in == nil { + return nil + } + out := new(ManagedControlPlaneVirtualNetwork) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedDisk) DeepCopyInto(out *ManagedDisk) { *out = *in diff --git a/exp/api/v1alpha4/azuremanagedcluster_conversion.go b/api/v1alpha4/azuremanagedcluster_conversion.go similarity index 85% rename from exp/api/v1alpha4/azuremanagedcluster_conversion.go rename to api/v1alpha4/azuremanagedcluster_conversion.go index 6c66eaea4b0..dac118b2112 100644 --- a/exp/api/v1alpha4/azuremanagedcluster_conversion.go +++ b/api/v1alpha4/azuremanagedcluster_conversion.go @@ -17,30 +17,30 @@ limitations under the License. package v1alpha4 import ( - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/conversion" ) // ConvertTo converts this AzureManagedCluster to the Hub version (v1beta1). func (src *AzureManagedCluster) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1exp.AzureManagedCluster) + dst := dstRaw.(*infrav1.AzureManagedCluster) return Convert_v1alpha4_AzureManagedCluster_To_v1beta1_AzureManagedCluster(src, dst, nil) } // ConvertFrom converts from the Hub version (v1beta1) to this version. func (dst *AzureManagedCluster) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1exp.AzureManagedCluster) + src := srcRaw.(*infrav1.AzureManagedCluster) return Convert_v1beta1_AzureManagedCluster_To_v1alpha4_AzureManagedCluster(src, dst, nil) } // ConvertTo converts this AzureManagedClusterList to the Hub version (v1beta1). func (src *AzureManagedClusterList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1exp.AzureManagedClusterList) + dst := dstRaw.(*infrav1.AzureManagedClusterList) return Convert_v1alpha4_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(src, dst, nil) } // ConvertFrom converts from the Hub version (v1beta1) to this version. func (dst *AzureManagedClusterList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1exp.AzureManagedClusterList) + src := srcRaw.(*infrav1.AzureManagedClusterList) return Convert_v1beta1_AzureManagedClusterList_To_v1alpha4_AzureManagedClusterList(src, dst, nil) } diff --git a/exp/api/v1alpha4/azuremanagedcluster_types.go b/api/v1alpha4/azuremanagedcluster_types.go similarity index 100% rename from exp/api/v1alpha4/azuremanagedcluster_types.go rename to api/v1alpha4/azuremanagedcluster_types.go diff --git a/exp/api/v1alpha4/azuremanagedcontrolplane_conversion.go b/api/v1alpha4/azuremanagedcontrolplane_conversion.go similarity index 75% rename from exp/api/v1alpha4/azuremanagedcontrolplane_conversion.go rename to api/v1alpha4/azuremanagedcontrolplane_conversion.go index 3a5052186db..38ae5387fcf 100644 --- a/exp/api/v1alpha4/azuremanagedcontrolplane_conversion.go +++ b/api/v1alpha4/azuremanagedcontrolplane_conversion.go @@ -18,20 +18,20 @@ package v1alpha4 import ( apiconversion "k8s.io/apimachinery/pkg/conversion" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" "sigs.k8s.io/controller-runtime/pkg/conversion" ) // ConvertTo converts this AzureManagedControlPlane to the Hub version (v1beta1). func (src *AzureManagedControlPlane) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1exp.AzureManagedControlPlane) + dst := dstRaw.(*infrav1.AzureManagedControlPlane) if err := Convert_v1alpha4_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(src, dst, nil); err != nil { return err } // Manually restore data. - restored := &infrav1exp.AzureManagedControlPlane{} + restored := &infrav1.AzureManagedControlPlane{} if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { return err } @@ -47,7 +47,7 @@ func (src *AzureManagedControlPlane) ConvertTo(dstRaw conversion.Hub) error { // ConvertFrom converts from the Hub version (v1beta1) to this version. func (dst *AzureManagedControlPlane) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1exp.AzureManagedControlPlane) + src := srcRaw.(*infrav1.AzureManagedControlPlane) if err := Convert_v1beta1_AzureManagedControlPlane_To_v1alpha4_AzureManagedControlPlane(src, dst, nil); err != nil { return err } @@ -57,32 +57,37 @@ func (dst *AzureManagedControlPlane) ConvertFrom(srcRaw conversion.Hub) error { } // Convert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha4_AzureManagedControlPlaneSpec is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha4_AzureManagedControlPlaneSpec(in *infrav1exp.AzureManagedControlPlaneSpec, out *AzureManagedControlPlaneSpec, s apiconversion.Scope) error { +func Convert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha4_AzureManagedControlPlaneSpec(in *infrav1.AzureManagedControlPlaneSpec, out *AzureManagedControlPlaneSpec, s apiconversion.Scope) error { return autoConvert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha4_AzureManagedControlPlaneSpec(in, out, s) } // Convert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha4_AzureManagedControlPlaneStatus is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha4_AzureManagedControlPlaneStatus(in *infrav1exp.AzureManagedControlPlaneStatus, out *AzureManagedControlPlaneStatus, s apiconversion.Scope) error { +func Convert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha4_AzureManagedControlPlaneStatus(in *infrav1.AzureManagedControlPlaneStatus, out *AzureManagedControlPlaneStatus, s apiconversion.Scope) error { return autoConvert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha4_AzureManagedControlPlaneStatus(in, out, s) } // ConvertTo converts this AzureManagedControlPlaneList to the Hub version (v1beta1). func (src *AzureManagedControlPlaneList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1exp.AzureManagedControlPlaneList) + dst := dstRaw.(*infrav1.AzureManagedControlPlaneList) return Convert_v1alpha4_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(src, dst, nil) } // ConvertFrom converts from the Hub version (v1beta1) to this version. func (dst *AzureManagedControlPlaneList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1exp.AzureManagedControlPlaneList) + src := srcRaw.(*infrav1.AzureManagedControlPlaneList) return Convert_v1beta1_AzureManagedControlPlaneList_To_v1alpha4_AzureManagedControlPlaneList(src, dst, nil) } // Convert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha4_ManagedControlPlaneVirtualNetwork converts v1beta1 ManagedControlPlaneVirtualNetwork to v1alpha4 ManagedControlPlaneVirtualNetwork. -func Convert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha4_ManagedControlPlaneVirtualNetwork(in *infrav1exp.ManagedControlPlaneVirtualNetwork, out *ManagedControlPlaneVirtualNetwork, s apiconversion.Scope) error { +func Convert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha4_ManagedControlPlaneVirtualNetwork(in *infrav1.ManagedControlPlaneVirtualNetwork, out *ManagedControlPlaneVirtualNetwork, s apiconversion.Scope) error { out.Name = in.Name out.Subnet.Name = in.Subnet.Name out.Subnet.CIDRBlock = in.Subnet.CIDRBlock out.CIDRBlock = in.CIDRBlock return nil } + +// Convert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha4_ManagedControlPlaneSubnet is a conversion function. +func Convert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha4_ManagedControlPlaneSubnet(in *infrav1.ManagedControlPlaneSubnet, out *ManagedControlPlaneSubnet, s apiconversion.Scope) error { + return autoConvert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha4_ManagedControlPlaneSubnet(in, out, s) +} diff --git a/exp/api/v1alpha4/azuremanagedcontrolplane_types.go b/api/v1alpha4/azuremanagedcontrolplane_types.go similarity index 94% rename from exp/api/v1alpha4/azuremanagedcontrolplane_types.go rename to api/v1alpha4/azuremanagedcontrolplane_types.go index cb2bdf72439..f792f5c81c4 100644 --- a/exp/api/v1alpha4/azuremanagedcontrolplane_types.go +++ b/api/v1alpha4/azuremanagedcontrolplane_types.go @@ -19,7 +19,6 @@ package v1alpha4 import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1alpha4 "sigs.k8s.io/cluster-api-provider-azure/api/v1alpha4" clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" ) @@ -62,7 +61,7 @@ type AzureManagedControlPlaneSpec struct { // AdditionalTags is an optional set of tags to add to Azure resources managed by the Azure provider, in addition to the // ones added by default. // +optional - AdditionalTags infrav1alpha4.Tags `json:"additionalTags,omitempty"` + AdditionalTags Tags `json:"additionalTags,omitempty"` // NetworkPlugin used for building Kubernetes network. // +kubebuilder:validation:Enum=azure;kubenet @@ -95,9 +94,9 @@ type AzureManagedControlPlaneSpec struct { // +optional AADProfile *AADProfile `json:"aadProfile,omitempty"` - // SKU is the SKU of the AKS to be provisioned. + // SKU is the AksSKU of the AKS to be provisioned. // +optional - SKU *SKU `json:"sku,omitempty"` + SKU *AksSKU `json:"sku,omitempty"` // LoadBalancerProfile is the profile of the cluster load balancer. // +optional @@ -119,8 +118,8 @@ type AADProfile struct { AdminGroupObjectIDs []string `json:"adminGroupObjectIDs"` } -// SKU - AKS SKU. -type SKU struct { +// AksSKU - AKS SKU. +type AksSKU struct { // Tier - Tier of a managed cluster SKU. // +kubebuilder:validation:Enum=Free;Paid Tier string `json:"tier"` @@ -199,7 +198,7 @@ type AzureManagedControlPlaneStatus struct { // LongRunningOperationStates saves the states for Azure long-running operations so they can be continued on the // next reconciliation loop. // +optional - LongRunningOperationStates infrav1alpha4.Futures `json:"longRunningOperationStates,omitempty"` + LongRunningOperationStates Futures `json:"longRunningOperationStates,omitempty"` } // +kubebuilder:object:root=true @@ -225,12 +224,12 @@ type AzureManagedControlPlaneList struct { } // GetFutures returns the list of long running operation states for an AzureManagedControlPlane API object. -func (m *AzureManagedControlPlane) GetFutures() infrav1alpha4.Futures { +func (m *AzureManagedControlPlane) GetFutures() Futures { return m.Status.LongRunningOperationStates } // SetFutures will set the given long running operation states on an AzureManagedControlPlane object. -func (m *AzureManagedControlPlane) SetFutures(futures infrav1alpha4.Futures) { +func (m *AzureManagedControlPlane) SetFutures(futures Futures) { m.Status.LongRunningOperationStates = futures } diff --git a/exp/api/v1alpha4/azuremanagedmachinepool_conversion.go b/api/v1alpha4/azuremanagedmachinepool_conversion.go similarity index 85% rename from exp/api/v1alpha4/azuremanagedmachinepool_conversion.go rename to api/v1alpha4/azuremanagedmachinepool_conversion.go index 90ba3ce0f31..0765a8fbe9d 100644 --- a/exp/api/v1alpha4/azuremanagedmachinepool_conversion.go +++ b/api/v1alpha4/azuremanagedmachinepool_conversion.go @@ -18,20 +18,20 @@ package v1alpha4 import ( apiconversion "k8s.io/apimachinery/pkg/conversion" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" "sigs.k8s.io/controller-runtime/pkg/conversion" ) // ConvertTo converts this AzureManagedMachinePool to the Hub version (v1beta1). func (src *AzureManagedMachinePool) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1exp.AzureManagedMachinePool) + dst := dstRaw.(*infrav1.AzureManagedMachinePool) if err := Convert_v1alpha4_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(src, dst, nil); err != nil { return err } // Manually restore data. - restored := &infrav1exp.AzureManagedMachinePool{} + restored := &infrav1.AzureManagedMachinePool{} if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { return err } @@ -62,7 +62,7 @@ func (src *AzureManagedMachinePool) ConvertTo(dstRaw conversion.Hub) error { // ConvertFrom converts from the Hub version (v1beta1) to this version. func (dst *AzureManagedMachinePool) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1exp.AzureManagedMachinePool) + src := srcRaw.(*infrav1.AzureManagedMachinePool) if err := Convert_v1beta1_AzureManagedMachinePool_To_v1alpha4_AzureManagedMachinePool(src, dst, nil); err != nil { return err } @@ -72,23 +72,23 @@ func (dst *AzureManagedMachinePool) ConvertFrom(srcRaw conversion.Hub) error { } // Convert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha4_AzureManagedMachinePoolSpec is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha4_AzureManagedMachinePoolSpec(in *infrav1exp.AzureManagedMachinePoolSpec, out *AzureManagedMachinePoolSpec, s apiconversion.Scope) error { +func Convert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha4_AzureManagedMachinePoolSpec(in *infrav1.AzureManagedMachinePoolSpec, out *AzureManagedMachinePoolSpec, s apiconversion.Scope) error { return autoConvert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha4_AzureManagedMachinePoolSpec(in, out, s) } // Convert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha4_AzureManagedMachinePoolStatus is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha4_AzureManagedMachinePoolStatus(in *infrav1exp.AzureManagedMachinePoolStatus, out *AzureManagedMachinePoolStatus, s apiconversion.Scope) error { +func Convert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha4_AzureManagedMachinePoolStatus(in *infrav1.AzureManagedMachinePoolStatus, out *AzureManagedMachinePoolStatus, s apiconversion.Scope) error { return autoConvert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha4_AzureManagedMachinePoolStatus(in, out, s) } // ConvertTo converts this AzureManagedMachinePoolList to the Hub version (v1beta1). func (src *AzureManagedMachinePoolList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1exp.AzureManagedMachinePoolList) + dst := dstRaw.(*infrav1.AzureManagedMachinePoolList) return Convert_v1alpha4_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(src, dst, nil) } // ConvertFrom converts from the Hub version (v1beta1) to this version. func (dst *AzureManagedMachinePoolList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1exp.AzureManagedMachinePoolList) + src := srcRaw.(*infrav1.AzureManagedMachinePoolList) return Convert_v1beta1_AzureManagedMachinePoolList_To_v1alpha4_AzureManagedMachinePoolList(src, dst, nil) } diff --git a/exp/api/v1alpha4/azuremanagedmachinepool_types.go b/api/v1alpha4/azuremanagedmachinepool_types.go similarity index 100% rename from exp/api/v1alpha4/azuremanagedmachinepool_types.go rename to api/v1alpha4/azuremanagedmachinepool_types.go diff --git a/api/v1alpha4/conversion_test.go b/api/v1alpha4/conversion_test.go index 5cdec9a4eaf..66fcf12811c 100644 --- a/api/v1alpha4/conversion_test.go +++ b/api/v1alpha4/conversion_test.go @@ -54,4 +54,22 @@ func TestFuzzyConversion(t *testing.T) { Hub: &infrav1.AzureClusterIdentity{}, Spoke: &AzureClusterIdentity{}, })) + + t.Run("for AzureManagedCluster", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &infrav1.AzureManagedCluster{}, + Spoke: &AzureManagedCluster{}, + })) + + t.Run("for AzureManagedControlPlane", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &infrav1.AzureManagedControlPlane{}, + Spoke: &AzureManagedControlPlane{}, + })) + + t.Run("for AzureManagedMachinePool", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &infrav1.AzureManagedMachinePool{}, + Spoke: &AzureManagedMachinePool{}, + })) } diff --git a/api/v1alpha4/zz_generated.conversion.go b/api/v1alpha4/zz_generated.conversion.go index 0a5d960f000..63334eb5a6a 100644 --- a/api/v1alpha4/zz_generated.conversion.go +++ b/api/v1alpha4/zz_generated.conversion.go @@ -42,6 +42,26 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*AADProfile)(nil), (*v1beta1.AADProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AADProfile_To_v1beta1_AADProfile(a.(*AADProfile), b.(*v1beta1.AADProfile), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AADProfile)(nil), (*AADProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AADProfile_To_v1alpha4_AADProfile(a.(*v1beta1.AADProfile), b.(*AADProfile), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*APIServerAccessProfile)(nil), (*v1beta1.APIServerAccessProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_APIServerAccessProfile_To_v1beta1_APIServerAccessProfile(a.(*APIServerAccessProfile), b.(*v1beta1.APIServerAccessProfile), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.APIServerAccessProfile)(nil), (*APIServerAccessProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_APIServerAccessProfile_To_v1alpha4_APIServerAccessProfile(a.(*v1beta1.APIServerAccessProfile), b.(*APIServerAccessProfile), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*AddressRecord)(nil), (*v1beta1.AddressRecord)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha4_AddressRecord_To_v1beta1_AddressRecord(a.(*AddressRecord), b.(*v1beta1.AddressRecord), scope) }); err != nil { @@ -52,6 +72,16 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*AksSKU)(nil), (*v1beta1.AksSKU)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AksSKU_To_v1beta1_AksSKU(a.(*AksSKU), b.(*v1beta1.AksSKU), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AksSKU)(nil), (*AksSKU)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AksSKU_To_v1alpha4_AksSKU(a.(*v1beta1.AksSKU), b.(*AksSKU), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*AllowedNamespaces)(nil), (*v1beta1.AllowedNamespaces)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha4_AllowedNamespaces_To_v1beta1_AllowedNamespaces(a.(*AllowedNamespaces), b.(*v1beta1.AllowedNamespaces), scope) }); err != nil { @@ -212,6 +242,106 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*AzureManagedCluster)(nil), (*v1beta1.AzureManagedCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AzureManagedCluster_To_v1beta1_AzureManagedCluster(a.(*AzureManagedCluster), b.(*v1beta1.AzureManagedCluster), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedCluster)(nil), (*AzureManagedCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedCluster_To_v1alpha4_AzureManagedCluster(a.(*v1beta1.AzureManagedCluster), b.(*AzureManagedCluster), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedClusterList)(nil), (*v1beta1.AzureManagedClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(a.(*AzureManagedClusterList), b.(*v1beta1.AzureManagedClusterList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedClusterList)(nil), (*AzureManagedClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedClusterList_To_v1alpha4_AzureManagedClusterList(a.(*v1beta1.AzureManagedClusterList), b.(*AzureManagedClusterList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedClusterSpec)(nil), (*v1beta1.AzureManagedClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(a.(*AzureManagedClusterSpec), b.(*v1beta1.AzureManagedClusterSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedClusterSpec)(nil), (*AzureManagedClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedClusterSpec_To_v1alpha4_AzureManagedClusterSpec(a.(*v1beta1.AzureManagedClusterSpec), b.(*AzureManagedClusterSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedClusterStatus)(nil), (*v1beta1.AzureManagedClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(a.(*AzureManagedClusterStatus), b.(*v1beta1.AzureManagedClusterStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedClusterStatus)(nil), (*AzureManagedClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedClusterStatus_To_v1alpha4_AzureManagedClusterStatus(a.(*v1beta1.AzureManagedClusterStatus), b.(*AzureManagedClusterStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedControlPlane)(nil), (*v1beta1.AzureManagedControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(a.(*AzureManagedControlPlane), b.(*v1beta1.AzureManagedControlPlane), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedControlPlane)(nil), (*AzureManagedControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedControlPlane_To_v1alpha4_AzureManagedControlPlane(a.(*v1beta1.AzureManagedControlPlane), b.(*AzureManagedControlPlane), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedControlPlaneList)(nil), (*v1beta1.AzureManagedControlPlaneList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(a.(*AzureManagedControlPlaneList), b.(*v1beta1.AzureManagedControlPlaneList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedControlPlaneList)(nil), (*AzureManagedControlPlaneList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedControlPlaneList_To_v1alpha4_AzureManagedControlPlaneList(a.(*v1beta1.AzureManagedControlPlaneList), b.(*AzureManagedControlPlaneList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedControlPlaneSpec)(nil), (*v1beta1.AzureManagedControlPlaneSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(a.(*AzureManagedControlPlaneSpec), b.(*v1beta1.AzureManagedControlPlaneSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedControlPlaneStatus)(nil), (*v1beta1.AzureManagedControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(a.(*AzureManagedControlPlaneStatus), b.(*v1beta1.AzureManagedControlPlaneStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedMachinePool)(nil), (*v1beta1.AzureManagedMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(a.(*AzureManagedMachinePool), b.(*v1beta1.AzureManagedMachinePool), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedMachinePool)(nil), (*AzureManagedMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedMachinePool_To_v1alpha4_AzureManagedMachinePool(a.(*v1beta1.AzureManagedMachinePool), b.(*AzureManagedMachinePool), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedMachinePoolList)(nil), (*v1beta1.AzureManagedMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(a.(*AzureManagedMachinePoolList), b.(*v1beta1.AzureManagedMachinePoolList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedMachinePoolList)(nil), (*AzureManagedMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedMachinePoolList_To_v1alpha4_AzureManagedMachinePoolList(a.(*v1beta1.AzureManagedMachinePoolList), b.(*AzureManagedMachinePoolList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedMachinePoolSpec)(nil), (*v1beta1.AzureManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(a.(*AzureManagedMachinePoolSpec), b.(*v1beta1.AzureManagedMachinePoolSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AzureManagedMachinePoolStatus)(nil), (*v1beta1.AzureManagedMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(a.(*AzureManagedMachinePoolStatus), b.(*v1beta1.AzureManagedMachinePoolStatus), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*AzureSharedGalleryImage)(nil), (*v1beta1.AzureSharedGalleryImage)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha4_AzureSharedGalleryImage_To_v1beta1_AzureSharedGalleryImage(a.(*AzureSharedGalleryImage), b.(*v1beta1.AzureSharedGalleryImage), scope) }); err != nil { @@ -307,6 +437,26 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*LoadBalancerProfile)(nil), (*v1beta1.LoadBalancerProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_LoadBalancerProfile_To_v1beta1_LoadBalancerProfile(a.(*LoadBalancerProfile), b.(*v1beta1.LoadBalancerProfile), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.LoadBalancerProfile)(nil), (*LoadBalancerProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_LoadBalancerProfile_To_v1alpha4_LoadBalancerProfile(a.(*v1beta1.LoadBalancerProfile), b.(*LoadBalancerProfile), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ManagedControlPlaneSubnet)(nil), (*v1beta1.ManagedControlPlaneSubnet)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(a.(*ManagedControlPlaneSubnet), b.(*v1beta1.ManagedControlPlaneSubnet), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ManagedControlPlaneVirtualNetwork)(nil), (*v1beta1.ManagedControlPlaneVirtualNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(a.(*ManagedControlPlaneVirtualNetwork), b.(*v1beta1.ManagedControlPlaneVirtualNetwork), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*ManagedDiskParameters)(nil), (*v1beta1.ManagedDiskParameters)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha4_ManagedDiskParameters_To_v1beta1_ManagedDiskParameters(a.(*ManagedDiskParameters), b.(*v1beta1.ManagedDiskParameters), scope) }); err != nil { @@ -457,6 +607,26 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddConversionFunc((*v1beta1.AzureManagedControlPlaneSpec)(nil), (*AzureManagedControlPlaneSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha4_AzureManagedControlPlaneSpec(a.(*v1beta1.AzureManagedControlPlaneSpec), b.(*AzureManagedControlPlaneSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta1.AzureManagedControlPlaneStatus)(nil), (*AzureManagedControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha4_AzureManagedControlPlaneStatus(a.(*v1beta1.AzureManagedControlPlaneStatus), b.(*AzureManagedControlPlaneStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta1.AzureManagedMachinePoolSpec)(nil), (*AzureManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha4_AzureManagedMachinePoolSpec(a.(*v1beta1.AzureManagedMachinePoolSpec), b.(*AzureManagedMachinePoolSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta1.AzureManagedMachinePoolStatus)(nil), (*AzureManagedMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha4_AzureManagedMachinePoolStatus(a.(*v1beta1.AzureManagedMachinePoolStatus), b.(*AzureManagedMachinePoolStatus), scope) + }); err != nil { + return err + } if err := s.AddConversionFunc((*v1beta1.AzureMarketplaceImage)(nil), (*AzureMarketplaceImage)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_AzureMarketplaceImage_To_v1alpha4_AzureMarketplaceImage(a.(*v1beta1.AzureMarketplaceImage), b.(*AzureMarketplaceImage), scope) }); err != nil { @@ -477,6 +647,16 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddConversionFunc((*v1beta1.ManagedControlPlaneSubnet)(nil), (*ManagedControlPlaneSubnet)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha4_ManagedControlPlaneSubnet(a.(*v1beta1.ManagedControlPlaneSubnet), b.(*ManagedControlPlaneSubnet), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta1.ManagedControlPlaneVirtualNetwork)(nil), (*ManagedControlPlaneVirtualNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha4_ManagedControlPlaneVirtualNetwork(a.(*v1beta1.ManagedControlPlaneVirtualNetwork), b.(*ManagedControlPlaneVirtualNetwork), scope) + }); err != nil { + return err + } if err := s.AddConversionFunc((*v1beta1.NatGateway)(nil), (*NatGateway)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_NatGateway_To_v1alpha4_NatGateway(a.(*v1beta1.NatGateway), b.(*NatGateway), scope) }); err != nil { @@ -515,6 +695,54 @@ func RegisterConversions(s *runtime.Scheme) error { return nil } +func autoConvert_v1alpha4_AADProfile_To_v1beta1_AADProfile(in *AADProfile, out *v1beta1.AADProfile, s conversion.Scope) error { + out.Managed = in.Managed + out.AdminGroupObjectIDs = *(*[]string)(unsafe.Pointer(&in.AdminGroupObjectIDs)) + return nil +} + +// Convert_v1alpha4_AADProfile_To_v1beta1_AADProfile is an autogenerated conversion function. +func Convert_v1alpha4_AADProfile_To_v1beta1_AADProfile(in *AADProfile, out *v1beta1.AADProfile, s conversion.Scope) error { + return autoConvert_v1alpha4_AADProfile_To_v1beta1_AADProfile(in, out, s) +} + +func autoConvert_v1beta1_AADProfile_To_v1alpha4_AADProfile(in *v1beta1.AADProfile, out *AADProfile, s conversion.Scope) error { + out.Managed = in.Managed + out.AdminGroupObjectIDs = *(*[]string)(unsafe.Pointer(&in.AdminGroupObjectIDs)) + return nil +} + +// Convert_v1beta1_AADProfile_To_v1alpha4_AADProfile is an autogenerated conversion function. +func Convert_v1beta1_AADProfile_To_v1alpha4_AADProfile(in *v1beta1.AADProfile, out *AADProfile, s conversion.Scope) error { + return autoConvert_v1beta1_AADProfile_To_v1alpha4_AADProfile(in, out, s) +} + +func autoConvert_v1alpha4_APIServerAccessProfile_To_v1beta1_APIServerAccessProfile(in *APIServerAccessProfile, out *v1beta1.APIServerAccessProfile, s conversion.Scope) error { + out.AuthorizedIPRanges = *(*[]string)(unsafe.Pointer(&in.AuthorizedIPRanges)) + out.EnablePrivateCluster = (*bool)(unsafe.Pointer(in.EnablePrivateCluster)) + out.PrivateDNSZone = (*string)(unsafe.Pointer(in.PrivateDNSZone)) + out.EnablePrivateClusterPublicFQDN = (*bool)(unsafe.Pointer(in.EnablePrivateClusterPublicFQDN)) + return nil +} + +// Convert_v1alpha4_APIServerAccessProfile_To_v1beta1_APIServerAccessProfile is an autogenerated conversion function. +func Convert_v1alpha4_APIServerAccessProfile_To_v1beta1_APIServerAccessProfile(in *APIServerAccessProfile, out *v1beta1.APIServerAccessProfile, s conversion.Scope) error { + return autoConvert_v1alpha4_APIServerAccessProfile_To_v1beta1_APIServerAccessProfile(in, out, s) +} + +func autoConvert_v1beta1_APIServerAccessProfile_To_v1alpha4_APIServerAccessProfile(in *v1beta1.APIServerAccessProfile, out *APIServerAccessProfile, s conversion.Scope) error { + out.AuthorizedIPRanges = *(*[]string)(unsafe.Pointer(&in.AuthorizedIPRanges)) + out.EnablePrivateCluster = (*bool)(unsafe.Pointer(in.EnablePrivateCluster)) + out.PrivateDNSZone = (*string)(unsafe.Pointer(in.PrivateDNSZone)) + out.EnablePrivateClusterPublicFQDN = (*bool)(unsafe.Pointer(in.EnablePrivateClusterPublicFQDN)) + return nil +} + +// Convert_v1beta1_APIServerAccessProfile_To_v1alpha4_APIServerAccessProfile is an autogenerated conversion function. +func Convert_v1beta1_APIServerAccessProfile_To_v1alpha4_APIServerAccessProfile(in *v1beta1.APIServerAccessProfile, out *APIServerAccessProfile, s conversion.Scope) error { + return autoConvert_v1beta1_APIServerAccessProfile_To_v1alpha4_APIServerAccessProfile(in, out, s) +} + func autoConvert_v1alpha4_AddressRecord_To_v1beta1_AddressRecord(in *AddressRecord, out *v1beta1.AddressRecord, s conversion.Scope) error { out.Hostname = in.Hostname out.IP = in.IP @@ -537,6 +765,26 @@ func Convert_v1beta1_AddressRecord_To_v1alpha4_AddressRecord(in *v1beta1.Address return autoConvert_v1beta1_AddressRecord_To_v1alpha4_AddressRecord(in, out, s) } +func autoConvert_v1alpha4_AksSKU_To_v1beta1_AksSKU(in *AksSKU, out *v1beta1.AksSKU, s conversion.Scope) error { + out.Tier = v1beta1.AzureManagedControlPlaneSkuTier(in.Tier) + return nil +} + +// Convert_v1alpha4_AksSKU_To_v1beta1_AksSKU is an autogenerated conversion function. +func Convert_v1alpha4_AksSKU_To_v1beta1_AksSKU(in *AksSKU, out *v1beta1.AksSKU, s conversion.Scope) error { + return autoConvert_v1alpha4_AksSKU_To_v1beta1_AksSKU(in, out, s) +} + +func autoConvert_v1beta1_AksSKU_To_v1alpha4_AksSKU(in *v1beta1.AksSKU, out *AksSKU, s conversion.Scope) error { + out.Tier = string(in.Tier) + return nil +} + +// Convert_v1beta1_AksSKU_To_v1alpha4_AksSKU is an autogenerated conversion function. +func Convert_v1beta1_AksSKU_To_v1alpha4_AksSKU(in *v1beta1.AksSKU, out *AksSKU, s conversion.Scope) error { + return autoConvert_v1beta1_AksSKU_To_v1alpha4_AksSKU(in, out, s) +} + func autoConvert_v1alpha4_AllowedNamespaces_To_v1beta1_AllowedNamespaces(in *AllowedNamespaces, out *v1beta1.AllowedNamespaces, s conversion.Scope) error { out.NamespaceList = *(*[]string)(unsafe.Pointer(&in.NamespaceList)) out.Selector = (*v1.LabelSelector)(unsafe.Pointer(in.Selector)) @@ -1240,6 +1488,411 @@ func Convert_v1beta1_AzureMachineTemplateSpec_To_v1alpha4_AzureMachineTemplateSp return autoConvert_v1beta1_AzureMachineTemplateSpec_To_v1alpha4_AzureMachineTemplateSpec(in, out, s) } +func autoConvert_v1alpha4_AzureManagedCluster_To_v1beta1_AzureManagedCluster(in *AzureManagedCluster, out *v1beta1.AzureManagedCluster, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AzureManagedCluster_To_v1beta1_AzureManagedCluster is an autogenerated conversion function. +func Convert_v1alpha4_AzureManagedCluster_To_v1beta1_AzureManagedCluster(in *AzureManagedCluster, out *v1beta1.AzureManagedCluster, s conversion.Scope) error { + return autoConvert_v1alpha4_AzureManagedCluster_To_v1beta1_AzureManagedCluster(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedCluster_To_v1alpha4_AzureManagedCluster(in *v1beta1.AzureManagedCluster, out *AzureManagedCluster, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_AzureManagedClusterSpec_To_v1alpha4_AzureManagedClusterSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_AzureManagedClusterStatus_To_v1alpha4_AzureManagedClusterStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AzureManagedCluster_To_v1alpha4_AzureManagedCluster is an autogenerated conversion function. +func Convert_v1beta1_AzureManagedCluster_To_v1alpha4_AzureManagedCluster(in *v1beta1.AzureManagedCluster, out *AzureManagedCluster, s conversion.Scope) error { + return autoConvert_v1beta1_AzureManagedCluster_To_v1alpha4_AzureManagedCluster(in, out, s) +} + +func autoConvert_v1alpha4_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(in *AzureManagedClusterList, out *v1beta1.AzureManagedClusterList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta1.AzureManagedCluster, len(*in)) + for i := range *in { + if err := Convert_v1alpha4_AzureManagedCluster_To_v1beta1_AzureManagedCluster(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1alpha4_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList is an autogenerated conversion function. +func Convert_v1alpha4_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(in *AzureManagedClusterList, out *v1beta1.AzureManagedClusterList, s conversion.Scope) error { + return autoConvert_v1alpha4_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedClusterList_To_v1alpha4_AzureManagedClusterList(in *v1beta1.AzureManagedClusterList, out *AzureManagedClusterList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedCluster, len(*in)) + for i := range *in { + if err := Convert_v1beta1_AzureManagedCluster_To_v1alpha4_AzureManagedCluster(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_AzureManagedClusterList_To_v1alpha4_AzureManagedClusterList is an autogenerated conversion function. +func Convert_v1beta1_AzureManagedClusterList_To_v1alpha4_AzureManagedClusterList(in *v1beta1.AzureManagedClusterList, out *AzureManagedClusterList, s conversion.Scope) error { + return autoConvert_v1beta1_AzureManagedClusterList_To_v1alpha4_AzureManagedClusterList(in, out, s) +} + +func autoConvert_v1alpha4_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(in *AzureManagedClusterSpec, out *v1beta1.AzureManagedClusterSpec, s conversion.Scope) error { + if err := apiv1alpha4.Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec is an autogenerated conversion function. +func Convert_v1alpha4_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(in *AzureManagedClusterSpec, out *v1beta1.AzureManagedClusterSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedClusterSpec_To_v1alpha4_AzureManagedClusterSpec(in *v1beta1.AzureManagedClusterSpec, out *AzureManagedClusterSpec, s conversion.Scope) error { + if err := apiv1alpha4.Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AzureManagedClusterSpec_To_v1alpha4_AzureManagedClusterSpec is an autogenerated conversion function. +func Convert_v1beta1_AzureManagedClusterSpec_To_v1alpha4_AzureManagedClusterSpec(in *v1beta1.AzureManagedClusterSpec, out *AzureManagedClusterSpec, s conversion.Scope) error { + return autoConvert_v1beta1_AzureManagedClusterSpec_To_v1alpha4_AzureManagedClusterSpec(in, out, s) +} + +func autoConvert_v1alpha4_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(in *AzureManagedClusterStatus, out *v1beta1.AzureManagedClusterStatus, s conversion.Scope) error { + out.Ready = in.Ready + return nil +} + +// Convert_v1alpha4_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus is an autogenerated conversion function. +func Convert_v1alpha4_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(in *AzureManagedClusterStatus, out *v1beta1.AzureManagedClusterStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedClusterStatus_To_v1alpha4_AzureManagedClusterStatus(in *v1beta1.AzureManagedClusterStatus, out *AzureManagedClusterStatus, s conversion.Scope) error { + out.Ready = in.Ready + return nil +} + +// Convert_v1beta1_AzureManagedClusterStatus_To_v1alpha4_AzureManagedClusterStatus is an autogenerated conversion function. +func Convert_v1beta1_AzureManagedClusterStatus_To_v1alpha4_AzureManagedClusterStatus(in *v1beta1.AzureManagedClusterStatus, out *AzureManagedClusterStatus, s conversion.Scope) error { + return autoConvert_v1beta1_AzureManagedClusterStatus_To_v1alpha4_AzureManagedClusterStatus(in, out, s) +} + +func autoConvert_v1alpha4_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(in *AzureManagedControlPlane, out *v1beta1.AzureManagedControlPlane, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane is an autogenerated conversion function. +func Convert_v1alpha4_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(in *AzureManagedControlPlane, out *v1beta1.AzureManagedControlPlane, s conversion.Scope) error { + return autoConvert_v1alpha4_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedControlPlane_To_v1alpha4_AzureManagedControlPlane(in *v1beta1.AzureManagedControlPlane, out *AzureManagedControlPlane, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha4_AzureManagedControlPlaneSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha4_AzureManagedControlPlaneStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AzureManagedControlPlane_To_v1alpha4_AzureManagedControlPlane is an autogenerated conversion function. +func Convert_v1beta1_AzureManagedControlPlane_To_v1alpha4_AzureManagedControlPlane(in *v1beta1.AzureManagedControlPlane, out *AzureManagedControlPlane, s conversion.Scope) error { + return autoConvert_v1beta1_AzureManagedControlPlane_To_v1alpha4_AzureManagedControlPlane(in, out, s) +} + +func autoConvert_v1alpha4_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(in *AzureManagedControlPlaneList, out *v1beta1.AzureManagedControlPlaneList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta1.AzureManagedControlPlane, len(*in)) + for i := range *in { + if err := Convert_v1alpha4_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1alpha4_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList is an autogenerated conversion function. +func Convert_v1alpha4_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(in *AzureManagedControlPlaneList, out *v1beta1.AzureManagedControlPlaneList, s conversion.Scope) error { + return autoConvert_v1alpha4_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedControlPlaneList_To_v1alpha4_AzureManagedControlPlaneList(in *v1beta1.AzureManagedControlPlaneList, out *AzureManagedControlPlaneList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedControlPlane, len(*in)) + for i := range *in { + if err := Convert_v1beta1_AzureManagedControlPlane_To_v1alpha4_AzureManagedControlPlane(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_AzureManagedControlPlaneList_To_v1alpha4_AzureManagedControlPlaneList is an autogenerated conversion function. +func Convert_v1beta1_AzureManagedControlPlaneList_To_v1alpha4_AzureManagedControlPlaneList(in *v1beta1.AzureManagedControlPlaneList, out *AzureManagedControlPlaneList, s conversion.Scope) error { + return autoConvert_v1beta1_AzureManagedControlPlaneList_To_v1alpha4_AzureManagedControlPlaneList(in, out, s) +} + +func autoConvert_v1alpha4_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(in *AzureManagedControlPlaneSpec, out *v1beta1.AzureManagedControlPlaneSpec, s conversion.Scope) error { + out.Version = in.Version + out.ResourceGroupName = in.ResourceGroupName + out.NodeResourceGroupName = in.NodeResourceGroupName + if err := Convert_v1alpha4_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(&in.VirtualNetwork, &out.VirtualNetwork, s); err != nil { + return err + } + out.SubscriptionID = in.SubscriptionID + out.Location = in.Location + if err := apiv1alpha4.Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + return err + } + out.AdditionalTags = *(*v1beta1.Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.NetworkPlugin = (*string)(unsafe.Pointer(in.NetworkPlugin)) + out.NetworkPolicy = (*string)(unsafe.Pointer(in.NetworkPolicy)) + out.SSHPublicKey = in.SSHPublicKey + out.DNSServiceIP = (*string)(unsafe.Pointer(in.DNSServiceIP)) + out.LoadBalancerSKU = (*string)(unsafe.Pointer(in.LoadBalancerSKU)) + out.IdentityRef = (*corev1.ObjectReference)(unsafe.Pointer(in.IdentityRef)) + out.AADProfile = (*v1beta1.AADProfile)(unsafe.Pointer(in.AADProfile)) + out.SKU = (*v1beta1.AksSKU)(unsafe.Pointer(in.SKU)) + out.LoadBalancerProfile = (*v1beta1.LoadBalancerProfile)(unsafe.Pointer(in.LoadBalancerProfile)) + out.APIServerAccessProfile = (*v1beta1.APIServerAccessProfile)(unsafe.Pointer(in.APIServerAccessProfile)) + return nil +} + +// Convert_v1alpha4_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec is an autogenerated conversion function. +func Convert_v1alpha4_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(in *AzureManagedControlPlaneSpec, out *v1beta1.AzureManagedControlPlaneSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha4_AzureManagedControlPlaneSpec(in *v1beta1.AzureManagedControlPlaneSpec, out *AzureManagedControlPlaneSpec, s conversion.Scope) error { + out.Version = in.Version + out.ResourceGroupName = in.ResourceGroupName + out.NodeResourceGroupName = in.NodeResourceGroupName + if err := Convert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha4_ManagedControlPlaneVirtualNetwork(&in.VirtualNetwork, &out.VirtualNetwork, s); err != nil { + return err + } + out.SubscriptionID = in.SubscriptionID + out.Location = in.Location + if err := apiv1alpha4.Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + return err + } + out.AdditionalTags = *(*Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.NetworkPlugin = (*string)(unsafe.Pointer(in.NetworkPlugin)) + out.NetworkPolicy = (*string)(unsafe.Pointer(in.NetworkPolicy)) + out.SSHPublicKey = in.SSHPublicKey + out.DNSServiceIP = (*string)(unsafe.Pointer(in.DNSServiceIP)) + out.LoadBalancerSKU = (*string)(unsafe.Pointer(in.LoadBalancerSKU)) + out.IdentityRef = (*corev1.ObjectReference)(unsafe.Pointer(in.IdentityRef)) + out.AADProfile = (*AADProfile)(unsafe.Pointer(in.AADProfile)) + // WARNING: in.AddonProfiles requires manual conversion: does not exist in peer-type + out.SKU = (*AksSKU)(unsafe.Pointer(in.SKU)) + out.LoadBalancerProfile = (*LoadBalancerProfile)(unsafe.Pointer(in.LoadBalancerProfile)) + out.APIServerAccessProfile = (*APIServerAccessProfile)(unsafe.Pointer(in.APIServerAccessProfile)) + // WARNING: in.AutoScalerProfile requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1alpha4_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(in *AzureManagedControlPlaneStatus, out *v1beta1.AzureManagedControlPlaneStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.Initialized = in.Initialized + out.LongRunningOperationStates = *(*v1beta1.Futures)(unsafe.Pointer(&in.LongRunningOperationStates)) + return nil +} + +// Convert_v1alpha4_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus is an autogenerated conversion function. +func Convert_v1alpha4_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(in *AzureManagedControlPlaneStatus, out *v1beta1.AzureManagedControlPlaneStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha4_AzureManagedControlPlaneStatus(in *v1beta1.AzureManagedControlPlaneStatus, out *AzureManagedControlPlaneStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.Initialized = in.Initialized + // WARNING: in.Conditions requires manual conversion: does not exist in peer-type + out.LongRunningOperationStates = *(*Futures)(unsafe.Pointer(&in.LongRunningOperationStates)) + return nil +} + +func autoConvert_v1alpha4_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(in *AzureManagedMachinePool, out *v1beta1.AzureManagedMachinePool, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool is an autogenerated conversion function. +func Convert_v1alpha4_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(in *AzureManagedMachinePool, out *v1beta1.AzureManagedMachinePool, s conversion.Scope) error { + return autoConvert_v1alpha4_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedMachinePool_To_v1alpha4_AzureManagedMachinePool(in *v1beta1.AzureManagedMachinePool, out *AzureManagedMachinePool, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha4_AzureManagedMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha4_AzureManagedMachinePoolStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AzureManagedMachinePool_To_v1alpha4_AzureManagedMachinePool is an autogenerated conversion function. +func Convert_v1beta1_AzureManagedMachinePool_To_v1alpha4_AzureManagedMachinePool(in *v1beta1.AzureManagedMachinePool, out *AzureManagedMachinePool, s conversion.Scope) error { + return autoConvert_v1beta1_AzureManagedMachinePool_To_v1alpha4_AzureManagedMachinePool(in, out, s) +} + +func autoConvert_v1alpha4_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(in *AzureManagedMachinePoolList, out *v1beta1.AzureManagedMachinePoolList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta1.AzureManagedMachinePool, len(*in)) + for i := range *in { + if err := Convert_v1alpha4_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1alpha4_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList is an autogenerated conversion function. +func Convert_v1alpha4_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(in *AzureManagedMachinePoolList, out *v1beta1.AzureManagedMachinePoolList, s conversion.Scope) error { + return autoConvert_v1alpha4_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedMachinePoolList_To_v1alpha4_AzureManagedMachinePoolList(in *v1beta1.AzureManagedMachinePoolList, out *AzureManagedMachinePoolList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedMachinePool, len(*in)) + for i := range *in { + if err := Convert_v1beta1_AzureManagedMachinePool_To_v1alpha4_AzureManagedMachinePool(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_AzureManagedMachinePoolList_To_v1alpha4_AzureManagedMachinePoolList is an autogenerated conversion function. +func Convert_v1beta1_AzureManagedMachinePoolList_To_v1alpha4_AzureManagedMachinePoolList(in *v1beta1.AzureManagedMachinePoolList, out *AzureManagedMachinePoolList, s conversion.Scope) error { + return autoConvert_v1beta1_AzureManagedMachinePoolList_To_v1alpha4_AzureManagedMachinePoolList(in, out, s) +} + +func autoConvert_v1alpha4_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(in *AzureManagedMachinePoolSpec, out *v1beta1.AzureManagedMachinePoolSpec, s conversion.Scope) error { + out.Name = (*string)(unsafe.Pointer(in.Name)) + out.Mode = in.Mode + out.SKU = in.SKU + out.OSDiskSizeGB = (*int32)(unsafe.Pointer(in.OSDiskSizeGB)) + out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) + return nil +} + +// Convert_v1alpha4_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec is an autogenerated conversion function. +func Convert_v1alpha4_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(in *AzureManagedMachinePoolSpec, out *v1beta1.AzureManagedMachinePoolSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha4_AzureManagedMachinePoolSpec(in *v1beta1.AzureManagedMachinePoolSpec, out *AzureManagedMachinePoolSpec, s conversion.Scope) error { + // WARNING: in.AdditionalTags requires manual conversion: does not exist in peer-type + out.Name = (*string)(unsafe.Pointer(in.Name)) + out.Mode = in.Mode + out.SKU = in.SKU + out.OSDiskSizeGB = (*int32)(unsafe.Pointer(in.OSDiskSizeGB)) + // WARNING: in.AvailabilityZones requires manual conversion: does not exist in peer-type + // WARNING: in.NodeLabels requires manual conversion: does not exist in peer-type + // WARNING: in.Taints requires manual conversion: does not exist in peer-type + out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) + // WARNING: in.Scaling requires manual conversion: does not exist in peer-type + // WARNING: in.MaxPods requires manual conversion: does not exist in peer-type + // WARNING: in.OsDiskType requires manual conversion: does not exist in peer-type + // WARNING: in.EnableUltraSSD requires manual conversion: does not exist in peer-type + // WARNING: in.OSType requires manual conversion: does not exist in peer-type + // WARNING: in.EnableNodePublicIP requires manual conversion: does not exist in peer-type + // WARNING: in.NodePublicIPPrefixID requires manual conversion: does not exist in peer-type + // WARNING: in.ScaleSetPriority requires manual conversion: does not exist in peer-type + // WARNING: in.KubeletConfig requires manual conversion: does not exist in peer-type + // WARNING: in.KubeletDiskType requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1alpha4_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(in *AzureManagedMachinePoolStatus, out *v1beta1.AzureManagedMachinePoolStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.Replicas = in.Replicas + out.ErrorReason = (*errors.MachineStatusError)(unsafe.Pointer(in.ErrorReason)) + out.ErrorMessage = (*string)(unsafe.Pointer(in.ErrorMessage)) + return nil +} + +// Convert_v1alpha4_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus is an autogenerated conversion function. +func Convert_v1alpha4_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(in *AzureManagedMachinePoolStatus, out *v1beta1.AzureManagedMachinePoolStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(in, out, s) +} + +func autoConvert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha4_AzureManagedMachinePoolStatus(in *v1beta1.AzureManagedMachinePoolStatus, out *AzureManagedMachinePoolStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.Replicas = in.Replicas + out.ErrorReason = (*errors.MachineStatusError)(unsafe.Pointer(in.ErrorReason)) + out.ErrorMessage = (*string)(unsafe.Pointer(in.ErrorMessage)) + // WARNING: in.Conditions requires manual conversion: does not exist in peer-type + // WARNING: in.LongRunningOperationStates requires manual conversion: does not exist in peer-type + return nil +} + func autoConvert_v1alpha4_AzureMarketplaceImage_To_v1beta1_AzureMarketplaceImage(in *AzureMarketplaceImage, out *v1beta1.AzureMarketplaceImage, s conversion.Scope) error { // WARNING: in.Publisher requires manual conversion: does not exist in peer-type // WARNING: in.Offer requires manual conversion: does not exist in peer-type @@ -1572,6 +2225,34 @@ func autoConvert_v1beta1_Image_To_v1alpha4_Image(in *v1beta1.Image, out *Image, return nil } +func autoConvert_v1alpha4_LoadBalancerProfile_To_v1beta1_LoadBalancerProfile(in *LoadBalancerProfile, out *v1beta1.LoadBalancerProfile, s conversion.Scope) error { + out.ManagedOutboundIPs = (*int32)(unsafe.Pointer(in.ManagedOutboundIPs)) + out.OutboundIPPrefixes = *(*[]string)(unsafe.Pointer(&in.OutboundIPPrefixes)) + out.OutboundIPs = *(*[]string)(unsafe.Pointer(&in.OutboundIPs)) + out.AllocatedOutboundPorts = (*int32)(unsafe.Pointer(in.AllocatedOutboundPorts)) + out.IdleTimeoutInMinutes = (*int32)(unsafe.Pointer(in.IdleTimeoutInMinutes)) + return nil +} + +// Convert_v1alpha4_LoadBalancerProfile_To_v1beta1_LoadBalancerProfile is an autogenerated conversion function. +func Convert_v1alpha4_LoadBalancerProfile_To_v1beta1_LoadBalancerProfile(in *LoadBalancerProfile, out *v1beta1.LoadBalancerProfile, s conversion.Scope) error { + return autoConvert_v1alpha4_LoadBalancerProfile_To_v1beta1_LoadBalancerProfile(in, out, s) +} + +func autoConvert_v1beta1_LoadBalancerProfile_To_v1alpha4_LoadBalancerProfile(in *v1beta1.LoadBalancerProfile, out *LoadBalancerProfile, s conversion.Scope) error { + out.ManagedOutboundIPs = (*int32)(unsafe.Pointer(in.ManagedOutboundIPs)) + out.OutboundIPPrefixes = *(*[]string)(unsafe.Pointer(&in.OutboundIPPrefixes)) + out.OutboundIPs = *(*[]string)(unsafe.Pointer(&in.OutboundIPs)) + out.AllocatedOutboundPorts = (*int32)(unsafe.Pointer(in.AllocatedOutboundPorts)) + out.IdleTimeoutInMinutes = (*int32)(unsafe.Pointer(in.IdleTimeoutInMinutes)) + return nil +} + +// Convert_v1beta1_LoadBalancerProfile_To_v1alpha4_LoadBalancerProfile is an autogenerated conversion function. +func Convert_v1beta1_LoadBalancerProfile_To_v1alpha4_LoadBalancerProfile(in *v1beta1.LoadBalancerProfile, out *LoadBalancerProfile, s conversion.Scope) error { + return autoConvert_v1beta1_LoadBalancerProfile_To_v1alpha4_LoadBalancerProfile(in, out, s) +} + func autoConvert_v1alpha4_LoadBalancerSpec_To_v1beta1_LoadBalancerSpec(in *LoadBalancerSpec, out *v1beta1.LoadBalancerSpec, s conversion.Scope) error { out.ID = in.ID out.Name = in.Name @@ -1613,6 +2294,48 @@ func autoConvert_v1beta1_LoadBalancerSpec_To_v1alpha4_LoadBalancerSpec(in *v1bet return nil } +func autoConvert_v1alpha4_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(in *ManagedControlPlaneSubnet, out *v1beta1.ManagedControlPlaneSubnet, s conversion.Scope) error { + out.Name = in.Name + out.CIDRBlock = in.CIDRBlock + return nil +} + +// Convert_v1alpha4_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet is an autogenerated conversion function. +func Convert_v1alpha4_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(in *ManagedControlPlaneSubnet, out *v1beta1.ManagedControlPlaneSubnet, s conversion.Scope) error { + return autoConvert_v1alpha4_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(in, out, s) +} + +func autoConvert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha4_ManagedControlPlaneSubnet(in *v1beta1.ManagedControlPlaneSubnet, out *ManagedControlPlaneSubnet, s conversion.Scope) error { + out.Name = in.Name + out.CIDRBlock = in.CIDRBlock + // WARNING: in.ServiceEndpoints requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1alpha4_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(in *ManagedControlPlaneVirtualNetwork, out *v1beta1.ManagedControlPlaneVirtualNetwork, s conversion.Scope) error { + out.Name = in.Name + out.CIDRBlock = in.CIDRBlock + if err := Convert_v1alpha4_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(&in.Subnet, &out.Subnet, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork is an autogenerated conversion function. +func Convert_v1alpha4_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(in *ManagedControlPlaneVirtualNetwork, out *v1beta1.ManagedControlPlaneVirtualNetwork, s conversion.Scope) error { + return autoConvert_v1alpha4_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(in, out, s) +} + +func autoConvert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha4_ManagedControlPlaneVirtualNetwork(in *v1beta1.ManagedControlPlaneVirtualNetwork, out *ManagedControlPlaneVirtualNetwork, s conversion.Scope) error { + out.Name = in.Name + out.CIDRBlock = in.CIDRBlock + if err := Convert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha4_ManagedControlPlaneSubnet(&in.Subnet, &out.Subnet, s); err != nil { + return err + } + // WARNING: in.ResourceGroup requires manual conversion: does not exist in peer-type + return nil +} + func autoConvert_v1alpha4_ManagedDiskParameters_To_v1beta1_ManagedDiskParameters(in *ManagedDiskParameters, out *v1beta1.ManagedDiskParameters, s conversion.Scope) error { out.StorageAccountType = in.StorageAccountType out.DiskEncryptionSet = (*v1beta1.DiskEncryptionSetParameters)(unsafe.Pointer(in.DiskEncryptionSet)) diff --git a/api/v1alpha4/zz_generated.deepcopy.go b/api/v1alpha4/zz_generated.deepcopy.go index 0f77e6e9be3..d50bc680004 100644 --- a/api/v1alpha4/zz_generated.deepcopy.go +++ b/api/v1alpha4/zz_generated.deepcopy.go @@ -29,6 +29,61 @@ import ( "sigs.k8s.io/cluster-api/errors" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AADProfile) DeepCopyInto(out *AADProfile) { + *out = *in + if in.AdminGroupObjectIDs != nil { + in, out := &in.AdminGroupObjectIDs, &out.AdminGroupObjectIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AADProfile. +func (in *AADProfile) DeepCopy() *AADProfile { + if in == nil { + return nil + } + out := new(AADProfile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APIServerAccessProfile) DeepCopyInto(out *APIServerAccessProfile) { + *out = *in + if in.AuthorizedIPRanges != nil { + in, out := &in.AuthorizedIPRanges, &out.AuthorizedIPRanges + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.EnablePrivateCluster != nil { + in, out := &in.EnablePrivateCluster, &out.EnablePrivateCluster + *out = new(bool) + **out = **in + } + if in.PrivateDNSZone != nil { + in, out := &in.PrivateDNSZone, &out.PrivateDNSZone + *out = new(string) + **out = **in + } + if in.EnablePrivateClusterPublicFQDN != nil { + in, out := &in.EnablePrivateClusterPublicFQDN, &out.EnablePrivateClusterPublicFQDN + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIServerAccessProfile. +func (in *APIServerAccessProfile) DeepCopy() *APIServerAccessProfile { + if in == nil { + return nil + } + out := new(APIServerAccessProfile) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AddressRecord) DeepCopyInto(out *AddressRecord) { *out = *in @@ -44,6 +99,21 @@ func (in *AddressRecord) DeepCopy() *AddressRecord { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AksSKU) DeepCopyInto(out *AksSKU) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AksSKU. +func (in *AksSKU) DeepCopy() *AksSKU { + if in == nil { + return nil + } + out := new(AksSKU) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AllowedNamespaces) DeepCopyInto(out *AllowedNamespaces) { *out = *in @@ -577,6 +647,358 @@ func (in *AzureMachineTemplateSpec) DeepCopy() *AzureMachineTemplateSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedCluster) DeepCopyInto(out *AzureManagedCluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedCluster. +func (in *AzureManagedCluster) DeepCopy() *AzureManagedCluster { + if in == nil { + return nil + } + out := new(AzureManagedCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedCluster) 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 *AzureManagedClusterList) DeepCopyInto(out *AzureManagedClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterList. +func (in *AzureManagedClusterList) DeepCopy() *AzureManagedClusterList { + if in == nil { + return nil + } + out := new(AzureManagedClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedClusterList) 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 *AzureManagedClusterSpec) DeepCopyInto(out *AzureManagedClusterSpec) { + *out = *in + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterSpec. +func (in *AzureManagedClusterSpec) DeepCopy() *AzureManagedClusterSpec { + if in == nil { + return nil + } + out := new(AzureManagedClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedClusterStatus) DeepCopyInto(out *AzureManagedClusterStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterStatus. +func (in *AzureManagedClusterStatus) DeepCopy() *AzureManagedClusterStatus { + if in == nil { + return nil + } + out := new(AzureManagedClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedControlPlane) DeepCopyInto(out *AzureManagedControlPlane) { + *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 AzureManagedControlPlane. +func (in *AzureManagedControlPlane) DeepCopy() *AzureManagedControlPlane { + if in == nil { + return nil + } + out := new(AzureManagedControlPlane) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedControlPlane) 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 *AzureManagedControlPlaneList) DeepCopyInto(out *AzureManagedControlPlaneList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedControlPlane, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneList. +func (in *AzureManagedControlPlaneList) DeepCopy() *AzureManagedControlPlaneList { + if in == nil { + return nil + } + out := new(AzureManagedControlPlaneList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedControlPlaneList) 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 *AzureManagedControlPlaneSpec) DeepCopyInto(out *AzureManagedControlPlaneSpec) { + *out = *in + out.VirtualNetwork = in.VirtualNetwork + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint + if in.AdditionalTags != nil { + in, out := &in.AdditionalTags, &out.AdditionalTags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.NetworkPlugin != nil { + in, out := &in.NetworkPlugin, &out.NetworkPlugin + *out = new(string) + **out = **in + } + if in.NetworkPolicy != nil { + in, out := &in.NetworkPolicy, &out.NetworkPolicy + *out = new(string) + **out = **in + } + if in.DNSServiceIP != nil { + in, out := &in.DNSServiceIP, &out.DNSServiceIP + *out = new(string) + **out = **in + } + if in.LoadBalancerSKU != nil { + in, out := &in.LoadBalancerSKU, &out.LoadBalancerSKU + *out = new(string) + **out = **in + } + if in.IdentityRef != nil { + in, out := &in.IdentityRef, &out.IdentityRef + *out = new(v1.ObjectReference) + **out = **in + } + if in.AADProfile != nil { + in, out := &in.AADProfile, &out.AADProfile + *out = new(AADProfile) + (*in).DeepCopyInto(*out) + } + if in.SKU != nil { + in, out := &in.SKU, &out.SKU + *out = new(AksSKU) + **out = **in + } + if in.LoadBalancerProfile != nil { + in, out := &in.LoadBalancerProfile, &out.LoadBalancerProfile + *out = new(LoadBalancerProfile) + (*in).DeepCopyInto(*out) + } + if in.APIServerAccessProfile != nil { + in, out := &in.APIServerAccessProfile, &out.APIServerAccessProfile + *out = new(APIServerAccessProfile) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneSpec. +func (in *AzureManagedControlPlaneSpec) DeepCopy() *AzureManagedControlPlaneSpec { + if in == nil { + return nil + } + out := new(AzureManagedControlPlaneSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedControlPlaneStatus) DeepCopyInto(out *AzureManagedControlPlaneStatus) { + *out = *in + if in.LongRunningOperationStates != nil { + in, out := &in.LongRunningOperationStates, &out.LongRunningOperationStates + *out = make(Futures, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneStatus. +func (in *AzureManagedControlPlaneStatus) DeepCopy() *AzureManagedControlPlaneStatus { + if in == nil { + return nil + } + out := new(AzureManagedControlPlaneStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedMachinePool) DeepCopyInto(out *AzureManagedMachinePool) { + *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 AzureManagedMachinePool. +func (in *AzureManagedMachinePool) DeepCopy() *AzureManagedMachinePool { + if in == nil { + return nil + } + out := new(AzureManagedMachinePool) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedMachinePool) 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 *AzureManagedMachinePoolList) DeepCopyInto(out *AzureManagedMachinePoolList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedMachinePool, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolList. +func (in *AzureManagedMachinePoolList) DeepCopy() *AzureManagedMachinePoolList { + if in == nil { + return nil + } + out := new(AzureManagedMachinePoolList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedMachinePoolList) 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 *AzureManagedMachinePoolSpec) DeepCopyInto(out *AzureManagedMachinePoolSpec) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.OSDiskSizeGB != nil { + in, out := &in.OSDiskSizeGB, &out.OSDiskSizeGB + *out = new(int32) + **out = **in + } + if in.ProviderIDList != nil { + in, out := &in.ProviderIDList, &out.ProviderIDList + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolSpec. +func (in *AzureManagedMachinePoolSpec) DeepCopy() *AzureManagedMachinePoolSpec { + if in == nil { + return nil + } + out := new(AzureManagedMachinePoolSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedMachinePoolStatus) DeepCopyInto(out *AzureManagedMachinePoolStatus) { + *out = *in + if in.ErrorReason != nil { + in, out := &in.ErrorReason, &out.ErrorReason + *out = new(errors.MachineStatusError) + **out = **in + } + if in.ErrorMessage != nil { + in, out := &in.ErrorMessage, &out.ErrorMessage + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolStatus. +func (in *AzureManagedMachinePoolStatus) DeepCopy() *AzureManagedMachinePoolStatus { + if in == nil { + return nil + } + out := new(AzureManagedMachinePoolStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AzureMarketplaceImage) DeepCopyInto(out *AzureMarketplaceImage) { *out = *in @@ -861,6 +1283,46 @@ func (in *Image) DeepCopy() *Image { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancerProfile) DeepCopyInto(out *LoadBalancerProfile) { + *out = *in + if in.ManagedOutboundIPs != nil { + in, out := &in.ManagedOutboundIPs, &out.ManagedOutboundIPs + *out = new(int32) + **out = **in + } + if in.OutboundIPPrefixes != nil { + in, out := &in.OutboundIPPrefixes, &out.OutboundIPPrefixes + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.OutboundIPs != nil { + in, out := &in.OutboundIPs, &out.OutboundIPs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AllocatedOutboundPorts != nil { + in, out := &in.AllocatedOutboundPorts, &out.AllocatedOutboundPorts + *out = new(int32) + **out = **in + } + if in.IdleTimeoutInMinutes != nil { + in, out := &in.IdleTimeoutInMinutes, &out.IdleTimeoutInMinutes + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerProfile. +func (in *LoadBalancerProfile) DeepCopy() *LoadBalancerProfile { + if in == nil { + return nil + } + out := new(LoadBalancerProfile) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LoadBalancerSpec) DeepCopyInto(out *LoadBalancerSpec) { *out = *in @@ -893,6 +1355,37 @@ func (in *LoadBalancerSpec) DeepCopy() *LoadBalancerSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedControlPlaneSubnet) DeepCopyInto(out *ManagedControlPlaneSubnet) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedControlPlaneSubnet. +func (in *ManagedControlPlaneSubnet) DeepCopy() *ManagedControlPlaneSubnet { + if in == nil { + return nil + } + out := new(ManagedControlPlaneSubnet) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedControlPlaneVirtualNetwork) DeepCopyInto(out *ManagedControlPlaneVirtualNetwork) { + *out = *in + out.Subnet = in.Subnet +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedControlPlaneVirtualNetwork. +func (in *ManagedControlPlaneVirtualNetwork) DeepCopy() *ManagedControlPlaneVirtualNetwork { + if in == nil { + return nil + } + out := new(ManagedControlPlaneVirtualNetwork) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedDiskParameters) DeepCopyInto(out *ManagedDiskParameters) { *out = *in diff --git a/exp/api/v1beta1/azuremanagedcluster_conversion.go b/api/v1beta1/azuremanagedcluster_conversion.go similarity index 94% rename from exp/api/v1beta1/azuremanagedcluster_conversion.go rename to api/v1beta1/azuremanagedcluster_conversion.go index a0cac94ce15..318d54221bc 100644 --- a/exp/api/v1beta1/azuremanagedcluster_conversion.go +++ b/api/v1beta1/azuremanagedcluster_conversion.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Kubernetes Authors. +Copyright 2023 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. diff --git a/exp/api/v1beta1/azuremanagedcluster_types.go b/api/v1beta1/azuremanagedcluster_types.go similarity index 98% rename from exp/api/v1beta1/azuremanagedcluster_types.go rename to api/v1beta1/azuremanagedcluster_types.go index 354a1ff475a..3433c471eac 100644 --- a/exp/api/v1beta1/azuremanagedcluster_types.go +++ b/api/v1beta1/azuremanagedcluster_types.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Kubernetes Authors. +Copyright 2023 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. diff --git a/exp/api/v1beta1/azuremanagedcluster_webhook.go b/api/v1beta1/azuremanagedcluster_webhook.go similarity index 87% rename from exp/api/v1beta1/azuremanagedcluster_webhook.go rename to api/v1beta1/azuremanagedcluster_webhook.go index b6e19af1bed..3d5564c9fbe 100644 --- a/exp/api/v1beta1/azuremanagedcluster_webhook.go +++ b/api/v1beta1/azuremanagedcluster_webhook.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Kubernetes Authors. +Copyright 2023 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. @@ -23,10 +23,10 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/validation/field" - "sigs.k8s.io/cluster-api-provider-azure/azure" "sigs.k8s.io/cluster-api-provider-azure/feature" "sigs.k8s.io/cluster-api-provider-azure/util/maps" webhookutils "sigs.k8s.io/cluster-api-provider-azure/util/webhook" + capifeature "sigs.k8s.io/cluster-api/feature" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/webhook" ) @@ -44,12 +44,12 @@ var _ webhook.Validator = &AzureManagedCluster{} // ValidateCreate implements webhook.Validator so a webhook will be registered for the type. func (r *AzureManagedCluster) ValidateCreate() error { - // NOTE: AzureManagedCluster is behind AKS feature gate flag; the web hook - // must prevent creating new objects in case the feature flag is disabled. - if !feature.Gates.Enabled(feature.AKS) { + // NOTE: AzureManagedCluster relies upon MachinePools, which is behind a feature gate flag. + // The web hook must prevent creating new objects in case the feature flag is disabled. + if !feature.Gates.Enabled(capifeature.MachinePool) { return field.Forbidden( field.NewPath("spec"), - "can be set only if the AKS feature flag is enabled", + "can be set only if the Cluster API 'MachinePool' feature flag is enabled", ) } if r.Spec.ControlPlaneEndpoint.Host != "" { @@ -73,14 +73,14 @@ func (r *AzureManagedCluster) ValidateUpdate(oldRaw runtime.Object) error { var allErrs field.ErrorList // custom headers are immutable - oldCustomHeaders := maps.FilterByKeyPrefix(old.ObjectMeta.Annotations, azure.CustomHeaderPrefix) - newCustomHeaders := maps.FilterByKeyPrefix(r.ObjectMeta.Annotations, azure.CustomHeaderPrefix) + oldCustomHeaders := maps.FilterByKeyPrefix(old.ObjectMeta.Annotations, CustomHeaderPrefix) + newCustomHeaders := maps.FilterByKeyPrefix(r.ObjectMeta.Annotations, CustomHeaderPrefix) if !reflect.DeepEqual(oldCustomHeaders, newCustomHeaders) { allErrs = append(allErrs, field.Invalid( field.NewPath("metadata", "annotations"), r.ObjectMeta.Annotations, - fmt.Sprintf("annotations with '%s' prefix are immutable", azure.CustomHeaderPrefix))) + fmt.Sprintf("annotations with '%s' prefix are immutable", CustomHeaderPrefix))) } if old.Spec.ControlPlaneEndpoint.Host != "" { diff --git a/exp/api/v1beta1/azuremanagedcluster_webhook_test.go b/api/v1beta1/azuremanagedcluster_webhook_test.go similarity index 95% rename from exp/api/v1beta1/azuremanagedcluster_webhook_test.go rename to api/v1beta1/azuremanagedcluster_webhook_test.go index c527612fb45..299aa0bd9a4 100644 --- a/exp/api/v1beta1/azuremanagedcluster_webhook_test.go +++ b/api/v1beta1/azuremanagedcluster_webhook_test.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Kubernetes Authors. +Copyright 2023 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. @@ -24,12 +24,13 @@ import ( utilfeature "k8s.io/component-base/featuregate/testing" "sigs.k8s.io/cluster-api-provider-azure/feature" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + capifeature "sigs.k8s.io/cluster-api/feature" ) func TestAzureManagedCluster_ValidateUpdate(t *testing.T) { // NOTE: AzureManagedCluster is behind AKS feature gate flag; the web hook // must prevent creating new objects in case the feature flag is disabled. - defer utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.AKS, true)() + defer utilfeature.SetFeatureGateDuringTest(t, feature.Gates, capifeature.MachinePool, true)() g := NewWithT(t) @@ -199,7 +200,7 @@ func TestAzureManagedCluster_ValidateUpdate(t *testing.T) { func TestAzureManagedCluster_ValidateCreate(t *testing.T) { // NOTE: AzureManagedCluster is behind AKS feature gate flag; the web hook // must prevent creating new objects in case the feature flag is disabled. - defer utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.AKS, true)() + defer utilfeature.SetFeatureGateDuringTest(t, feature.Gates, capifeature.MachinePool, true)() g := NewWithT(t) @@ -255,7 +256,7 @@ func TestAzureManagedCluster_ValidateCreateFailure(t *testing.T) { { name: "feature gate explicitly disabled", amc: getKnownValidAzureManagedCluster(), - deferFunc: utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.AKS, false), + deferFunc: utilfeature.SetFeatureGateDuringTest(t, feature.Gates, capifeature.MachinePool, false), }, { name: "feature gate implicitly disabled", diff --git a/exp/api/v1beta1/azuremanagedcontrolplane_conversion.go b/api/v1beta1/azuremanagedcontrolplane_conversion.go similarity index 95% rename from exp/api/v1beta1/azuremanagedcontrolplane_conversion.go rename to api/v1beta1/azuremanagedcontrolplane_conversion.go index 06013eb13d8..56ddef15f02 100644 --- a/exp/api/v1beta1/azuremanagedcontrolplane_conversion.go +++ b/api/v1beta1/azuremanagedcontrolplane_conversion.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Kubernetes Authors. +Copyright 2023 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. diff --git a/exp/api/v1beta1/azuremanagedcontrolplane_default.go b/api/v1beta1/azuremanagedcontrolplane_default.go similarity index 98% rename from exp/api/v1beta1/azuremanagedcontrolplane_default.go rename to api/v1beta1/azuremanagedcontrolplane_default.go index bca099835f0..007e99f2cbe 100644 --- a/exp/api/v1beta1/azuremanagedcontrolplane_default.go +++ b/api/v1beta1/azuremanagedcontrolplane_default.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Kubernetes Authors. +Copyright 2023 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. @@ -78,7 +78,7 @@ func (m *AzureManagedControlPlane) setDefaultSubnet() { func (m *AzureManagedControlPlane) setDefaultSku() { if m.Spec.SKU == nil { - m.Spec.SKU = &SKU{ + m.Spec.SKU = &AksSKU{ Tier: FreeManagedControlPlaneTier, } } diff --git a/exp/api/v1beta1/azuremanagedcontrolplane_default_test.go b/api/v1beta1/azuremanagedcontrolplane_default_test.go similarity index 97% rename from exp/api/v1beta1/azuremanagedcontrolplane_default_test.go rename to api/v1beta1/azuremanagedcontrolplane_default_test.go index 154c9abc0d5..b0cff2d7fe6 100644 --- a/exp/api/v1beta1/azuremanagedcontrolplane_default_test.go +++ b/api/v1beta1/azuremanagedcontrolplane_default_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Kubernetes Authors. +Copyright 2023 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. diff --git a/exp/api/v1beta1/azuremanagedcontrolplane_types.go b/api/v1beta1/azuremanagedcontrolplane_types.go similarity index 96% rename from exp/api/v1beta1/azuremanagedcontrolplane_types.go rename to api/v1beta1/azuremanagedcontrolplane_types.go index bc8dc0f3d25..7dc0c30469f 100644 --- a/exp/api/v1beta1/azuremanagedcontrolplane_types.go +++ b/api/v1beta1/azuremanagedcontrolplane_types.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Kubernetes Authors. +Copyright 2023 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. @@ -19,7 +19,6 @@ package v1beta1 import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) @@ -68,7 +67,7 @@ type AzureManagedControlPlaneSpec struct { // AdditionalTags is an optional set of tags to add to Azure resources managed by the Azure provider, in addition to the // ones added by default. // +optional - AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` + AdditionalTags Tags `json:"additionalTags,omitempty"` // NetworkPlugin used for building Kubernetes network. // +kubebuilder:validation:Enum=azure;kubenet @@ -107,7 +106,7 @@ type AzureManagedControlPlaneSpec struct { // SKU is the SKU of the AKS to be provisioned. // +optional - SKU *SKU `json:"sku,omitempty"` + SKU *AksSKU `json:"sku,omitempty"` // LoadBalancerProfile is the profile of the cluster load balancer. // +optional @@ -157,9 +156,9 @@ const ( PaidManagedControlPlaneTier AzureManagedControlPlaneSkuTier = "Paid" ) -// SKU - AKS SKU. -type SKU struct { - // Tier - Tier of a managed cluster SKU. +// AksSKU - AKS SKU. +type AksSKU struct { + // Tier - Tier of an AKS cluster. Tier AzureManagedControlPlaneSkuTier `json:"tier"` } @@ -226,7 +225,7 @@ type ManagedControlPlaneSubnet struct { // ServiceEndpoints is a slice of Virtual Network service endpoints to enable for the subnets. // +optional - ServiceEndpoints infrav1.ServiceEndpoints `json:"serviceEndpoints,omitempty"` + ServiceEndpoints ServiceEndpoints `json:"serviceEndpoints,omitempty"` } // AzureManagedControlPlaneStatus defines the observed state of AzureManagedControlPlane. @@ -248,7 +247,7 @@ type AzureManagedControlPlaneStatus struct { // LongRunningOperationStates saves the states for Azure long-running operations so they can be continued on the // next reconciliation loop. // +optional - LongRunningOperationStates infrav1.Futures `json:"longRunningOperationStates,omitempty"` + LongRunningOperationStates Futures `json:"longRunningOperationStates,omitempty"` } // AutoScalerProfile parameters to be applied to the cluster-autoscaler. @@ -401,12 +400,12 @@ func (m *AzureManagedControlPlane) SetConditions(conditions clusterv1.Conditions } // GetFutures returns the list of long running operation states for an AzureManagedControlPlane API object. -func (m *AzureManagedControlPlane) GetFutures() infrav1.Futures { +func (m *AzureManagedControlPlane) GetFutures() Futures { return m.Status.LongRunningOperationStates } // SetFutures will set the given long running operation states on an AzureManagedControlPlane object. -func (m *AzureManagedControlPlane) SetFutures(futures infrav1.Futures) { +func (m *AzureManagedControlPlane) SetFutures(futures Futures) { m.Status.LongRunningOperationStates = futures } diff --git a/exp/api/v1beta1/azuremanagedcontrolplane_webhook.go b/api/v1beta1/azuremanagedcontrolplane_webhook.go similarity index 97% rename from exp/api/v1beta1/azuremanagedcontrolplane_webhook.go rename to api/v1beta1/azuremanagedcontrolplane_webhook.go index 6badeb8e133..516dc920874 100644 --- a/exp/api/v1beta1/azuremanagedcontrolplane_webhook.go +++ b/api/v1beta1/azuremanagedcontrolplane_webhook.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Kubernetes Authors. +Copyright 2023 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. @@ -32,10 +32,10 @@ import ( "k8s.io/apimachinery/pkg/runtime" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/validation/field" - infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" "sigs.k8s.io/cluster-api-provider-azure/feature" webhookutils "sigs.k8s.io/cluster-api-provider-azure/util/webhook" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + capifeature "sigs.k8s.io/cluster-api/feature" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -89,12 +89,12 @@ func (m *AzureManagedControlPlane) Default(_ client.Client) { // ValidateCreate implements webhook.Validator so a webhook will be registered for the type. func (m *AzureManagedControlPlane) ValidateCreate(client client.Client) error { - // NOTE: AzureManagedControlPlane is behind AKS feature gate flag; the web hook - // must prevent creating new objects in case the feature flag is disabled. - if !feature.Gates.Enabled(feature.AKS) { + // NOTE: AzureManagedControlPlane relies upon MachinePools, which is behind a feature gate flag. + // The web hook must prevent creating new objects in case the feature flag is disabled. + if !feature.Gates.Enabled(capifeature.MachinePool) { return field.Forbidden( field.NewPath("spec"), - "can be set only if the AKS feature flag is enabled", + "can be set only if the Cluster API 'MachinePool' feature flag is enabled", ) } @@ -119,13 +119,6 @@ func (m *AzureManagedControlPlane) ValidateUpdate(oldRaw runtime.Object, client var allErrs field.ErrorList old := oldRaw.(*AzureManagedControlPlane) - if err := webhookutils.ValidateImmutable( - field.NewPath("Name"), - old.Name, - m.Name); err != nil { - allErrs = append(allErrs, err) - } - if err := webhookutils.ValidateImmutable( field.NewPath("Spec", "SubscriptionID"), old.Spec.SubscriptionID, @@ -299,7 +292,7 @@ func (m *AzureManagedControlPlane) validateVersion(_ client.Client) error { func (m *AzureManagedControlPlane) validateSSHKey(_ client.Client) error { if m.Spec.SSHPublicKey != "" { sshKey := m.Spec.SSHPublicKey - if errs := infrav1.ValidateSSHKey(sshKey, field.NewPath("sshKey")); len(errs) > 0 { + if errs := ValidateSSHKey(sshKey, field.NewPath("sshKey")); len(errs) > 0 { return kerrors.NewAggregate(errs.ToAggregate().Errors()) } } diff --git a/exp/api/v1beta1/azuremanagedcontrolplane_webhook_test.go b/api/v1beta1/azuremanagedcontrolplane_webhook_test.go similarity index 97% rename from exp/api/v1beta1/azuremanagedcontrolplane_webhook_test.go rename to api/v1beta1/azuremanagedcontrolplane_webhook_test.go index 0d5ed4210cd..44af75a5f15 100644 --- a/exp/api/v1beta1/azuremanagedcontrolplane_webhook_test.go +++ b/api/v1beta1/azuremanagedcontrolplane_webhook_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Kubernetes Authors. +Copyright 2023 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. @@ -26,6 +26,7 @@ import ( "k8s.io/utils/pointer" "sigs.k8s.io/cluster-api-provider-azure/feature" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + capifeature "sigs.k8s.io/cluster-api/feature" ) func TestDefaultingWebhook(t *testing.T) { @@ -81,7 +82,7 @@ func TestDefaultingWebhook(t *testing.T) { func TestValidatingWebhook(t *testing.T) { // NOTE: AzureManageControlPlane is behind AKS feature gate flag; the web hook // must prevent creating new objects in case the feature flag is disabled. - defer utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.AKS, true)() + defer utilfeature.SetFeatureGateDuringTest(t, feature.Gates, capifeature.MachinePool, true)() g := NewWithT(t) tests := []struct { name string @@ -561,7 +562,7 @@ func TestValidatingWebhook(t *testing.T) { func TestAzureManagedControlPlane_ValidateCreate(t *testing.T) { // NOTE: AzureManageControlPlane is behind AKS feature gate flag; the web hook // must prevent creating new objects in case the feature flag is disabled. - defer utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.AKS, true)() + defer utilfeature.SetFeatureGateDuringTest(t, feature.Gates, capifeature.MachinePool, true)() g := NewWithT(t) tests := []struct { @@ -696,7 +697,7 @@ func TestAzureManagedControlPlane_ValidateCreateFailure(t *testing.T) { { name: "feature gate explicitly disabled", amcp: getKnownValidAzureManagedControlPlane(), - deferFunc: utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.AKS, false), + deferFunc: utilfeature.SetFeatureGateDuringTest(t, feature.Gates, capifeature.MachinePool, false), }, { name: "feature gate implicitly disabled", @@ -1122,31 +1123,6 @@ func TestAzureManagedControlPlane_ValidateUpdate(t *testing.T) { }, wantErr: false, }, - { - name: "AzureManagedControlPlane Name is mutable", - oldAMCP: &AzureManagedControlPlane{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-cluster", - }, - Spec: AzureManagedControlPlaneSpec{ - DNSServiceIP: to.StringPtr("192.168.0.0"), - Version: "v1.18.0", - }, - }, - amcp: &AzureManagedControlPlane{ - ObjectMeta: metav1.ObjectMeta{ - Name: "new-test-cluster", - }, - Spec: AzureManagedControlPlaneSpec{ - DNSServiceIP: to.StringPtr("192.168.0.0"), - Version: "v1.18.0", - APIServerAccessProfile: &APIServerAccessProfile{ - AuthorizedIPRanges: []string{"192.168.0.1/32"}, - }, - }, - }, - wantErr: true, - }, { name: "AzureManagedControlPlane.VirtualNetwork Name is mutable", oldAMCP: &AzureManagedControlPlane{ diff --git a/exp/api/v1beta1/azuremanagedmachinepool_conversion.go b/api/v1beta1/azuremanagedmachinepool_conversion.go similarity index 95% rename from exp/api/v1beta1/azuremanagedmachinepool_conversion.go rename to api/v1beta1/azuremanagedmachinepool_conversion.go index ec2c556c44f..9953b5e3a32 100644 --- a/exp/api/v1beta1/azuremanagedmachinepool_conversion.go +++ b/api/v1beta1/azuremanagedmachinepool_conversion.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Kubernetes Authors. +Copyright 2023 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. diff --git a/exp/api/v1beta1/azuremanagedmachinepool_types.go b/api/v1beta1/azuremanagedmachinepool_types.go similarity index 96% rename from exp/api/v1beta1/azuremanagedmachinepool_types.go rename to api/v1beta1/azuremanagedmachinepool_types.go index 5c09c0d0895..4edce49326f 100644 --- a/exp/api/v1beta1/azuremanagedmachinepool_types.go +++ b/api/v1beta1/azuremanagedmachinepool_types.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Kubernetes Authors. +Copyright 2023 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. @@ -18,8 +18,6 @@ package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" - "sigs.k8s.io/cluster-api-provider-azure/azure" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" capierrors "sigs.k8s.io/cluster-api/errors" ) @@ -35,7 +33,7 @@ const ( NodePoolModeUser NodePoolMode = "User" // DefaultOSType represents the default operating system for azmachinepool. - DefaultOSType string = azure.LinuxOS + DefaultOSType string = "Linux" ) // NodePoolMode enumerates the values for agent pool mode. @@ -126,7 +124,7 @@ type AzureManagedMachinePoolSpec struct { // AdditionalTags is an optional set of tags to add to Azure resources managed by the // Azure provider, in addition to the ones added by default. // +optional - AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` + AdditionalTags Tags `json:"additionalTags,omitempty"` // Name - name of the agent pool. If not specified, CAPZ uses the name of the CR as the agent pool name. // +optional @@ -259,7 +257,7 @@ type AzureManagedMachinePoolStatus struct { // LongRunningOperationStates saves the states for Azure long-running operations so they can be continued on the // next reconciliation loop. // +optional - LongRunningOperationStates infrav1.Futures `json:"longRunningOperationStates,omitempty"` + LongRunningOperationStates Futures `json:"longRunningOperationStates,omitempty"` } // +kubebuilder:object:root=true @@ -297,12 +295,12 @@ func (m *AzureManagedMachinePool) SetConditions(conditions clusterv1.Conditions) } // GetFutures returns the list of long running operation states for an AzureManagedMachinePool API object. -func (m *AzureManagedMachinePool) GetFutures() infrav1.Futures { +func (m *AzureManagedMachinePool) GetFutures() Futures { return m.Status.LongRunningOperationStates } // SetFutures will set the given long running operation states on an AzureManagedMachinePool object. -func (m *AzureManagedMachinePool) SetFutures(futures infrav1.Futures) { +func (m *AzureManagedMachinePool) SetFutures(futures Futures) { m.Status.LongRunningOperationStates = futures } diff --git a/exp/api/v1beta1/azuremanagedmachinepool_webhook.go b/api/v1beta1/azuremanagedmachinepool_webhook.go similarity index 94% rename from exp/api/v1beta1/azuremanagedmachinepool_webhook.go rename to api/v1beta1/azuremanagedmachinepool_webhook.go index 10f6a4b2dc8..ac8347c3280 100644 --- a/exp/api/v1beta1/azuremanagedmachinepool_webhook.go +++ b/api/v1beta1/azuremanagedmachinepool_webhook.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Kubernetes Authors. +Copyright 2023 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. @@ -29,12 +29,12 @@ import ( "k8s.io/apimachinery/pkg/runtime" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/validation/field" - "sigs.k8s.io/cluster-api-provider-azure/azure" "sigs.k8s.io/cluster-api-provider-azure/feature" azureutil "sigs.k8s.io/cluster-api-provider-azure/util/azure" "sigs.k8s.io/cluster-api-provider-azure/util/maps" webhookutils "sigs.k8s.io/cluster-api-provider-azure/util/webhook" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + capifeature "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -62,12 +62,12 @@ func (m *AzureManagedMachinePool) Default(client client.Client) { // ValidateCreate implements webhook.Validator so a webhook will be registered for the type. func (m *AzureManagedMachinePool) ValidateCreate(client client.Client) error { - // NOTE: AzureManagedMachinePool is behind AKS feature gate flag; the web hook - // must prevent creating new objects in case the feature flag is disabled. - if !feature.Gates.Enabled(feature.AKS) { + // NOTE: AzureManagedMachinePool relies upon MachinePools, which is behind a feature gate flag. + // The web hook must prevent creating new objects in case the feature flag is disabled. + if !feature.Gates.Enabled(capifeature.MachinePool) { return field.Forbidden( field.NewPath("spec"), - "can be set only if the AKS feature flag is enabled", + "can be set only if the Cluster API 'MachinePool' feature flag is enabled", ) } validators := []func() error{ @@ -132,14 +132,14 @@ func (m *AzureManagedMachinePool) ValidateUpdate(oldRaw runtime.Object, client c } // custom headers are immutable - oldCustomHeaders := maps.FilterByKeyPrefix(old.ObjectMeta.Annotations, azure.CustomHeaderPrefix) - newCustomHeaders := maps.FilterByKeyPrefix(m.ObjectMeta.Annotations, azure.CustomHeaderPrefix) + oldCustomHeaders := maps.FilterByKeyPrefix(old.ObjectMeta.Annotations, CustomHeaderPrefix) + newCustomHeaders := maps.FilterByKeyPrefix(m.ObjectMeta.Annotations, CustomHeaderPrefix) if !reflect.DeepEqual(oldCustomHeaders, newCustomHeaders) { allErrs = append(allErrs, field.Invalid( field.NewPath("metadata", "annotations"), m.ObjectMeta.Annotations, - fmt.Sprintf("annotations with '%s' prefix are immutable", azure.CustomHeaderPrefix))) + fmt.Sprintf("annotations with '%s' prefix are immutable", CustomHeaderPrefix))) } if !webhookutils.EnsureStringSlicesAreEquivalent(m.Spec.AvailabilityZones, old.Spec.AvailabilityZones) { @@ -286,7 +286,7 @@ func (m *AzureManagedMachinePool) validateMaxPods() error { func (m *AzureManagedMachinePool) validateOSType() error { if m.Spec.Mode == string(NodePoolModeSystem) { - if m.Spec.OSType != nil && *m.Spec.OSType != azure.LinuxOS { + if m.Spec.OSType != nil && *m.Spec.OSType != "Linux" { return field.Forbidden( field.NewPath("Spec", "OSType"), "System node pooll must have OSType 'Linux'") @@ -297,7 +297,7 @@ func (m *AzureManagedMachinePool) validateOSType() error { } func (m *AzureManagedMachinePool) validateName() error { - if m.Spec.OSType != nil && *m.Spec.OSType == azure.WindowsOS { + if m.Spec.OSType != nil && *m.Spec.OSType == "Windows" { if len(m.Name) > 6 { return field.Invalid( field.NewPath("Name"), diff --git a/exp/api/v1beta1/azuremanagedmachinepool_webhook_test.go b/api/v1beta1/azuremanagedmachinepool_webhook_test.go similarity index 97% rename from exp/api/v1beta1/azuremanagedmachinepool_webhook_test.go rename to api/v1beta1/azuremanagedmachinepool_webhook_test.go index d3f9e454b48..8f5582ee4a9 100644 --- a/exp/api/v1beta1/azuremanagedmachinepool_webhook_test.go +++ b/api/v1beta1/azuremanagedmachinepool_webhook_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Kubernetes Authors. +Copyright 2023 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. @@ -24,8 +24,8 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" utilfeature "k8s.io/component-base/featuregate/testing" - "sigs.k8s.io/cluster-api-provider-azure/azure" "sigs.k8s.io/cluster-api-provider-azure/feature" + capifeature "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -50,7 +50,7 @@ func TestAzureManagedMachinePoolDefaultingWebhook(t *testing.T) { g.Expect(ok).To(BeTrue()) g.Expect(val).To(Equal("System")) g.Expect(*ammp.Spec.Name).To(Equal("fooName")) - g.Expect(*ammp.Spec.OSType).To(Equal(azure.LinuxOS)) + g.Expect(*ammp.Spec.OSType).To(Equal("Linux")) t.Logf("Testing ammp defaulting webhook with empty string name specified in Spec") emptyName := "" @@ -533,7 +533,7 @@ func TestAzureManagedMachinePoolUpdatingWebhook(t *testing.T) { func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) { // NOTE: AzureManagedMachinePool is behind AKS feature gate flag; the web hook // must prevent creating new objects in case the feature flag is disabled. - defer utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.AKS, true)() + defer utilfeature.SetFeatureGateDuringTest(t, feature.Gates, capifeature.MachinePool, true)() tests := []struct { name string ammp *AzureManagedMachinePool @@ -587,7 +587,7 @@ func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) { ammp: &AzureManagedMachinePool{ Spec: AzureManagedMachinePoolSpec{ Mode: "System", - OSType: to.StringPtr(azure.WindowsOS), + OSType: to.StringPtr("Windows"), }, }, wantErr: true, @@ -598,7 +598,7 @@ func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) { ammp: &AzureManagedMachinePool{ Spec: AzureManagedMachinePoolSpec{ Mode: "User", - OSType: to.StringPtr(azure.WindowsOS), + OSType: to.StringPtr("Windows"), }, }, wantErr: false, @@ -611,7 +611,7 @@ func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) { }, Spec: AzureManagedMachinePoolSpec{ Mode: "User", - OSType: to.StringPtr(azure.WindowsOS), + OSType: to.StringPtr("Windows"), }, }, wantErr: false, @@ -624,7 +624,7 @@ func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) { }, Spec: AzureManagedMachinePoolSpec{ Mode: "User", - OSType: to.StringPtr(azure.WindowsOS), + OSType: to.StringPtr("Windows"), }, }, wantErr: true, @@ -635,7 +635,7 @@ func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) { ammp: &AzureManagedMachinePool{ Spec: AzureManagedMachinePoolSpec{ Mode: "User", - OSType: to.StringPtr(azure.LinuxOS), + OSType: to.StringPtr("Linux"), NodeLabels: map[string]string{ "foo": "bar", }, @@ -648,7 +648,7 @@ func TestAzureManagedMachinePool_ValidateCreate(t *testing.T) { ammp: &AzureManagedMachinePool{ Spec: AzureManagedMachinePoolSpec{ Mode: "User", - OSType: to.StringPtr(azure.LinuxOS), + OSType: to.StringPtr("Linux"), NodeLabels: map[string]string{ "kubernetes.azure.com/scalesetpriority": "spot", }, @@ -865,7 +865,7 @@ func TestAzureManagedMachinePool_ValidateCreateFailure(t *testing.T) { { name: "feature gate explicitly disabled", ammp: getKnownValidAzureManagedMachinePool(), - deferFunc: utilfeature.SetFeatureGateDuringTest(t, feature.Gates, feature.AKS, false), + deferFunc: utilfeature.SetFeatureGateDuringTest(t, feature.Gates, capifeature.MachinePool, false), }, { name: "feature gate implicitly disabled", diff --git a/api/v1beta1/conditions_consts.go b/api/v1beta1/consts.go similarity index 94% rename from api/v1beta1/conditions_consts.go rename to api/v1beta1/consts.go index 33ddcac0cb1..c49615084a8 100644 --- a/api/v1beta1/conditions_consts.go +++ b/api/v1beta1/consts.go @@ -142,3 +142,11 @@ const ( // UpdatingReason means the resource is being updated. UpdatingReason = "Updating" ) + +const ( + // CustomHeaderPrefix is the prefix of annotations that enable additional cluster / node pool features. + // Whatever follows the prefix will be passed as a header to cluster/node pool creation/update requests. + // E.g. add `"infrastructure.cluster.x-k8s.io/custom-header-UseGPUDedicatedVHD": "true"` annotation to + // AzureManagedMachinePool CR to enable creating GPU nodes by the node pool. + CustomHeaderPrefix = "infrastructure.cluster.x-k8s.io/custom-header-" +) diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index f5731fd91a9..4c946b0076f 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -29,6 +29,61 @@ import ( "sigs.k8s.io/cluster-api/errors" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AADProfile) DeepCopyInto(out *AADProfile) { + *out = *in + if in.AdminGroupObjectIDs != nil { + in, out := &in.AdminGroupObjectIDs, &out.AdminGroupObjectIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AADProfile. +func (in *AADProfile) DeepCopy() *AADProfile { + if in == nil { + return nil + } + out := new(AADProfile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APIServerAccessProfile) DeepCopyInto(out *APIServerAccessProfile) { + *out = *in + if in.AuthorizedIPRanges != nil { + in, out := &in.AuthorizedIPRanges, &out.AuthorizedIPRanges + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.EnablePrivateCluster != nil { + in, out := &in.EnablePrivateCluster, &out.EnablePrivateCluster + *out = new(bool) + **out = **in + } + if in.PrivateDNSZone != nil { + in, out := &in.PrivateDNSZone, &out.PrivateDNSZone + *out = new(string) + **out = **in + } + if in.EnablePrivateClusterPublicFQDN != nil { + in, out := &in.EnablePrivateClusterPublicFQDN, &out.EnablePrivateClusterPublicFQDN + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIServerAccessProfile. +func (in *APIServerAccessProfile) DeepCopy() *APIServerAccessProfile { + if in == nil { + return nil + } + out := new(APIServerAccessProfile) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AdditionalCapabilities) DeepCopyInto(out *AdditionalCapabilities) { *out = *in @@ -49,6 +104,28 @@ func (in *AdditionalCapabilities) DeepCopy() *AdditionalCapabilities { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AddonProfile) DeepCopyInto(out *AddonProfile) { + *out = *in + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddonProfile. +func (in *AddonProfile) DeepCopy() *AddonProfile { + if in == nil { + return nil + } + out := new(AddonProfile) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AddressRecord) DeepCopyInto(out *AddressRecord) { *out = *in @@ -64,6 +141,21 @@ func (in *AddressRecord) DeepCopy() *AddressRecord { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AksSKU) DeepCopyInto(out *AksSKU) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AksSKU. +func (in *AksSKU) DeepCopy() *AksSKU { + if in == nil { + return nil + } + out := new(AksSKU) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AllowedNamespaces) DeepCopyInto(out *AllowedNamespaces) { *out = *in @@ -89,6 +181,106 @@ func (in *AllowedNamespaces) DeepCopy() *AllowedNamespaces { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoScalerProfile) DeepCopyInto(out *AutoScalerProfile) { + *out = *in + if in.BalanceSimilarNodeGroups != nil { + in, out := &in.BalanceSimilarNodeGroups, &out.BalanceSimilarNodeGroups + *out = new(BalanceSimilarNodeGroups) + **out = **in + } + if in.Expander != nil { + in, out := &in.Expander, &out.Expander + *out = new(Expander) + **out = **in + } + if in.MaxEmptyBulkDelete != nil { + in, out := &in.MaxEmptyBulkDelete, &out.MaxEmptyBulkDelete + *out = new(string) + **out = **in + } + if in.MaxGracefulTerminationSec != nil { + in, out := &in.MaxGracefulTerminationSec, &out.MaxGracefulTerminationSec + *out = new(string) + **out = **in + } + if in.MaxNodeProvisionTime != nil { + in, out := &in.MaxNodeProvisionTime, &out.MaxNodeProvisionTime + *out = new(string) + **out = **in + } + if in.MaxTotalUnreadyPercentage != nil { + in, out := &in.MaxTotalUnreadyPercentage, &out.MaxTotalUnreadyPercentage + *out = new(string) + **out = **in + } + if in.NewPodScaleUpDelay != nil { + in, out := &in.NewPodScaleUpDelay, &out.NewPodScaleUpDelay + *out = new(string) + **out = **in + } + if in.OkTotalUnreadyCount != nil { + in, out := &in.OkTotalUnreadyCount, &out.OkTotalUnreadyCount + *out = new(string) + **out = **in + } + if in.ScanInterval != nil { + in, out := &in.ScanInterval, &out.ScanInterval + *out = new(string) + **out = **in + } + if in.ScaleDownDelayAfterAdd != nil { + in, out := &in.ScaleDownDelayAfterAdd, &out.ScaleDownDelayAfterAdd + *out = new(string) + **out = **in + } + if in.ScaleDownDelayAfterDelete != nil { + in, out := &in.ScaleDownDelayAfterDelete, &out.ScaleDownDelayAfterDelete + *out = new(string) + **out = **in + } + if in.ScaleDownDelayAfterFailure != nil { + in, out := &in.ScaleDownDelayAfterFailure, &out.ScaleDownDelayAfterFailure + *out = new(string) + **out = **in + } + if in.ScaleDownUnneededTime != nil { + in, out := &in.ScaleDownUnneededTime, &out.ScaleDownUnneededTime + *out = new(string) + **out = **in + } + if in.ScaleDownUnreadyTime != nil { + in, out := &in.ScaleDownUnreadyTime, &out.ScaleDownUnreadyTime + *out = new(string) + **out = **in + } + if in.ScaleDownUtilizationThreshold != nil { + in, out := &in.ScaleDownUtilizationThreshold, &out.ScaleDownUtilizationThreshold + *out = new(string) + **out = **in + } + if in.SkipNodesWithLocalStorage != nil { + in, out := &in.SkipNodesWithLocalStorage, &out.SkipNodesWithLocalStorage + *out = new(SkipNodesWithLocalStorage) + **out = **in + } + if in.SkipNodesWithSystemPods != nil { + in, out := &in.SkipNodesWithSystemPods, &out.SkipNodesWithSystemPods + *out = new(SkipNodesWithSystemPods) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoScalerProfile. +func (in *AutoScalerProfile) DeepCopy() *AutoScalerProfile { + if in == nil { + return nil + } + out := new(AutoScalerProfile) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AzureBastion) DeepCopyInto(out *AzureBastion) { *out = *in @@ -677,11 +869,359 @@ func (in *AzureMachineStatus) DeepCopyInto(out *AzureMachineStatus) { *out = new(errors.MachineStatusError) **out = **in } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in + if in.FailureMessage != nil { + in, out := &in.FailureMessage, &out.FailureMessage + *out = new(string) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(apiv1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.LongRunningOperationStates != nil { + in, out := &in.LongRunningOperationStates, &out.LongRunningOperationStates + *out = make(Futures, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineStatus. +func (in *AzureMachineStatus) DeepCopy() *AzureMachineStatus { + if in == nil { + return nil + } + out := new(AzureMachineStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureMachineTemplate) DeepCopyInto(out *AzureMachineTemplate) { + *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 AzureMachineTemplate. +func (in *AzureMachineTemplate) DeepCopy() *AzureMachineTemplate { + if in == nil { + return nil + } + out := new(AzureMachineTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureMachineTemplate) 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 *AzureMachineTemplateList) DeepCopyInto(out *AzureMachineTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureMachineTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineTemplateList. +func (in *AzureMachineTemplateList) DeepCopy() *AzureMachineTemplateList { + if in == nil { + return nil + } + out := new(AzureMachineTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureMachineTemplateList) 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 *AzureMachineTemplateResource) DeepCopyInto(out *AzureMachineTemplateResource) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineTemplateResource. +func (in *AzureMachineTemplateResource) DeepCopy() *AzureMachineTemplateResource { + if in == nil { + return nil + } + out := new(AzureMachineTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureMachineTemplateSpec) DeepCopyInto(out *AzureMachineTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineTemplateSpec. +func (in *AzureMachineTemplateSpec) DeepCopy() *AzureMachineTemplateSpec { + if in == nil { + return nil + } + out := new(AzureMachineTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedCluster) DeepCopyInto(out *AzureManagedCluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedCluster. +func (in *AzureManagedCluster) DeepCopy() *AzureManagedCluster { + if in == nil { + return nil + } + out := new(AzureManagedCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedCluster) 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 *AzureManagedClusterList) DeepCopyInto(out *AzureManagedClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterList. +func (in *AzureManagedClusterList) DeepCopy() *AzureManagedClusterList { + if in == nil { + return nil + } + out := new(AzureManagedClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedClusterList) 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 *AzureManagedClusterSpec) DeepCopyInto(out *AzureManagedClusterSpec) { + *out = *in + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterSpec. +func (in *AzureManagedClusterSpec) DeepCopy() *AzureManagedClusterSpec { + if in == nil { + return nil + } + out := new(AzureManagedClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedClusterStatus) DeepCopyInto(out *AzureManagedClusterStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterStatus. +func (in *AzureManagedClusterStatus) DeepCopy() *AzureManagedClusterStatus { + if in == nil { + return nil + } + out := new(AzureManagedClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedControlPlane) DeepCopyInto(out *AzureManagedControlPlane) { + *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 AzureManagedControlPlane. +func (in *AzureManagedControlPlane) DeepCopy() *AzureManagedControlPlane { + if in == nil { + return nil + } + out := new(AzureManagedControlPlane) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedControlPlane) 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 *AzureManagedControlPlaneList) DeepCopyInto(out *AzureManagedControlPlaneList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AzureManagedControlPlane, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneList. +func (in *AzureManagedControlPlaneList) DeepCopy() *AzureManagedControlPlaneList { + if in == nil { + return nil + } + out := new(AzureManagedControlPlaneList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AzureManagedControlPlaneList) 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 *AzureManagedControlPlaneSpec) DeepCopyInto(out *AzureManagedControlPlaneSpec) { + *out = *in + in.VirtualNetwork.DeepCopyInto(&out.VirtualNetwork) + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint + if in.AdditionalTags != nil { + in, out := &in.AdditionalTags, &out.AdditionalTags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.NetworkPlugin != nil { + in, out := &in.NetworkPlugin, &out.NetworkPlugin + *out = new(string) + **out = **in + } + if in.NetworkPolicy != nil { + in, out := &in.NetworkPolicy, &out.NetworkPolicy + *out = new(string) + **out = **in + } + if in.DNSServiceIP != nil { + in, out := &in.DNSServiceIP, &out.DNSServiceIP + *out = new(string) + **out = **in + } + if in.LoadBalancerSKU != nil { + in, out := &in.LoadBalancerSKU, &out.LoadBalancerSKU + *out = new(string) + **out = **in + } + if in.IdentityRef != nil { + in, out := &in.IdentityRef, &out.IdentityRef + *out = new(corev1.ObjectReference) + **out = **in + } + if in.AADProfile != nil { + in, out := &in.AADProfile, &out.AADProfile + *out = new(AADProfile) + (*in).DeepCopyInto(*out) + } + if in.AddonProfiles != nil { + in, out := &in.AddonProfiles, &out.AddonProfiles + *out = make([]AddonProfile, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SKU != nil { + in, out := &in.SKU, &out.SKU + *out = new(AksSKU) + **out = **in + } + if in.LoadBalancerProfile != nil { + in, out := &in.LoadBalancerProfile, &out.LoadBalancerProfile + *out = new(LoadBalancerProfile) + (*in).DeepCopyInto(*out) + } + if in.APIServerAccessProfile != nil { + in, out := &in.APIServerAccessProfile, &out.APIServerAccessProfile + *out = new(APIServerAccessProfile) + (*in).DeepCopyInto(*out) + } + if in.AutoScalerProfile != nil { + in, out := &in.AutoScalerProfile, &out.AutoScalerProfile + *out = new(AutoScalerProfile) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneSpec. +func (in *AzureManagedControlPlaneSpec) DeepCopy() *AzureManagedControlPlaneSpec { + if in == nil { + return nil } + out := new(AzureManagedControlPlaneSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureManagedControlPlaneStatus) DeepCopyInto(out *AzureManagedControlPlaneStatus) { + *out = *in if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make(apiv1beta1.Conditions, len(*in)) @@ -696,36 +1236,37 @@ func (in *AzureMachineStatus) DeepCopyInto(out *AzureMachineStatus) { } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineStatus. -func (in *AzureMachineStatus) DeepCopy() *AzureMachineStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneStatus. +func (in *AzureManagedControlPlaneStatus) DeepCopy() *AzureManagedControlPlaneStatus { if in == nil { return nil } - out := new(AzureMachineStatus) + out := new(AzureManagedControlPlaneStatus) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureMachineTemplate) DeepCopyInto(out *AzureMachineTemplate) { +func (in *AzureManagedMachinePool) DeepCopyInto(out *AzureManagedMachinePool) { *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 AzureMachineTemplate. -func (in *AzureMachineTemplate) DeepCopy() *AzureMachineTemplate { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePool. +func (in *AzureManagedMachinePool) DeepCopy() *AzureManagedMachinePool { if in == nil { return nil } - out := new(AzureMachineTemplate) + out := new(AzureManagedMachinePool) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureMachineTemplate) DeepCopyObject() runtime.Object { +func (in *AzureManagedMachinePool) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -733,31 +1274,31 @@ func (in *AzureMachineTemplate) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureMachineTemplateList) DeepCopyInto(out *AzureMachineTemplateList) { +func (in *AzureManagedMachinePoolList) DeepCopyInto(out *AzureManagedMachinePoolList) { *out = *in out.TypeMeta = in.TypeMeta in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]AzureMachineTemplate, len(*in)) + *out = make([]AzureManagedMachinePool, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineTemplateList. -func (in *AzureMachineTemplateList) DeepCopy() *AzureMachineTemplateList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolList. +func (in *AzureManagedMachinePoolList) DeepCopy() *AzureManagedMachinePoolList { if in == nil { return nil } - out := new(AzureMachineTemplateList) + out := new(AzureManagedMachinePoolList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureMachineTemplateList) DeepCopyObject() runtime.Object { +func (in *AzureManagedMachinePoolList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -765,34 +1306,142 @@ func (in *AzureMachineTemplateList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureMachineTemplateResource) DeepCopyInto(out *AzureMachineTemplateResource) { +func (in *AzureManagedMachinePoolSpec) DeepCopyInto(out *AzureManagedMachinePoolSpec) { *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) + if in.AdditionalTags != nil { + in, out := &in.AdditionalTags, &out.AdditionalTags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.OSDiskSizeGB != nil { + in, out := &in.OSDiskSizeGB, &out.OSDiskSizeGB + *out = new(int32) + **out = **in + } + if in.AvailabilityZones != nil { + in, out := &in.AvailabilityZones, &out.AvailabilityZones + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.NodeLabels != nil { + in, out := &in.NodeLabels, &out.NodeLabels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Taints != nil { + in, out := &in.Taints, &out.Taints + *out = make(Taints, len(*in)) + copy(*out, *in) + } + if in.ProviderIDList != nil { + in, out := &in.ProviderIDList, &out.ProviderIDList + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Scaling != nil { + in, out := &in.Scaling, &out.Scaling + *out = new(ManagedMachinePoolScaling) + (*in).DeepCopyInto(*out) + } + if in.MaxPods != nil { + in, out := &in.MaxPods, &out.MaxPods + *out = new(int32) + **out = **in + } + if in.OsDiskType != nil { + in, out := &in.OsDiskType, &out.OsDiskType + *out = new(string) + **out = **in + } + if in.EnableUltraSSD != nil { + in, out := &in.EnableUltraSSD, &out.EnableUltraSSD + *out = new(bool) + **out = **in + } + if in.OSType != nil { + in, out := &in.OSType, &out.OSType + *out = new(string) + **out = **in + } + if in.EnableNodePublicIP != nil { + in, out := &in.EnableNodePublicIP, &out.EnableNodePublicIP + *out = new(bool) + **out = **in + } + if in.NodePublicIPPrefixID != nil { + in, out := &in.NodePublicIPPrefixID, &out.NodePublicIPPrefixID + *out = new(string) + **out = **in + } + if in.ScaleSetPriority != nil { + in, out := &in.ScaleSetPriority, &out.ScaleSetPriority + *out = new(string) + **out = **in + } + if in.KubeletConfig != nil { + in, out := &in.KubeletConfig, &out.KubeletConfig + *out = new(KubeletConfig) + (*in).DeepCopyInto(*out) + } + if in.KubeletDiskType != nil { + in, out := &in.KubeletDiskType, &out.KubeletDiskType + *out = new(KubeletDiskType) + **out = **in + } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineTemplateResource. -func (in *AzureMachineTemplateResource) DeepCopy() *AzureMachineTemplateResource { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolSpec. +func (in *AzureManagedMachinePoolSpec) DeepCopy() *AzureManagedMachinePoolSpec { if in == nil { return nil } - out := new(AzureMachineTemplateResource) + out := new(AzureManagedMachinePoolSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureMachineTemplateSpec) DeepCopyInto(out *AzureMachineTemplateSpec) { +func (in *AzureManagedMachinePoolStatus) DeepCopyInto(out *AzureManagedMachinePoolStatus) { *out = *in - in.Template.DeepCopyInto(&out.Template) + if in.ErrorReason != nil { + in, out := &in.ErrorReason, &out.ErrorReason + *out = new(errors.MachineStatusError) + **out = **in + } + if in.ErrorMessage != nil { + in, out := &in.ErrorMessage, &out.ErrorMessage + *out = new(string) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(apiv1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.LongRunningOperationStates != nil { + in, out := &in.LongRunningOperationStates, &out.LongRunningOperationStates + *out = make(Futures, len(*in)) + copy(*out, *in) + } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineTemplateSpec. -func (in *AzureMachineTemplateSpec) DeepCopy() *AzureMachineTemplateSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolStatus. +func (in *AzureManagedMachinePoolStatus) DeepCopy() *AzureManagedMachinePoolStatus { if in == nil { return nil } - out := new(AzureMachineTemplateSpec) + out := new(AzureManagedMachinePoolStatus) in.DeepCopyInto(out) return out } @@ -1208,6 +1857,76 @@ func (in *ImagePlan) DeepCopy() *ImagePlan { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubeletConfig) DeepCopyInto(out *KubeletConfig) { + *out = *in + if in.CPUManagerPolicy != nil { + in, out := &in.CPUManagerPolicy, &out.CPUManagerPolicy + *out = new(CPUManagerPolicy) + **out = **in + } + if in.CPUCfsQuota != nil { + in, out := &in.CPUCfsQuota, &out.CPUCfsQuota + *out = new(bool) + **out = **in + } + if in.CPUCfsQuotaPeriod != nil { + in, out := &in.CPUCfsQuotaPeriod, &out.CPUCfsQuotaPeriod + *out = new(string) + **out = **in + } + if in.ImageGcHighThreshold != nil { + in, out := &in.ImageGcHighThreshold, &out.ImageGcHighThreshold + *out = new(int32) + **out = **in + } + if in.ImageGcLowThreshold != nil { + in, out := &in.ImageGcLowThreshold, &out.ImageGcLowThreshold + *out = new(int32) + **out = **in + } + if in.TopologyManagerPolicy != nil { + in, out := &in.TopologyManagerPolicy, &out.TopologyManagerPolicy + *out = new(TopologyManagerPolicy) + **out = **in + } + if in.AllowedUnsafeSysctls != nil { + in, out := &in.AllowedUnsafeSysctls, &out.AllowedUnsafeSysctls + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.FailSwapOn != nil { + in, out := &in.FailSwapOn, &out.FailSwapOn + *out = new(bool) + **out = **in + } + if in.ContainerLogMaxSizeMB != nil { + in, out := &in.ContainerLogMaxSizeMB, &out.ContainerLogMaxSizeMB + *out = new(int32) + **out = **in + } + if in.ContainerLogMaxFiles != nil { + in, out := &in.ContainerLogMaxFiles, &out.ContainerLogMaxFiles + *out = new(int32) + **out = **in + } + if in.PodMaxPids != nil { + in, out := &in.PodMaxPids, &out.PodMaxPids + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeletConfig. +func (in *KubeletConfig) DeepCopy() *KubeletConfig { + if in == nil { + return nil + } + out := new(KubeletConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LoadBalancerClassSpec) DeepCopyInto(out *LoadBalancerClassSpec) { *out = *in @@ -1228,6 +1947,46 @@ func (in *LoadBalancerClassSpec) DeepCopy() *LoadBalancerClassSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancerProfile) DeepCopyInto(out *LoadBalancerProfile) { + *out = *in + if in.ManagedOutboundIPs != nil { + in, out := &in.ManagedOutboundIPs, &out.ManagedOutboundIPs + *out = new(int32) + **out = **in + } + if in.OutboundIPPrefixes != nil { + in, out := &in.OutboundIPPrefixes, &out.OutboundIPPrefixes + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.OutboundIPs != nil { + in, out := &in.OutboundIPs, &out.OutboundIPs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AllocatedOutboundPorts != nil { + in, out := &in.AllocatedOutboundPorts, &out.AllocatedOutboundPorts + *out = new(int32) + **out = **in + } + if in.IdleTimeoutInMinutes != nil { + in, out := &in.IdleTimeoutInMinutes, &out.IdleTimeoutInMinutes + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerProfile. +func (in *LoadBalancerProfile) DeepCopy() *LoadBalancerProfile { + if in == nil { + return nil + } + out := new(LoadBalancerProfile) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LoadBalancerSpec) DeepCopyInto(out *LoadBalancerSpec) { *out = *in @@ -1257,6 +2016,44 @@ func (in *LoadBalancerSpec) DeepCopy() *LoadBalancerSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedControlPlaneSubnet) DeepCopyInto(out *ManagedControlPlaneSubnet) { + *out = *in + if in.ServiceEndpoints != nil { + in, out := &in.ServiceEndpoints, &out.ServiceEndpoints + *out = make(ServiceEndpoints, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedControlPlaneSubnet. +func (in *ManagedControlPlaneSubnet) DeepCopy() *ManagedControlPlaneSubnet { + if in == nil { + return nil + } + out := new(ManagedControlPlaneSubnet) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedControlPlaneVirtualNetwork) DeepCopyInto(out *ManagedControlPlaneVirtualNetwork) { + *out = *in + in.Subnet.DeepCopyInto(&out.Subnet) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedControlPlaneVirtualNetwork. +func (in *ManagedControlPlaneVirtualNetwork) DeepCopy() *ManagedControlPlaneVirtualNetwork { + if in == nil { + return nil + } + out := new(ManagedControlPlaneVirtualNetwork) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedDiskParameters) DeepCopyInto(out *ManagedDiskParameters) { *out = *in @@ -1277,6 +2074,31 @@ func (in *ManagedDiskParameters) DeepCopy() *ManagedDiskParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedMachinePoolScaling) DeepCopyInto(out *ManagedMachinePoolScaling) { + *out = *in + if in.MinSize != nil { + in, out := &in.MinSize, &out.MinSize + *out = new(int32) + **out = **in + } + if in.MaxSize != nil { + in, out := &in.MaxSize, &out.MaxSize + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedMachinePoolScaling. +func (in *ManagedMachinePoolScaling) DeepCopy() *ManagedMachinePoolScaling { + if in == nil { + return nil + } + out := new(ManagedMachinePoolScaling) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NatGateway) DeepCopyInto(out *NatGateway) { *out = *in @@ -1834,6 +2656,40 @@ func (in Tags) DeepCopy() Tags { return *out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Taint) DeepCopyInto(out *Taint) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Taint. +func (in *Taint) DeepCopy() *Taint { + if in == nil { + return nil + } + out := new(Taint) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Taints) DeepCopyInto(out *Taints) { + { + in := &in + *out = make(Taints, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Taints. +func (in Taints) DeepCopy() Taints { + if in == nil { + return nil + } + out := new(Taints) + in.DeepCopyInto(out) + return *out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UserAssignedIdentity) DeepCopyInto(out *UserAssignedIdentity) { *out = *in diff --git a/azure/scope/identity.go b/azure/scope/identity.go index 2baa87380f9..b43f5ff1b1e 100644 --- a/azure/scope/identity.go +++ b/azure/scope/identity.go @@ -35,7 +35,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-azure/util/identity" "sigs.k8s.io/cluster-api-provider-azure/util/system" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" @@ -68,7 +67,7 @@ type AzureClusterCredentialsProvider struct { // ManagedControlPlaneCredentialsProvider wraps AzureCredentialsProvider with AzureManagedControlPlane. type ManagedControlPlaneCredentialsProvider struct { AzureCredentialsProvider - AzureManagedControlPlane *infrav1exp.AzureManagedControlPlane + AzureManagedControlPlane *infrav1.AzureManagedControlPlane } var _ CredentialsProvider = (*AzureClusterCredentialsProvider)(nil) @@ -107,7 +106,7 @@ func (p *AzureClusterCredentialsProvider) GetAuthorizer(ctx context.Context, res } // NewManagedControlPlaneCredentialsProvider creates a new ManagedControlPlaneCredentialsProvider from the supplied inputs. -func NewManagedControlPlaneCredentialsProvider(ctx context.Context, kubeClient client.Client, managedControlPlane *infrav1exp.AzureManagedControlPlane) (*ManagedControlPlaneCredentialsProvider, error) { +func NewManagedControlPlaneCredentialsProvider(ctx context.Context, kubeClient client.Client, managedControlPlane *infrav1.AzureManagedControlPlane) (*ManagedControlPlaneCredentialsProvider, error) { if managedControlPlane.Spec.IdentityRef == nil { return nil, errors.New("failed to generate new ManagedControlPlaneCredentialsProvider from empty identityName") } diff --git a/azure/scope/managedcontrolplane.go b/azure/scope/managedcontrolplane.go index af8713dc4ed..32338454f97 100644 --- a/azure/scope/managedcontrolplane.go +++ b/azure/scope/managedcontrolplane.go @@ -34,7 +34,6 @@ import ( "sigs.k8s.io/cluster-api-provider-azure/azure/services/managedclusters" "sigs.k8s.io/cluster-api-provider-azure/azure/services/subnets" "sigs.k8s.io/cluster-api-provider-azure/azure/services/virtualnetworks" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-azure/util/futures" "sigs.k8s.io/cluster-api-provider-azure/util/maps" "sigs.k8s.io/cluster-api-provider-azure/util/tele" @@ -53,7 +52,7 @@ type ManagedControlPlaneScopeParams struct { AzureClients Client client.Client Cluster *clusterv1.Cluster - ControlPlane *infrav1exp.AzureManagedControlPlane + ControlPlane *infrav1.AzureManagedControlPlane ManagedMachinePools []ManagedMachinePool Cache *ManagedControlPlaneCache } @@ -116,7 +115,7 @@ type ManagedControlPlaneScope struct { AzureClients Cluster *clusterv1.Cluster - ControlPlane *infrav1exp.AzureManagedControlPlane + ControlPlane *infrav1.AzureManagedControlPlane ManagedMachinePools []ManagedMachinePool } @@ -426,7 +425,7 @@ func (s *ManagedControlPlaneScope) ManagedClusterSpec(ctx context.Context) azure NodeResourceGroup: s.ControlPlane.Spec.NodeResourceGroupName, Location: s.ControlPlane.Spec.Location, Tags: s.ControlPlane.Spec.AdditionalTags, - Headers: maps.FilterByKeyPrefix(s.ManagedClusterAnnotations(), azure.CustomHeaderPrefix), + Headers: maps.FilterByKeyPrefix(s.ManagedClusterAnnotations(), infrav1.CustomHeaderPrefix), Version: strings.TrimPrefix(s.ControlPlane.Spec.Version, "v"), SSHPublicKey: s.ControlPlane.Spec.SSHPublicKey, DNSServiceIP: s.ControlPlane.Spec.DNSServiceIP, @@ -541,7 +540,7 @@ func (s *ManagedControlPlaneScope) GetAllAgentPoolSpecs() ([]azure.ResourceSpecG } } - if pool.InfraMachinePool != nil && pool.InfraMachinePool.Spec.Mode == string(infrav1exp.NodePoolModeSystem) { + if pool.InfraMachinePool != nil && pool.InfraMachinePool.Spec.Mode == string(infrav1.NodePoolModeSystem) { foundSystemPool = true } @@ -573,7 +572,7 @@ func (s *ManagedControlPlaneScope) MakeEmptyKubeConfigSecret() corev1.Secret { Name: secret.Name(s.Cluster.Name, secret.Kubeconfig), Namespace: s.Cluster.Namespace, OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(s.ControlPlane, infrav1exp.GroupVersion.WithKind("AzureManagedControlPlane")), + *metav1.NewControllerRef(s.ControlPlane, infrav1.GroupVersion.WithKind("AzureManagedControlPlane")), }, }, } diff --git a/azure/scope/managedcontrolplane_test.go b/azure/scope/managedcontrolplane_test.go index e730cf517e6..98d100d35b7 100644 --- a/azure/scope/managedcontrolplane_test.go +++ b/azure/scope/managedcontrolplane_test.go @@ -25,10 +25,10 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" "sigs.k8s.io/cluster-api-provider-azure/azure" "sigs.k8s.io/cluster-api-provider-azure/azure/services/agentpools" "sigs.k8s.io/cluster-api-provider-azure/azure/services/managedclusters" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client/fake" @@ -37,7 +37,7 @@ import ( func TestManagedControlPlaneScope_PoolVersion(t *testing.T) { scheme := runtime.NewScheme() _ = expv1.AddToScheme(scheme) - _ = infrav1exp.AddToScheme(scheme) + _ = infrav1.AddToScheme(scheme) cases := []struct { Name string @@ -57,19 +57,19 @@ func TestManagedControlPlaneScope_PoolVersion(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ SubscriptionID: "00000000-0000-0000-0000-000000000000", }, }, ManagedMachinePools: []ManagedMachinePool{ { MachinePool: getMachinePool("pool0"), - InfraMachinePool: getAzureMachinePool("pool0", infrav1exp.NodePoolModeSystem), + InfraMachinePool: getAzureMachinePool("pool0", infrav1.NodePoolModeSystem), }, }, }, @@ -97,12 +97,12 @@ func TestManagedControlPlaneScope_PoolVersion(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ Version: "v1.22.0", SubscriptionID: "00000000-0000-0000-0000-000000000000", }, @@ -110,7 +110,7 @@ func TestManagedControlPlaneScope_PoolVersion(t *testing.T) { ManagedMachinePools: []ManagedMachinePool{ { MachinePool: getMachinePoolWithVersion("pool0", "v1.21.1"), - InfraMachinePool: getAzureMachinePool("pool0", infrav1exp.NodePoolModeSystem), + InfraMachinePool: getAzureMachinePool("pool0", infrav1.NodePoolModeSystem), }, }, }, @@ -139,12 +139,12 @@ func TestManagedControlPlaneScope_PoolVersion(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ Version: "v1.20.1", SubscriptionID: "00000000-0000-0000-0000-000000000000", }, @@ -152,7 +152,7 @@ func TestManagedControlPlaneScope_PoolVersion(t *testing.T) { ManagedMachinePools: []ManagedMachinePool{ { MachinePool: getMachinePoolWithVersion("pool0", "v1.21.1"), - InfraMachinePool: getAzureMachinePool("pool0", infrav1exp.NodePoolModeSystem), + InfraMachinePool: getAzureMachinePool("pool0", infrav1.NodePoolModeSystem), }, }, }, @@ -181,7 +181,7 @@ func TestManagedControlPlaneScope_PoolVersion(t *testing.T) { func TestManagedControlPlaneScope_AddonProfiles(t *testing.T) { scheme := runtime.NewScheme() _ = expv1.AddToScheme(scheme) - _ = infrav1exp.AddToScheme(scheme) + _ = infrav1.AddToScheme(scheme) cases := []struct { Name string @@ -200,19 +200,19 @@ func TestManagedControlPlaneScope_AddonProfiles(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ SubscriptionID: "00000000-0000-0000-0000-000000000000", }, }, ManagedMachinePools: []ManagedMachinePool{ { MachinePool: getMachinePool("pool0"), - InfraMachinePool: getAzureMachinePool("pool0", infrav1exp.NodePoolModeSystem), + InfraMachinePool: getAzureMachinePool("pool0", infrav1.NodePoolModeSystem), }, }, }, @@ -230,14 +230,14 @@ func TestManagedControlPlaneScope_AddonProfiles(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ SubscriptionID: "00000000-0000-0000-0000-000000000000", - AddonProfiles: []infrav1exp.AddonProfile{ + AddonProfiles: []infrav1.AddonProfile{ {Name: "addon1", Config: nil, Enabled: false}, {Name: "addon2", Config: map[string]string{"k1": "v1", "k2": "v2"}, Enabled: true}, }, @@ -246,7 +246,7 @@ func TestManagedControlPlaneScope_AddonProfiles(t *testing.T) { ManagedMachinePools: []ManagedMachinePool{ { MachinePool: getMachinePool("pool0"), - InfraMachinePool: getAzureMachinePool("pool0", infrav1exp.NodePoolModeSystem), + InfraMachinePool: getAzureMachinePool("pool0", infrav1.NodePoolModeSystem), }, }, }, @@ -274,7 +274,7 @@ func TestManagedControlPlaneScope_AddonProfiles(t *testing.T) { func TestManagedControlPlaneScope_OSType(t *testing.T) { scheme := runtime.NewScheme() _ = expv1.AddToScheme(scheme) - _ = infrav1exp.AddToScheme(scheme) + _ = infrav1.AddToScheme(scheme) cases := []struct { Name string @@ -294,12 +294,12 @@ func TestManagedControlPlaneScope_OSType(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ Version: "v1.20.1", SubscriptionID: "00000000-0000-0000-0000-000000000000", }, @@ -307,7 +307,7 @@ func TestManagedControlPlaneScope_OSType(t *testing.T) { ManagedMachinePools: []ManagedMachinePool{ { MachinePool: getMachinePool("pool0"), - InfraMachinePool: getAzureMachinePool("pool0", infrav1exp.NodePoolModeSystem), + InfraMachinePool: getAzureMachinePool("pool0", infrav1.NodePoolModeSystem), }, { MachinePool: getMachinePool("pool1"), @@ -363,12 +363,12 @@ func TestManagedControlPlaneScope_OSType(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ Version: "v1.20.1", SubscriptionID: "00000000-0000-0000-0000-000000000000", }, @@ -409,7 +409,7 @@ func TestManagedControlPlaneScope_OSType(t *testing.T) { func TestManagedControlPlaneScope_IsVnetManagedCache(t *testing.T) { scheme := runtime.NewScheme() _ = expv1.AddToScheme(scheme) - _ = infrav1exp.AddToScheme(scheme) + _ = infrav1.AddToScheme(scheme) cases := []struct { Name string @@ -428,12 +428,12 @@ func TestManagedControlPlaneScope_IsVnetManagedCache(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ Version: "v1.20.1", SubscriptionID: "00000000-0000-0000-0000-000000000000", }, @@ -441,7 +441,7 @@ func TestManagedControlPlaneScope_IsVnetManagedCache(t *testing.T) { ManagedMachinePools: []ManagedMachinePool{ { MachinePool: getMachinePool("pool0"), - InfraMachinePool: getAzureMachinePool("pool0", infrav1exp.NodePoolModeSystem), + InfraMachinePool: getAzureMachinePool("pool0", infrav1.NodePoolModeSystem), }, { MachinePool: getMachinePool("pool1"), @@ -463,12 +463,12 @@ func TestManagedControlPlaneScope_IsVnetManagedCache(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ Version: "v1.20.1", SubscriptionID: "00000000-0000-0000-0000-000000000000", }, @@ -476,7 +476,7 @@ func TestManagedControlPlaneScope_IsVnetManagedCache(t *testing.T) { ManagedMachinePools: []ManagedMachinePool{ { MachinePool: getMachinePool("pool0"), - InfraMachinePool: getAzureMachinePool("pool0", infrav1exp.NodePoolModeSystem), + InfraMachinePool: getAzureMachinePool("pool0", infrav1.NodePoolModeSystem), }, { MachinePool: getMachinePool("pool1"), @@ -501,12 +501,12 @@ func TestManagedControlPlaneScope_IsVnetManagedCache(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ Version: "v1.20.1", SubscriptionID: "00000000-0000-0000-0000-000000000000", }, @@ -514,7 +514,7 @@ func TestManagedControlPlaneScope_IsVnetManagedCache(t *testing.T) { ManagedMachinePools: []ManagedMachinePool{ { MachinePool: getMachinePool("pool0"), - InfraMachinePool: getAzureMachinePool("pool0", infrav1exp.NodePoolModeSystem), + InfraMachinePool: getAzureMachinePool("pool0", infrav1.NodePoolModeSystem), }, { MachinePool: getMachinePool("pool1"), diff --git a/azure/scope/managedmachinepool.go b/azure/scope/managedmachinepool.go index a6a32e9b976..2fa5b39aa2c 100644 --- a/azure/scope/managedmachinepool.go +++ b/azure/scope/managedmachinepool.go @@ -26,7 +26,6 @@ import ( infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" "sigs.k8s.io/cluster-api-provider-azure/azure" "sigs.k8s.io/cluster-api-provider-azure/azure/services/agentpools" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-azure/util/futures" "sigs.k8s.io/cluster-api-provider-azure/util/maps" "sigs.k8s.io/cluster-api-provider-azure/util/tele" @@ -43,13 +42,13 @@ type ManagedMachinePoolScopeParams struct { ManagedMachinePool Client client.Client Cluster *clusterv1.Cluster - ControlPlane *infrav1exp.AzureManagedControlPlane + ControlPlane *infrav1.AzureManagedControlPlane ManagedControlPlaneScope azure.ManagedClusterScoper } // ManagedMachinePool defines the scope interface for a managed machine pool. type ManagedMachinePool struct { - InfraMachinePool *infrav1exp.AzureManagedMachinePool + InfraMachinePool *infrav1.AzureManagedMachinePool MachinePool *expv1.MachinePool } @@ -98,8 +97,8 @@ type ManagedMachinePoolScope struct { azure.ManagedClusterScoper Cluster *clusterv1.Cluster MachinePool *expv1.MachinePool - ControlPlane *infrav1exp.AzureManagedControlPlane - InfraMachinePool *infrav1exp.AzureManagedMachinePool + ControlPlane *infrav1.AzureManagedControlPlane + InfraMachinePool *infrav1.AzureManagedMachinePool } // PatchObject persists the cluster configuration and status. @@ -140,9 +139,9 @@ func (s *ManagedMachinePoolScope) AgentPoolSpec() azure.ResourceSpecGetter { return buildAgentPoolSpec(s.ControlPlane, s.MachinePool, s.InfraMachinePool, s.AgentPoolAnnotations()) } -func buildAgentPoolSpec(managedControlPlane *infrav1exp.AzureManagedControlPlane, +func buildAgentPoolSpec(managedControlPlane *infrav1.AzureManagedControlPlane, machinePool *expv1.MachinePool, - managedMachinePool *infrav1exp.AzureManagedMachinePool, + managedMachinePool *infrav1.AzureManagedMachinePool, agentPoolAnnotations map[string]string) azure.ResourceSpecGetter { var normalizedVersion *string if machinePool.Spec.Template.Spec.Version != nil { @@ -174,7 +173,7 @@ func buildAgentPoolSpec(managedControlPlane *infrav1exp.AzureManagedControlPlane AvailabilityZones: managedMachinePool.Spec.AvailabilityZones, OsDiskType: managedMachinePool.Spec.OsDiskType, EnableUltraSSD: managedMachinePool.Spec.EnableUltraSSD, - Headers: maps.FilterByKeyPrefix(agentPoolAnnotations, azure.CustomHeaderPrefix), + Headers: maps.FilterByKeyPrefix(agentPoolAnnotations, infrav1.CustomHeaderPrefix), EnableNodePublicIP: managedMachinePool.Spec.EnableNodePublicIP, NodePublicIPPrefixID: managedMachinePool.Spec.NodePublicIPPrefixID, ScaleSetPriority: managedMachinePool.Spec.ScaleSetPriority, diff --git a/azure/scope/managedmachinepool_test.go b/azure/scope/managedmachinepool_test.go index d9b9761bdb1..c30dd51d7b6 100644 --- a/azure/scope/managedmachinepool_test.go +++ b/azure/scope/managedmachinepool_test.go @@ -30,7 +30,6 @@ import ( infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" "sigs.k8s.io/cluster-api-provider-azure/azure" "sigs.k8s.io/cluster-api-provider-azure/azure/services/agentpools" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client/fake" @@ -39,7 +38,7 @@ import ( func TestManagedMachinePoolScope_Autoscaling(t *testing.T) { scheme := runtime.NewScheme() _ = expv1.AddToScheme(scheme) - _ = infrav1exp.AddToScheme(scheme) + _ = infrav1.AddToScheme(scheme) cases := []struct { Name string @@ -55,18 +54,18 @@ func TestManagedMachinePoolScope_Autoscaling(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ SubscriptionID: "00000000-0000-0000-0000-000000000000", }, }, ManagedMachinePool: ManagedMachinePool{ MachinePool: getMachinePool("pool0"), - InfraMachinePool: getAzureMachinePool("pool0", infrav1exp.NodePoolModeSystem), + InfraMachinePool: getAzureMachinePool("pool0", infrav1.NodePoolModeSystem), }, }, Expected: &agentpools.AgentPoolSpec{ @@ -89,12 +88,12 @@ func TestManagedMachinePoolScope_Autoscaling(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ SubscriptionID: "00000000-0000-0000-0000-000000000000", }, }, @@ -137,7 +136,7 @@ func TestManagedMachinePoolScope_Autoscaling(t *testing.T) { func TestManagedMachinePoolScope_NodeLabels(t *testing.T) { scheme := runtime.NewScheme() _ = expv1.AddToScheme(scheme) - _ = infrav1exp.AddToScheme(scheme) + _ = infrav1.AddToScheme(scheme) cases := []struct { Name string @@ -153,18 +152,18 @@ func TestManagedMachinePoolScope_NodeLabels(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ SubscriptionID: "00000000-0000-0000-0000-000000000000", }, }, ManagedMachinePool: ManagedMachinePool{ MachinePool: getMachinePool("pool0"), - InfraMachinePool: getAzureMachinePool("pool0", infrav1exp.NodePoolModeSystem), + InfraMachinePool: getAzureMachinePool("pool0", infrav1.NodePoolModeSystem), }, }, Expected: &agentpools.AgentPoolSpec{ @@ -186,12 +185,12 @@ func TestManagedMachinePoolScope_NodeLabels(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ SubscriptionID: "00000000-0000-0000-0000-000000000000", }, }, @@ -236,7 +235,7 @@ func TestManagedMachinePoolScope_NodeLabels(t *testing.T) { func TestManagedMachinePoolScope_AdditionalTags(t *testing.T) { scheme := runtime.NewScheme() _ = expv1.AddToScheme(scheme) - _ = infrav1exp.AddToScheme(scheme) + _ = infrav1.AddToScheme(scheme) cases := []struct { Name string @@ -252,18 +251,18 @@ func TestManagedMachinePoolScope_AdditionalTags(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ SubscriptionID: "00000000-0000-0000-0000-000000000000", }, }, ManagedMachinePool: ManagedMachinePool{ MachinePool: getMachinePool("pool0"), - InfraMachinePool: getAzureMachinePool("pool0", infrav1exp.NodePoolModeSystem), + InfraMachinePool: getAzureMachinePool("pool0", infrav1.NodePoolModeSystem), }, }, Expected: &agentpools.AgentPoolSpec{ @@ -285,12 +284,12 @@ func TestManagedMachinePoolScope_AdditionalTags(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ SubscriptionID: "00000000-0000-0000-0000-000000000000", }, }, @@ -335,7 +334,7 @@ func TestManagedMachinePoolScope_AdditionalTags(t *testing.T) { func TestManagedMachinePoolScope_MaxPods(t *testing.T) { scheme := runtime.NewScheme() _ = expv1.AddToScheme(scheme) - _ = infrav1exp.AddToScheme(scheme) + _ = infrav1.AddToScheme(scheme) cases := []struct { Name string @@ -351,18 +350,18 @@ func TestManagedMachinePoolScope_MaxPods(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ SubscriptionID: "00000000-0000-0000-0000-000000000000", }, }, ManagedMachinePool: ManagedMachinePool{ MachinePool: getMachinePool("pool0"), - InfraMachinePool: getAzureMachinePool("pool0", infrav1exp.NodePoolModeSystem), + InfraMachinePool: getAzureMachinePool("pool0", infrav1.NodePoolModeSystem), }, }, Expected: &agentpools.AgentPoolSpec{ @@ -384,12 +383,12 @@ func TestManagedMachinePoolScope_MaxPods(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ SubscriptionID: "00000000-0000-0000-0000-000000000000", }, }, @@ -430,7 +429,7 @@ func TestManagedMachinePoolScope_MaxPods(t *testing.T) { func TestManagedMachinePoolScope_Taints(t *testing.T) { scheme := runtime.NewScheme() _ = expv1.AddToScheme(scheme) - _ = infrav1exp.AddToScheme(scheme) + _ = infrav1.AddToScheme(scheme) cases := []struct { Name string @@ -446,18 +445,18 @@ func TestManagedMachinePoolScope_Taints(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ SubscriptionID: "00000000-0000-0000-0000-000000000000", }, }, ManagedMachinePool: ManagedMachinePool{ MachinePool: getMachinePool("pool0"), - InfraMachinePool: getAzureMachinePool("pool0", infrav1exp.NodePoolModeSystem), + InfraMachinePool: getAzureMachinePool("pool0", infrav1.NodePoolModeSystem), }, }, Expected: &agentpools.AgentPoolSpec{ @@ -480,19 +479,19 @@ func TestManagedMachinePoolScope_Taints(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ SubscriptionID: "00000000-0000-0000-0000-000000000000", }, }, ManagedMachinePool: ManagedMachinePool{ MachinePool: getMachinePool("pool1"), - InfraMachinePool: getAzureMachinePoolWithTaints("pool1", infrav1exp.Taints{ - infrav1exp.Taint{ + InfraMachinePool: getAzureMachinePoolWithTaints("pool1", infrav1.Taints{ + infrav1.Taint{ Key: "key1", Value: "value1", Effect: "NoSchedule", @@ -532,7 +531,7 @@ func TestManagedMachinePoolScope_Taints(t *testing.T) { func TestManagedMachinePoolScope_OSDiskType(t *testing.T) { scheme := runtime.NewScheme() _ = expv1.AddToScheme(scheme) - _ = infrav1exp.AddToScheme(scheme) + _ = infrav1.AddToScheme(scheme) cases := []struct { Name string @@ -548,18 +547,18 @@ func TestManagedMachinePoolScope_OSDiskType(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ SubscriptionID: "00000000-0000-0000-0000-000000000000", }, }, ManagedMachinePool: ManagedMachinePool{ MachinePool: getMachinePool("pool0"), - InfraMachinePool: getAzureMachinePool("pool0", infrav1exp.NodePoolModeSystem), + InfraMachinePool: getAzureMachinePool("pool0", infrav1.NodePoolModeSystem), }, }, Expected: &agentpools.AgentPoolSpec{ @@ -581,12 +580,12 @@ func TestManagedMachinePoolScope_OSDiskType(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ SubscriptionID: "00000000-0000-0000-0000-000000000000", }, }, @@ -627,7 +626,7 @@ func TestManagedMachinePoolScope_OSDiskType(t *testing.T) { func TestManagedMachinePoolScope_KubeletDiskType(t *testing.T) { scheme := runtime.NewScheme() _ = expv1.AddToScheme(scheme) - _ = infrav1exp.AddToScheme(scheme) + _ = infrav1.AddToScheme(scheme) cases := []struct { Name string @@ -643,18 +642,18 @@ func TestManagedMachinePoolScope_KubeletDiskType(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ SubscriptionID: "00000000-0000-0000-0000-000000000000", }, }, ManagedMachinePool: ManagedMachinePool{ MachinePool: getMachinePool("pool0"), - InfraMachinePool: getAzureMachinePool("pool0", infrav1exp.NodePoolModeSystem), + InfraMachinePool: getAzureMachinePool("pool0", infrav1.NodePoolModeSystem), }, }, Expected: &agentpools.AgentPoolSpec{ @@ -676,18 +675,18 @@ func TestManagedMachinePoolScope_KubeletDiskType(t *testing.T) { Namespace: "default", }, }, - ControlPlane: &infrav1exp.AzureManagedControlPlane{ + ControlPlane: &infrav1.AzureManagedControlPlane{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster1", Namespace: "default", }, - Spec: infrav1exp.AzureManagedControlPlaneSpec{ + Spec: infrav1.AzureManagedControlPlaneSpec{ SubscriptionID: "00000000-0000-0000-0000-000000000000", }, }, ManagedMachinePool: ManagedMachinePool{ MachinePool: getMachinePool("pool1"), - InfraMachinePool: getAzureMachinePoolWithKubeletDiskType("pool1", (*infrav1exp.KubeletDiskType)(to.StringPtr("Temporary"))), + InfraMachinePool: getAzureMachinePoolWithKubeletDiskType("pool1", (*infrav1.KubeletDiskType)(to.StringPtr("Temporary"))), }, }, Expected: &agentpools.AgentPoolSpec{ @@ -696,7 +695,7 @@ func TestManagedMachinePoolScope_KubeletDiskType(t *testing.T) { Mode: "User", Cluster: "cluster1", Replicas: 1, - KubeletDiskType: (*infrav1exp.KubeletDiskType)(to.StringPtr("Temporary")), + KubeletDiskType: (*infrav1.KubeletDiskType)(to.StringPtr("Temporary")), VnetSubnetID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups//providers/Microsoft.Network/virtualNetworks//subnets/", Headers: map[string]string{}, }, @@ -719,8 +718,8 @@ func TestManagedMachinePoolScope_KubeletDiskType(t *testing.T) { } } -func getAzureMachinePool(name string, mode infrav1exp.NodePoolMode) *infrav1exp.AzureManagedMachinePool { - return &infrav1exp.AzureManagedMachinePool{ +func getAzureMachinePool(name string, mode infrav1.NodePoolMode) *infrav1.AzureManagedMachinePool { + return &infrav1.AzureManagedMachinePool{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: "default", @@ -735,7 +734,7 @@ func getAzureMachinePool(name string, mode infrav1exp.NodePoolMode) *infrav1exp. }, }, }, - Spec: infrav1exp.AzureManagedMachinePoolSpec{ + Spec: infrav1.AzureManagedMachinePoolSpec{ Mode: string(mode), SKU: "Standard_D2s_v3", Name: to.StringPtr(name), @@ -743,47 +742,47 @@ func getAzureMachinePool(name string, mode infrav1exp.NodePoolMode) *infrav1exp. } } -func getAzureMachinePoolWithScaling(name string, min, max int32) *infrav1exp.AzureManagedMachinePool { - managedPool := getAzureMachinePool(name, infrav1exp.NodePoolModeUser) - managedPool.Spec.Scaling = &infrav1exp.ManagedMachinePoolScaling{ +func getAzureMachinePoolWithScaling(name string, min, max int32) *infrav1.AzureManagedMachinePool { + managedPool := getAzureMachinePool(name, infrav1.NodePoolModeUser) + managedPool.Spec.Scaling = &infrav1.ManagedMachinePoolScaling{ MinSize: to.Int32Ptr(min), MaxSize: to.Int32Ptr(max), } return managedPool } -func getAzureMachinePoolWithMaxPods(name string, maxPods int32) *infrav1exp.AzureManagedMachinePool { - managedPool := getAzureMachinePool(name, infrav1exp.NodePoolModeSystem) +func getAzureMachinePoolWithMaxPods(name string, maxPods int32) *infrav1.AzureManagedMachinePool { + managedPool := getAzureMachinePool(name, infrav1.NodePoolModeSystem) managedPool.Spec.MaxPods = to.Int32Ptr(maxPods) return managedPool } -func getAzureMachinePoolWithTaints(name string, taints infrav1exp.Taints) *infrav1exp.AzureManagedMachinePool { - managedPool := getAzureMachinePool(name, infrav1exp.NodePoolModeUser) +func getAzureMachinePoolWithTaints(name string, taints infrav1.Taints) *infrav1.AzureManagedMachinePool { + managedPool := getAzureMachinePool(name, infrav1.NodePoolModeUser) managedPool.Spec.Taints = taints return managedPool } -func getAzureMachinePoolWithOsDiskType(name string, osDiskType string) *infrav1exp.AzureManagedMachinePool { - managedPool := getAzureMachinePool(name, infrav1exp.NodePoolModeUser) +func getAzureMachinePoolWithOsDiskType(name string, osDiskType string) *infrav1.AzureManagedMachinePool { + managedPool := getAzureMachinePool(name, infrav1.NodePoolModeUser) managedPool.Spec.OsDiskType = to.StringPtr(osDiskType) return managedPool } -func getAzureMachinePoolWithKubeletDiskType(name string, kubeletDiskType *infrav1exp.KubeletDiskType) *infrav1exp.AzureManagedMachinePool { - managedPool := getAzureMachinePool(name, infrav1exp.NodePoolModeUser) +func getAzureMachinePoolWithKubeletDiskType(name string, kubeletDiskType *infrav1.KubeletDiskType) *infrav1.AzureManagedMachinePool { + managedPool := getAzureMachinePool(name, infrav1.NodePoolModeUser) managedPool.Spec.KubeletDiskType = kubeletDiskType return managedPool } -func getAzureMachinePoolWithLabels(name string, nodeLabels map[string]string) *infrav1exp.AzureManagedMachinePool { - managedPool := getAzureMachinePool(name, infrav1exp.NodePoolModeSystem) +func getAzureMachinePoolWithLabels(name string, nodeLabels map[string]string) *infrav1.AzureManagedMachinePool { + managedPool := getAzureMachinePool(name, infrav1.NodePoolModeSystem) managedPool.Spec.NodeLabels = nodeLabels return managedPool } -func getAzureMachinePoolWithAdditionalTags(name string, additionalTags infrav1.Tags) *infrav1exp.AzureManagedMachinePool { - managedPool := getAzureMachinePool(name, infrav1exp.NodePoolModeSystem) +func getAzureMachinePoolWithAdditionalTags(name string, additionalTags infrav1.Tags) *infrav1.AzureManagedMachinePool { + managedPool := getAzureMachinePool(name, infrav1.NodePoolModeSystem) managedPool.Spec.AdditionalTags = additionalTags return managedPool } @@ -803,14 +802,14 @@ func getMachinePool(name string) *expv1.MachinePool { } } -func getLinuxAzureMachinePool(name string) *infrav1exp.AzureManagedMachinePool { - managedPool := getAzureMachinePool(name, infrav1exp.NodePoolModeUser) +func getLinuxAzureMachinePool(name string) *infrav1.AzureManagedMachinePool { + managedPool := getAzureMachinePool(name, infrav1.NodePoolModeUser) managedPool.Spec.OSType = to.StringPtr(azure.LinuxOS) return managedPool } -func getWindowsAzureMachinePool(name string) *infrav1exp.AzureManagedMachinePool { - managedPool := getAzureMachinePool(name, infrav1exp.NodePoolModeUser) +func getWindowsAzureMachinePool(name string) *infrav1.AzureManagedMachinePool { + managedPool := getAzureMachinePool(name, infrav1.NodePoolModeUser) managedPool.Spec.OSType = to.StringPtr(azure.WindowsOS) return managedPool } diff --git a/azure/services/agentpools/agentpools_test.go b/azure/services/agentpools/agentpools_test.go index 67a9a79cfd4..5cbd2804670 100644 --- a/azure/services/agentpools/agentpools_test.go +++ b/azure/services/agentpools/agentpools_test.go @@ -28,7 +28,6 @@ import ( infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" "sigs.k8s.io/cluster-api-provider-azure/azure/services/agentpools/mock_agentpools" "sigs.k8s.io/cluster-api-provider-azure/azure/services/async/mock_async" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" gomockinternal "sigs.k8s.io/cluster-api-provider-azure/internal/test/matchers/gomock" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) @@ -55,7 +54,7 @@ var ( EnableUltraSSD: to.BoolPtr(true), OSType: to.StringPtr("fake-os-type"), Headers: map[string]string{"fake-header": "fake-value"}, - KubeletDiskType: (*infrav1exp.KubeletDiskType)(to.StringPtr("fake-kubelet-disk-type")), + KubeletDiskType: (*infrav1.KubeletDiskType)(to.StringPtr("fake-kubelet-disk-type")), } internalError = autorest.NewErrorWithResponse("", "", &http.Response{StatusCode: http.StatusInternalServerError}, "Internal Server Error") diff --git a/azure/services/agentpools/spec.go b/azure/services/agentpools/spec.go index d29572ff981..3181e811254 100644 --- a/azure/services/agentpools/spec.go +++ b/azure/services/agentpools/spec.go @@ -28,7 +28,6 @@ import ( infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" "sigs.k8s.io/cluster-api-provider-azure/azure" "sigs.k8s.io/cluster-api-provider-azure/azure/converters" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" azureutil "sigs.k8s.io/cluster-api-provider-azure/util/azure" ) @@ -133,7 +132,7 @@ type AgentPoolSpec struct { KubeletConfig *KubeletConfig `json:"kubeletConfig,omitempty"` // KubeletDiskType specifies the kubelet disk type for each node in the pool. Allowed values are 'OS' and 'Temporary' - KubeletDiskType *infrav1exp.KubeletDiskType `json:"kubeletDiskType,omitempty"` + KubeletDiskType *infrav1.KubeletDiskType `json:"kubeletDiskType,omitempty"` // AdditionalTags is an optional set of tags to add to Azure resources managed by the Azure provider, in addition to the ones added by default. AdditionalTags infrav1.Tags diff --git a/azure/services/managedclusters/spec_test.go b/azure/services/managedclusters/spec_test.go index efbe9dbb3f2..ed3a2d0588a 100644 --- a/azure/services/managedclusters/spec_test.go +++ b/azure/services/managedclusters/spec_test.go @@ -24,9 +24,9 @@ import ( "github.com/Azure/go-autorest/autorest/to" "github.com/google/go-cmp/cmp" . "github.com/onsi/gomega" + infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" "sigs.k8s.io/cluster-api-provider-azure/azure" "sigs.k8s.io/cluster-api-provider-azure/azure/services/agentpools" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" gomockinternal "sigs.k8s.io/cluster-api-provider-azure/internal/test/matchers/gomock" ) @@ -70,7 +70,7 @@ func TestParameters(t *testing.T) { return []azure.ResourceSpecGetter{ &agentpools.AgentPoolSpec{ Name: "test-agentpool-0", - Mode: string(infrav1exp.NodePoolModeSystem), + Mode: string(infrav1.NodePoolModeSystem), ResourceGroup: "test-rg", Replicas: int32(2), AdditionalTags: map[string]string{ @@ -79,7 +79,7 @@ func TestParameters(t *testing.T) { }, &agentpools.AgentPoolSpec{ Name: "test-agentpool-1", - Mode: string(infrav1exp.NodePoolModeUser), + Mode: string(infrav1.NodePoolModeUser), ResourceGroup: "test-rg", Replicas: int32(4), Cluster: "test-managedcluster", @@ -182,7 +182,7 @@ func getSampleManagedCluster() containerservice.ManagedCluster { AgentPoolProfiles: &[]containerservice.ManagedClusterAgentPoolProfile{ { Name: to.StringPtr("test-agentpool-0"), - Mode: containerservice.AgentPoolMode(infrav1exp.NodePoolModeSystem), + Mode: containerservice.AgentPoolMode(infrav1.NodePoolModeSystem), Count: to.Int32Ptr(2), Type: containerservice.AgentPoolTypeVirtualMachineScaleSets, OsDiskSizeGB: to.Int32Ptr(0), @@ -192,7 +192,7 @@ func getSampleManagedCluster() containerservice.ManagedCluster { }, { Name: to.StringPtr("test-agentpool-1"), - Mode: containerservice.AgentPoolMode(infrav1exp.NodePoolModeUser), + Mode: containerservice.AgentPoolMode(infrav1.NodePoolModeUser), Count: to.Int32Ptr(4), Type: containerservice.AgentPoolTypeVirtualMachineScaleSets, OsDiskSizeGB: to.Int32Ptr(0), diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_azuremanagedcontrolplanes.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_azuremanagedcontrolplanes.yaml index 3d16f238e6c..2b8428f8c04 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_azuremanagedcontrolplanes.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_azuremanagedcontrolplanes.yaml @@ -308,6 +308,7 @@ spec: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object + x-kubernetes-map-type: atomic loadBalancerProfile: description: LoadBalancerProfile is the profile of the cluster load balancer. @@ -376,7 +377,7 @@ spec: for this AKS Cluster. type: string sku: - description: SKU is the SKU of the AKS to be provisioned. + description: SKU is the AksSKU of the AKS to be provisioned. properties: tier: description: Tier - Tier of a managed cluster SKU. @@ -739,6 +740,7 @@ spec: description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' type: string type: object + x-kubernetes-map-type: atomic loadBalancerProfile: description: LoadBalancerProfile is the profile of the cluster load balancer. @@ -810,7 +812,7 @@ spec: description: SKU is the SKU of the AKS to be provisioned. properties: tier: - description: Tier - Tier of a managed cluster SKU. + description: Tier - Tier of an AKS cluster. enum: - Free - Paid diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 8a7f0be2878..79108988f25 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -23,7 +23,7 @@ spec: - args: - --leader-elect - "--metrics-bind-addr=localhost:8080" - - "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=false},AKS=${EXP_AKS:=false},AKSResourceHealth=${EXP_AKS_RESOURCE_HEALTH:=false}" + - "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=false},AKSResourceHealth=${EXP_AKS_RESOURCE_HEALTH:=false}" - "--v=0" image: controller:latest imagePullPolicy: Always @@ -37,7 +37,7 @@ spec: path: /readyz port: healthz initialDelaySeconds: 10 - periodSeconds: 10 + periodSeconds: 10 livenessProbe: httpGet: path: /healthz @@ -56,7 +56,7 @@ spec: - name: POD_NAMESPACE valueFrom: fieldRef: - fieldPath: metadata.namespace + fieldPath: metadata.namespace terminationGracePeriodSeconds: 10 serviceAccountName: manager tolerations: @@ -64,4 +64,3 @@ spec: key: node-role.kubernetes.io/master - effect: NoSchedule key: node-role.kubernetes.io/control-plane - diff --git a/config/webhook/manifests.yaml b/config/webhook/manifests.yaml index df77bfdc415..5b81638d0c3 100644 --- a/config/webhook/manifests.yaml +++ b/config/webhook/manifests.yaml @@ -100,9 +100,9 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-infrastructure-cluster-x-k8s-io-v1beta1-azuremachinepool + path: /mutate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedcontrolplane failurePolicy: Fail - name: default.azuremachinepool.infrastructure.cluster.x-k8s.io + name: default.azuremanagedcontrolplanes.infrastructure.cluster.x-k8s.io rules: - apiGroups: - infrastructure.cluster.x-k8s.io @@ -112,7 +112,7 @@ webhooks: - CREATE - UPDATE resources: - - azuremachinepools + - azuremanagedcontrolplanes sideEffects: None - admissionReviewVersions: - v1 @@ -121,9 +121,10 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedcontrolplane + path: /mutate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedmachinepool failurePolicy: Fail - name: default.azuremanagedcontrolplanes.infrastructure.cluster.x-k8s.io + matchPolicy: Equivalent + name: default.azuremanagedmachinepools.infrastructure.cluster.x-k8s.io rules: - apiGroups: - infrastructure.cluster.x-k8s.io @@ -133,7 +134,7 @@ webhooks: - CREATE - UPDATE resources: - - azuremanagedcontrolplanes + - azuremanagedmachinepools sideEffects: None - admissionReviewVersions: - v1 @@ -142,10 +143,9 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedmachinepool + path: /mutate-infrastructure-cluster-x-k8s-io-v1beta1-azuremachinepool failurePolicy: Fail - matchPolicy: Equivalent - name: default.azuremanagedmachinepools.infrastructure.cluster.x-k8s.io + name: default.azuremachinepool.infrastructure.cluster.x-k8s.io rules: - apiGroups: - infrastructure.cluster.x-k8s.io @@ -155,7 +155,7 @@ webhooks: - CREATE - UPDATE resources: - - azuremanagedmachinepools + - azuremachinepools sideEffects: None --- apiVersion: admissionregistration.k8s.io/v1 @@ -281,19 +281,18 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremachinepool + path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedcluster failurePolicy: Fail - name: validation.azuremachinepool.infrastructure.cluster.x-k8s.io + name: validation.azuremanagedclusters.infrastructure.cluster.x-k8s.io rules: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - v1beta1 operations: - - CREATE - UPDATE resources: - - azuremachinepools + - azuremanagedclusters sideEffects: None - admissionReviewVersions: - v1 @@ -302,9 +301,9 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremachinepoolmachine + path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedcontrolplane failurePolicy: Fail - name: azuremachinepoolmachine.kb.io + name: validation.azuremanagedcontrolplanes.infrastructure.cluster.x-k8s.io rules: - apiGroups: - infrastructure.cluster.x-k8s.io @@ -314,7 +313,7 @@ webhooks: - CREATE - UPDATE resources: - - azuremachinepoolmachines + - azuremanagedcontrolplanes sideEffects: None - admissionReviewVersions: - v1 @@ -323,9 +322,10 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedcluster + path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedmachinepool failurePolicy: Fail - name: validation.azuremanagedclusters.infrastructure.cluster.x-k8s.io + matchPolicy: Equivalent + name: validation.azuremanagedmachinepools.infrastructure.cluster.x-k8s.io rules: - apiGroups: - infrastructure.cluster.x-k8s.io @@ -333,8 +333,9 @@ webhooks: - v1beta1 operations: - UPDATE + - DELETE resources: - - azuremanagedclusters + - azuremanagedmachinepools sideEffects: None - admissionReviewVersions: - v1 @@ -343,9 +344,9 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedcontrolplane + path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremachinepool failurePolicy: Fail - name: validation.azuremanagedcontrolplanes.infrastructure.cluster.x-k8s.io + name: validation.azuremachinepool.infrastructure.cluster.x-k8s.io rules: - apiGroups: - infrastructure.cluster.x-k8s.io @@ -355,7 +356,7 @@ webhooks: - CREATE - UPDATE resources: - - azuremanagedcontrolplanes + - azuremachinepools sideEffects: None - admissionReviewVersions: - v1 @@ -364,18 +365,17 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedmachinepool + path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremachinepoolmachine failurePolicy: Fail - matchPolicy: Equivalent - name: validation.azuremanagedmachinepools.infrastructure.cluster.x-k8s.io + name: azuremachinepoolmachine.kb.io rules: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - v1beta1 operations: + - CREATE - UPDATE - - DELETE resources: - - azuremanagedmachinepools + - azuremachinepoolmachines sideEffects: None diff --git a/controllers/azureidentity_controller.go b/controllers/azureidentity_controller.go index 56338dd9e71..a222defd8a1 100644 --- a/controllers/azureidentity_controller.go +++ b/controllers/azureidentity_controller.go @@ -27,12 +27,12 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/client-go/tools/record" infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-azure/feature" "sigs.k8s.io/cluster-api-provider-azure/util/reconciler" "sigs.k8s.io/cluster-api-provider-azure/util/system" "sigs.k8s.io/cluster-api-provider-azure/util/tele" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + capifeature "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/predicates" ctrl "sigs.k8s.io/controller-runtime" @@ -70,10 +70,10 @@ func (r *AzureIdentityReconciler) SetupWithManager(ctx context.Context, mgr ctrl return errors.Wrap(err, "error creating controller") } - // Add a watch on infrav1exp.AzureManagedControlPlane if aks is enabled. - if feature.Gates.Enabled(feature.AKS) { + // Add a watch on infrav1.AzureManagedControlPlane if Cluster API 'MachinePool' feature is enabled. + if feature.Gates.Enabled(capifeature.MachinePool) { if err = c.Watch( - &source.Kind{Type: &infrav1exp.AzureManagedControlPlane{}}, + &source.Kind{Type: &infrav1.AzureManagedControlPlane{}}, &handler.EnqueueRequestForObject{}, predicates.ResourceNotPausedAndHasFilterLabel(log, r.WatchFilterValue), ); err != nil { @@ -120,9 +120,9 @@ func (r *AzureIdentityReconciler) Reconcile(ctx context.Context, req ctrl.Reques identityOwner = azureCluster err := r.Get(ctx, req.NamespacedName, azureCluster) if err != nil && apierrors.IsNotFound(err) { - if feature.Gates.Enabled(feature.AKS) { + if feature.Gates.Enabled(capifeature.MachinePool) { // Fetch the AzureManagedControlPlane instance - azureManagedControlPlane := &infrav1exp.AzureManagedControlPlane{} + azureManagedControlPlane := &infrav1.AzureManagedControlPlane{} identityOwner = azureManagedControlPlane err = r.Get(ctx, req.NamespacedName, azureManagedControlPlane) if err != nil && apierrors.IsNotFound(err) { @@ -172,8 +172,8 @@ func (r *AzureIdentityReconciler) Reconcile(ctx context.Context, req ctrl.Reques return ctrl.Result{}, errors.Wrap(err, "failed to get AzureCluster") } } - case infrav1exp.AzureManagedControlPlane: - azManagedControlPlane := &infrav1exp.AzureManagedControlPlane{} + case infrav1.AzureManagedControlPlane: + azManagedControlPlane := &infrav1.AzureManagedControlPlane{} if err := r.Get(ctx, key, azManagedControlPlane); err != nil { if apierrors.IsNotFound(err) { bindingsToDelete = append(bindingsToDelete, b) diff --git a/exp/controllers/azuremanagedcluster_controller.go b/controllers/azuremanagedcluster_controller.go similarity index 91% rename from exp/controllers/azuremanagedcluster_controller.go rename to controllers/azuremanagedcluster_controller.go index aaa9576d78c..7f70ca0d13d 100644 --- a/exp/controllers/azuremanagedcluster_controller.go +++ b/controllers/azuremanagedcluster_controller.go @@ -24,8 +24,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/tools/record" - infracontroller "sigs.k8s.io/cluster-api-provider-azure/controllers" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" "sigs.k8s.io/cluster-api-provider-azure/pkg/coalescing" "sigs.k8s.io/cluster-api-provider-azure/util/reconciler" "sigs.k8s.io/cluster-api-provider-azure/util/tele" @@ -50,7 +49,7 @@ type AzureManagedClusterReconciler struct { } // SetupWithManager initializes this controller with a manager. -func (amcr *AzureManagedClusterReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options infracontroller.Options) error { +func (amcr *AzureManagedClusterReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options Options) error { ctx, log, done := tele.StartSpanWithLogger(ctx, "controllers.AzureManagedClusterReconciler.SetupWithManager", tele.KVP("controller", "AzureManagedCluster"), @@ -62,7 +61,7 @@ func (amcr *AzureManagedClusterReconciler) SetupWithManager(ctx context.Context, r = coalescing.NewReconciler(amcr, options.Cache, log) } - azManagedCluster := &infrav1exp.AzureManagedCluster{} + azManagedCluster := &infrav1.AzureManagedCluster{} // create mapper to transform incoming AzureManagedControlPlanes into AzureManagedCluster requests azureManagedControlPlaneMapper, err := AzureManagedControlPlaneToAzureManagedClusterMapper(ctx, amcr.Client, log) if err != nil { @@ -75,7 +74,7 @@ func (amcr *AzureManagedClusterReconciler) SetupWithManager(ctx context.Context, WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(log, amcr.WatchFilterValue)). // watch AzureManagedControlPlane resources Watches( - &source.Kind{Type: &infrav1exp.AzureManagedControlPlane{}}, + &source.Kind{Type: &infrav1.AzureManagedControlPlane{}}, handler.EnqueueRequestsFromMapFunc(azureManagedControlPlaneMapper), ). Build(r) @@ -86,7 +85,7 @@ func (amcr *AzureManagedClusterReconciler) SetupWithManager(ctx context.Context, // Add a watch on clusterv1.Cluster object for unpause notifications. if err = c.Watch( &source.Kind{Type: &clusterv1.Cluster{}}, - handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(ctx, infrav1exp.GroupVersion.WithKind("AzureManagedCluster"), mgr.GetClient(), &infrav1exp.AzureManagedCluster{})), + handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(ctx, infrav1.GroupVersion.WithKind("AzureManagedCluster"), mgr.GetClient(), &infrav1.AzureManagedCluster{})), predicates.ClusterUnpaused(log), predicates.ResourceNotPausedAndHasFilterLabel(log, amcr.WatchFilterValue), ); err != nil { @@ -115,7 +114,7 @@ func (amcr *AzureManagedClusterReconciler) Reconcile(ctx context.Context, req ct defer done() // Fetch the AzureManagedCluster instance - aksCluster := &infrav1exp.AzureManagedCluster{} + aksCluster := &infrav1.AzureManagedCluster{} err := amcr.Get(ctx, req.NamespacedName, aksCluster) if err != nil { if apierrors.IsNotFound(err) { @@ -134,7 +133,7 @@ func (amcr *AzureManagedClusterReconciler) Reconcile(ctx context.Context, req ct return reconcile.Result{}, nil } - controlPlane := &infrav1exp.AzureManagedControlPlane{} + controlPlane := &infrav1.AzureManagedControlPlane{} controlPlaneRef := types.NamespacedName{ Name: cluster.Spec.ControlPlaneRef.Name, Namespace: cluster.Namespace, diff --git a/exp/controllers/azuremanagedcontrolplane_controller.go b/controllers/azuremanagedcontrolplane_controller.go similarity index 90% rename from exp/controllers/azuremanagedcontrolplane_controller.go rename to controllers/azuremanagedcontrolplane_controller.go index 93337b19be2..f9b2a6a7116 100644 --- a/exp/controllers/azuremanagedcontrolplane_controller.go +++ b/controllers/azuremanagedcontrolplane_controller.go @@ -28,8 +28,6 @@ import ( infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" "sigs.k8s.io/cluster-api-provider-azure/azure" "sigs.k8s.io/cluster-api-provider-azure/azure/scope" - infracontroller "sigs.k8s.io/cluster-api-provider-azure/controllers" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-azure/pkg/coalescing" "sigs.k8s.io/cluster-api-provider-azure/util/reconciler" "sigs.k8s.io/cluster-api-provider-azure/util/tele" @@ -56,7 +54,7 @@ type AzureManagedControlPlaneReconciler struct { } // SetupWithManager initializes this controller with a manager. -func (amcpr *AzureManagedControlPlaneReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options infracontroller.Options) error { +func (amcpr *AzureManagedControlPlaneReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options Options) error { ctx, log, done := tele.StartSpanWithLogger(ctx, "controllers.AzureManagedControlPlaneReconciler.SetupWithManager", tele.KVP("controller", "AzureManagedControlPlane"), @@ -68,7 +66,7 @@ func (amcpr *AzureManagedControlPlaneReconciler) SetupWithManager(ctx context.Co r = coalescing.NewReconciler(amcpr, options.Cache, log) } - azManagedControlPlane := &infrav1exp.AzureManagedControlPlane{} + azManagedControlPlane := &infrav1.AzureManagedControlPlane{} // create mapper to transform incoming AzureManagedClusters into AzureManagedControlPlane requests azureManagedClusterMapper, err := AzureManagedClusterToAzureManagedControlPlaneMapper(ctx, amcpr.Client, log) if err != nil { @@ -76,7 +74,7 @@ func (amcpr *AzureManagedControlPlaneReconciler) SetupWithManager(ctx context.Co } // map requests for machine pools corresponding to AzureManagedControlPlane's defaultPool back to the corresponding AzureManagedControlPlane. - azureManagedMachinePoolMapper := MachinePoolToAzureManagedControlPlaneMapFunc(ctx, amcpr.Client, infrav1exp.GroupVersion.WithKind("AzureManagedControlPlane"), log) + azureManagedMachinePoolMapper := MachinePoolToAzureManagedControlPlaneMapFunc(ctx, amcpr.Client, infrav1.GroupVersion.WithKind("AzureManagedControlPlane"), log) c, err := ctrl.NewControllerManagedBy(mgr). WithOptions(options.Options). @@ -84,7 +82,7 @@ func (amcpr *AzureManagedControlPlaneReconciler) SetupWithManager(ctx context.Co WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(log, amcpr.WatchFilterValue)). // watch AzureManagedCluster resources Watches( - &source.Kind{Type: &infrav1exp.AzureManagedCluster{}}, + &source.Kind{Type: &infrav1.AzureManagedCluster{}}, handler.EnqueueRequestsFromMapFunc(azureManagedClusterMapper), ). // watch MachinePool resources @@ -100,7 +98,7 @@ func (amcpr *AzureManagedControlPlaneReconciler) SetupWithManager(ctx context.Co // Add a watch on clusterv1.Cluster object for unpause & ready notifications. if err = c.Watch( &source.Kind{Type: &clusterv1.Cluster{}}, - handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(ctx, infrav1exp.GroupVersion.WithKind("AzureManagedControlPlane"), mgr.GetClient(), &infrav1exp.AzureManagedControlPlane{})), + handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(ctx, infrav1.GroupVersion.WithKind("AzureManagedControlPlane"), mgr.GetClient(), &infrav1.AzureManagedControlPlane{})), predicates.ClusterUnpausedAndInfrastructureReady(log), predicates.ResourceNotPausedAndHasFilterLabel(log, amcpr.WatchFilterValue), ); err != nil { @@ -127,7 +125,7 @@ func (amcpr *AzureManagedControlPlaneReconciler) Reconcile(ctx context.Context, defer done() // Fetch the AzureManagedControlPlane instance - azureControlPlane := &infrav1exp.AzureManagedControlPlane{} + azureControlPlane := &infrav1.AzureManagedControlPlane{} err := amcpr.Get(ctx, req.NamespacedName, azureControlPlane) if err != nil { if apierrors.IsNotFound(err) { @@ -160,7 +158,7 @@ func (amcpr *AzureManagedControlPlaneReconciler) Reconcile(ctx context.Context, clusterv1.ClusterLabelName: cluster.Name, }) - ammpList := &infrav1exp.AzureManagedMachinePoolList{} + ammpList := &infrav1.AzureManagedMachinePoolList{} if err := amcpr.List(ctx, ammpList, opt1, opt2); err != nil { return reconcile.Result{}, err } @@ -181,7 +179,7 @@ func (amcpr *AzureManagedControlPlaneReconciler) Reconcile(ctx context.Context, // check if the control plane's namespace is allowed for this identity and update owner references for the identity. if azureControlPlane.Spec.IdentityRef != nil { - err := infracontroller.EnsureClusterIdentity(ctx, amcpr.Client, azureControlPlane, azureControlPlane.Spec.IdentityRef, infrav1exp.ManagedClusterFinalizer) + err := EnsureClusterIdentity(ctx, amcpr.Client, azureControlPlane, azureControlPlane.Spec.IdentityRef, infrav1.ManagedClusterFinalizer) if err != nil { return reconcile.Result{}, err } @@ -228,7 +226,7 @@ func (amcpr *AzureManagedControlPlaneReconciler) reconcileNormal(ctx context.Con // Remove deprecated Cluster finalizer if it exists. controllerutil.RemoveFinalizer(scope.ControlPlane, infrav1.ClusterFinalizer) // If the AzureManagedControlPlane doesn't have our finalizer, add it. - controllerutil.AddFinalizer(scope.ControlPlane, infrav1exp.ManagedClusterFinalizer) + controllerutil.AddFinalizer(scope.ControlPlane, infrav1.ManagedClusterFinalizer) // Register the finalizer immediately to avoid orphaning Azure resources on delete if err := scope.PatchObject(ctx); err != nil { amcpr.Recorder.Eventf(scope.ControlPlane, corev1.EventTypeWarning, "AzureManagedControlPlane unavailable", "failed to patch resource: %s", err) @@ -273,10 +271,10 @@ func (amcpr *AzureManagedControlPlaneReconciler) reconcileDelete(ctx context.Con } // Cluster is deleted so remove the finalizer. - controllerutil.RemoveFinalizer(scope.ControlPlane, infrav1exp.ManagedClusterFinalizer) + controllerutil.RemoveFinalizer(scope.ControlPlane, infrav1.ManagedClusterFinalizer) if scope.ControlPlane.Spec.IdentityRef != nil { - err := infracontroller.RemoveClusterIdentityFinalizer(ctx, amcpr.Client, scope.ControlPlane, scope.ControlPlane.Spec.IdentityRef, infrav1exp.ManagedClusterFinalizer) + err := RemoveClusterIdentityFinalizer(ctx, amcpr.Client, scope.ControlPlane, scope.ControlPlane.Spec.IdentityRef, infrav1.ManagedClusterFinalizer) if err != nil { return reconcile.Result{}, err } diff --git a/exp/controllers/azuremanagedcontrolplane_reconciler.go b/controllers/azuremanagedcontrolplane_reconciler.go similarity index 100% rename from exp/controllers/azuremanagedcontrolplane_reconciler.go rename to controllers/azuremanagedcontrolplane_reconciler.go diff --git a/exp/controllers/azuremanagedmachinepool_controller.go b/controllers/azuremanagedmachinepool_controller.go similarity index 94% rename from exp/controllers/azuremanagedmachinepool_controller.go rename to controllers/azuremanagedmachinepool_controller.go index 738197dd19b..e21d7e16b47 100644 --- a/exp/controllers/azuremanagedmachinepool_controller.go +++ b/controllers/azuremanagedmachinepool_controller.go @@ -26,8 +26,6 @@ import ( infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" "sigs.k8s.io/cluster-api-provider-azure/azure" "sigs.k8s.io/cluster-api-provider-azure/azure/scope" - infracontroller "sigs.k8s.io/cluster-api-provider-azure/controllers" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-azure/pkg/coalescing" "sigs.k8s.io/cluster-api-provider-azure/util/reconciler" "sigs.k8s.io/cluster-api-provider-azure/util/tele" @@ -71,7 +69,7 @@ func NewAzureManagedMachinePoolReconciler(client client.Client, recorder record. } // SetupWithManager initializes this controller with a manager. -func (ammpr *AzureManagedMachinePoolReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options infracontroller.Options) error { +func (ammpr *AzureManagedMachinePoolReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options Options) error { ctx, log, done := tele.StartSpanWithLogger(ctx, "controllers.AzureManagedMachinePoolReconciler.SetupWithManager", tele.KVP("controller", "AzureManagedMachinePool"), @@ -83,7 +81,7 @@ func (ammpr *AzureManagedMachinePoolReconciler) SetupWithManager(ctx context.Con r = coalescing.NewReconciler(ammpr, options.Cache, log) } - azManagedMachinePool := &infrav1exp.AzureManagedMachinePool{} + azManagedMachinePool := &infrav1.AzureManagedMachinePool{} // create mapper to transform incoming AzureManagedControlPlanes into AzureManagedMachinePool requests azureManagedControlPlaneMapper, err := AzureManagedControlPlaneToAzureManagedMachinePoolsMapper(ctx, ammpr.Client, mgr.GetScheme(), log) if err != nil { @@ -97,11 +95,11 @@ func (ammpr *AzureManagedMachinePoolReconciler) SetupWithManager(ctx context.Con // watch for changes in CAPI MachinePool resources Watches( &source.Kind{Type: &expv1.MachinePool{}}, - handler.EnqueueRequestsFromMapFunc(MachinePoolToInfrastructureMapFunc(infrav1exp.GroupVersion.WithKind("AzureManagedMachinePool"), log)), + handler.EnqueueRequestsFromMapFunc(MachinePoolToInfrastructureMapFunc(infrav1.GroupVersion.WithKind("AzureManagedMachinePool"), log)), ). // watch for changes in AzureManagedControlPlanes Watches( - &source.Kind{Type: &infrav1exp.AzureManagedControlPlane{}}, + &source.Kind{Type: &infrav1.AzureManagedControlPlane{}}, handler.EnqueueRequestsFromMapFunc(azureManagedControlPlaneMapper), ). Build(r) @@ -112,7 +110,7 @@ func (ammpr *AzureManagedMachinePoolReconciler) SetupWithManager(ctx context.Con // Add a watch on clusterv1.Cluster object for unpause & ready notifications. if err = c.Watch( &source.Kind{Type: &clusterv1.Cluster{}}, - handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(ctx, infrav1exp.GroupVersion.WithKind("AzureManagedMachinePool"), mgr.GetClient(), &infrav1exp.AzureManagedMachinePool{})), + handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(ctx, infrav1.GroupVersion.WithKind("AzureManagedMachinePool"), mgr.GetClient(), &infrav1.AzureManagedMachinePool{})), predicates.ClusterUnpausedAndInfrastructureReady(log), predicates.ResourceNotPausedAndHasFilterLabel(log, ammpr.WatchFilterValue), ); err != nil { @@ -140,7 +138,7 @@ func (ammpr *AzureManagedMachinePoolReconciler) Reconcile(ctx context.Context, r defer done() // Fetch the AzureManagedMachinePool instance - infraPool := &infrav1exp.AzureManagedMachinePool{} + infraPool := &infrav1.AzureManagedMachinePool{} err := ammpr.Get(ctx, req.NamespacedName, infraPool) if err != nil { if apierrors.IsNotFound(err) { @@ -150,7 +148,7 @@ func (ammpr *AzureManagedMachinePoolReconciler) Reconcile(ctx context.Context, r } // Fetch the owning MachinePool. - ownerPool, err := infracontroller.GetOwnerMachinePool(ctx, ammpr.Client, infraPool.ObjectMeta) + ownerPool, err := GetOwnerMachinePool(ctx, ammpr.Client, infraPool.ObjectMeta) if err != nil { return reconcile.Result{}, err } @@ -178,7 +176,7 @@ func (ammpr *AzureManagedMachinePoolReconciler) Reconcile(ctx context.Context, r } // Fetch the corresponding control plane which has all the interesting data. - controlPlane := &infrav1exp.AzureManagedControlPlane{} + controlPlane := &infrav1.AzureManagedControlPlane{} controlPlaneName := client.ObjectKey{ Namespace: ownerCluster.Spec.ControlPlaneRef.Namespace, Name: ownerCluster.Spec.ControlPlaneRef.Name, diff --git a/exp/controllers/azuremanagedmachinepool_reconciler.go b/controllers/azuremanagedmachinepool_reconciler.go similarity index 100% rename from exp/controllers/azuremanagedmachinepool_reconciler.go rename to controllers/azuremanagedmachinepool_reconciler.go diff --git a/exp/controllers/azuremanagedmachinepool_reconciler_test.go b/controllers/azuremanagedmachinepool_reconciler_test.go similarity index 100% rename from exp/controllers/azuremanagedmachinepool_reconciler_test.go rename to controllers/azuremanagedmachinepool_reconciler_test.go diff --git a/controllers/helpers.go b/controllers/helpers.go index 50514f868b5..8ef45ea3054 100644 --- a/controllers/helpers.go +++ b/controllers/helpers.go @@ -54,6 +54,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) const ( @@ -674,3 +675,338 @@ func RemoveClusterIdentityFinalizer(ctx context.Context, c client.Client, object } return nil } + +// MachinePoolToInfrastructureMapFunc returns a handler.MapFunc that watches for +// MachinePool events and returns reconciliation requests for an infrastructure provider object. +func MachinePoolToInfrastructureMapFunc(gvk schema.GroupVersionKind, log logr.Logger) handler.MapFunc { + return func(o client.Object) []reconcile.Request { + m, ok := o.(*expv1.MachinePool) + if !ok { + log.V(4).Info("attempt to map incorrect type", "type", fmt.Sprintf("%T", o)) + return nil + } + + gk := gvk.GroupKind() + ref := m.Spec.Template.Spec.InfrastructureRef + // Return early if the GroupKind doesn't match what we expect. + infraGK := ref.GroupVersionKind().GroupKind() + if gk != infraGK { + log.V(4).Info("gk does not match", "gk", gk, "infraGK", infraGK) + return nil + } + + return []reconcile.Request{ + { + NamespacedName: client.ObjectKey{ + Namespace: m.Namespace, + Name: ref.Name, + }, + }, + } + } +} + +// AzureManagedClusterToAzureManagedMachinePoolsMapper creates a mapping handler to transform AzureManagedClusters into +// AzureManagedMachinePools. The transform requires AzureManagedCluster to map to the owning Cluster, then from the +// Cluster, collect the MachinePools belonging to the cluster, then finally projecting the infrastructure reference +// to the AzureManagedMachinePools. +func AzureManagedClusterToAzureManagedMachinePoolsMapper(ctx context.Context, c client.Client, scheme *runtime.Scheme, log logr.Logger) (handler.MapFunc, error) { + gvk, err := apiutil.GVKForObject(new(infrav1.AzureManagedMachinePool), scheme) + if err != nil { + return nil, errors.Wrap(err, "failed to find GVK for AzureManagedMachinePool") + } + + return func(o client.Object) []ctrl.Request { + ctx, cancel := context.WithTimeout(ctx, reconciler.DefaultMappingTimeout) + defer cancel() + + azCluster, ok := o.(*infrav1.AzureManagedCluster) + if !ok { + log.Error(errors.Errorf("expected an AzureManagedCluster, got %T instead", o.GetObjectKind()), "failed to map AzureManagedCluster") + return nil + } + + log = log.WithValues("AzureManagedCluster", azCluster.Name, "Namespace", azCluster.Namespace) + + // Don't handle deleted AzureManagedClusters + if !azCluster.ObjectMeta.DeletionTimestamp.IsZero() { + log.V(4).Info("AzureManagedCluster has a deletion timestamp, skipping mapping.") + return nil + } + + clusterName, ok := GetOwnerClusterName(azCluster.ObjectMeta) + if !ok { + log.V(4).Info("unable to get the owner cluster") + return nil + } + + machineList := &expv1.MachinePoolList{} + machineList.SetGroupVersionKind(gvk) + // list all of the requested objects within the cluster namespace with the cluster name label + if err := c.List(ctx, machineList, client.InNamespace(azCluster.Namespace), client.MatchingLabels{clusterv1.ClusterLabelName: clusterName}); err != nil { + return nil + } + + mapFunc := MachinePoolToInfrastructureMapFunc(gvk, log) + var results []ctrl.Request + for _, machine := range machineList.Items { + m := machine + azureMachines := mapFunc(&m) + results = append(results, azureMachines...) + } + + return results + }, nil +} + +// AzureManagedControlPlaneToAzureManagedMachinePoolsMapper creates a mapping handler to transform AzureManagedControlPlanes into +// AzureManagedMachinePools. The transform requires AzureManagedControlPlane to map to the owning Cluster, then from the +// Cluster, collect the MachinePools belonging to the cluster, then finally projecting the infrastructure reference +// to the AzureManagedMachinePools. +func AzureManagedControlPlaneToAzureManagedMachinePoolsMapper(ctx context.Context, c client.Client, scheme *runtime.Scheme, log logr.Logger) (handler.MapFunc, error) { + gvk, err := apiutil.GVKForObject(new(infrav1.AzureManagedMachinePool), scheme) + if err != nil { + return nil, errors.Wrap(err, "failed to find GVK for AzureManagedMachinePool") + } + + return func(o client.Object) []ctrl.Request { + ctx, cancel := context.WithTimeout(ctx, reconciler.DefaultMappingTimeout) + defer cancel() + + azControlPlane, ok := o.(*infrav1.AzureManagedControlPlane) + if !ok { + log.Error(errors.Errorf("expected an AzureManagedControlPlane, got %T instead", o.GetObjectKind()), "failed to map AzureManagedControlPlane") + return nil + } + + log = log.WithValues("AzureManagedControlPlane", azControlPlane.Name, "Namespace", azControlPlane.Namespace) + + // Don't handle deleted AzureManagedControlPlanes + if !azControlPlane.ObjectMeta.DeletionTimestamp.IsZero() { + log.V(4).Info("AzureManagedControlPlane has a deletion timestamp, skipping mapping.") + return nil + } + + clusterName, ok := GetOwnerClusterName(azControlPlane.ObjectMeta) + if !ok { + log.Info("unable to get the owner cluster") + return nil + } + + machineList := &expv1.MachinePoolList{} + machineList.SetGroupVersionKind(gvk) + // list all of the requested objects within the cluster namespace with the cluster name label + if err := c.List(ctx, machineList, client.InNamespace(azControlPlane.Namespace), client.MatchingLabels{clusterv1.ClusterLabelName: clusterName}); err != nil { + return nil + } + + mapFunc := MachinePoolToInfrastructureMapFunc(gvk, log) + var results []ctrl.Request + for _, machine := range machineList.Items { + m := machine + azureMachines := mapFunc(&m) + results = append(results, azureMachines...) + } + + return results + }, nil +} + +// AzureManagedClusterToAzureManagedControlPlaneMapper creates a mapping handler to transform AzureManagedClusters into +// AzureManagedControlPlane. The transform requires AzureManagedCluster to map to the owning Cluster, then from the +// Cluster, collect the control plane infrastructure reference. +func AzureManagedClusterToAzureManagedControlPlaneMapper(ctx context.Context, c client.Client, log logr.Logger) (handler.MapFunc, error) { + return func(o client.Object) []ctrl.Request { + ctx, cancel := context.WithTimeout(ctx, reconciler.DefaultMappingTimeout) + defer cancel() + + azCluster, ok := o.(*infrav1.AzureManagedCluster) + if !ok { + log.Error(errors.Errorf("expected an AzureManagedCluster, got %T instead", o), "failed to map AzureManagedCluster") + return nil + } + + log = log.WithValues("AzureManagedCluster", azCluster.Name, "Namespace", azCluster.Namespace) + + // Don't handle deleted AzureManagedClusters + if !azCluster.ObjectMeta.DeletionTimestamp.IsZero() { + log.V(4).Info("AzureManagedCluster has a deletion timestamp, skipping mapping.") + return nil + } + + cluster, err := util.GetOwnerCluster(ctx, c, azCluster.ObjectMeta) + if err != nil { + log.Error(err, "failed to get the owning cluster") + return nil + } + + if cluster == nil { + log.Error(err, "cluster has not set owner ref yet") + return nil + } + + ref := cluster.Spec.ControlPlaneRef + if ref == nil || ref.Name == "" { + return nil + } + + return []ctrl.Request{ + { + NamespacedName: types.NamespacedName{ + Namespace: ref.Namespace, + Name: ref.Name, + }, + }, + } + }, nil +} + +// AzureManagedControlPlaneToAzureManagedClusterMapper creates a mapping handler to transform AzureManagedClusters into +// AzureManagedControlPlane. The transform requires AzureManagedCluster to map to the owning Cluster, then from the +// Cluster, collect the control plane infrastructure reference. +func AzureManagedControlPlaneToAzureManagedClusterMapper(ctx context.Context, c client.Client, log logr.Logger) (handler.MapFunc, error) { + return func(o client.Object) []ctrl.Request { + ctx, cancel := context.WithTimeout(ctx, reconciler.DefaultMappingTimeout) + defer cancel() + + azManagedControlPlane, ok := o.(*infrav1.AzureManagedControlPlane) + if !ok { + log.Error(errors.Errorf("expected an AzureManagedControlPlane, got %T instead", o), "failed to map AzureManagedControlPlane") + return nil + } + + log = log.WithValues("AzureManagedControlPlane", azManagedControlPlane.Name, "Namespace", azManagedControlPlane.Namespace) + + // Don't handle deleted AzureManagedControlPlanes + if !azManagedControlPlane.ObjectMeta.DeletionTimestamp.IsZero() { + log.V(4).Info("AzureManagedControlPlane has a deletion timestamp, skipping mapping.") + return nil + } + + cluster, err := util.GetOwnerCluster(ctx, c, azManagedControlPlane.ObjectMeta) + if err != nil { + log.Error(err, "failed to get the owning cluster") + return nil + } + + if cluster == nil { + log.Error(err, "cluster has not set owner ref yet") + return nil + } + + ref := cluster.Spec.InfrastructureRef + if ref == nil || ref.Name == "" { + return nil + } + + return []ctrl.Request{ + { + NamespacedName: types.NamespacedName{ + Namespace: ref.Namespace, + Name: ref.Name, + }, + }, + } + }, nil +} + +// MachinePoolToAzureManagedControlPlaneMapFunc returns a handler.MapFunc that watches for +// MachinePool events and returns reconciliation requests for a control plane object. +func MachinePoolToAzureManagedControlPlaneMapFunc(ctx context.Context, c client.Client, gvk schema.GroupVersionKind, log logr.Logger) handler.MapFunc { + return func(o client.Object) []reconcile.Request { + ctx, cancel := context.WithTimeout(ctx, reconciler.DefaultMappingTimeout) + defer cancel() + + machinePool, ok := o.(*expv1.MachinePool) + if !ok { + log.Info("expected a MachinePool, got wrong type", "type", fmt.Sprintf("%T", o)) + return nil + } + + cluster, err := util.GetClusterByName(ctx, c, machinePool.ObjectMeta.Namespace, machinePool.Spec.ClusterName) + if err != nil { + log.Error(err, "failed to get the owning cluster") + return nil + } + + gk := gvk.GroupKind() + ref := cluster.Spec.ControlPlaneRef + // Return early if the GroupKind doesn't match what we expect. + controlPlaneGK := ref.GroupVersionKind().GroupKind() + if gk != controlPlaneGK { + log.Info("gk does not match", "gk", gk, "controlPlaneGK", controlPlaneGK) + return nil + } + + controlPlaneKey := client.ObjectKey{ + Name: ref.Name, + Namespace: ref.Namespace, + } + controlPlane := &infrav1.AzureManagedControlPlane{} + if err := c.Get(ctx, controlPlaneKey, controlPlane); err != nil { + log.Error(err, "failed to fetch default pool reference") + // If we get here, we might want to reconcile but aren't sure. + // Do it anyway to be safe. Worst case we reconcile a few extra times with no-ops. + return []reconcile.Request{ + { + NamespacedName: client.ObjectKey{ + Namespace: ref.Namespace, + Name: ref.Name, + }, + }, + } + } + + infraMachinePoolRef := machinePool.Spec.Template.Spec.InfrastructureRef + + gv, err := schema.ParseGroupVersion(infraMachinePoolRef.APIVersion) + if err != nil { + log.Error(err, "failed to parse group version") + // If we get here, we might want to reconcile but aren't sure. + // Do it anyway to be safe. Worst case we reconcile a few extra times with no-ops. + return []reconcile.Request{ + { + NamespacedName: client.ObjectKey{ + Namespace: ref.Namespace, + Name: ref.Name, + }, + }, + } + } + + kindMatches := infraMachinePoolRef.Kind == "AzureManagedMachinePool" + groupMatches := controlPlaneGK.Group == gv.Group + + ammp := &infrav1.AzureManagedMachinePool{} + key := types.NamespacedName{Namespace: infraMachinePoolRef.Namespace, Name: infraMachinePoolRef.Name} + if err := c.Get(ctx, key, ammp); err != nil { + log.Error(err, fmt.Sprintf("failed to fetch azure managed machine pool for Machinepool: %s", infraMachinePoolRef.Name)) + // If we get here, we might want to reconcile but aren't sure. + // Do it anyway to be safe. Worst case we reconcile a few extra times with no-ops. + return []reconcile.Request{ + { + NamespacedName: client.ObjectKey{ + Namespace: ref.Namespace, + Name: ref.Name, + }, + }, + } + } + + isSystemNodePool := ammp.Spec.Mode == string(infrav1.NodePoolModeSystem) + + if groupMatches && kindMatches && isSystemNodePool { + return []reconcile.Request{ + { + NamespacedName: client.ObjectKey{ + Namespace: ref.Namespace, + Name: ref.Name, + }, + }, + } + } + + // By default, return nothing for a machine pool which is not the default pool for a control plane. + return nil + } +} diff --git a/controllers/helpers_test.go b/controllers/helpers_test.go index dc497d0a87e..1bb85e096e1 100644 --- a/controllers/helpers_test.go +++ b/controllers/helpers_test.go @@ -25,6 +25,7 @@ import ( "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure/auth" + "github.com/Azure/go-autorest/autorest/to" "github.com/go-logr/logr" "github.com/golang/mock/gomock" "github.com/google/go-cmp/cmp" @@ -40,8 +41,16 @@ import ( "sigs.k8s.io/cluster-api-provider-azure/azure/scope" "sigs.k8s.io/cluster-api-provider-azure/internal/test/mock_log" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" capifeature "sigs.k8s.io/cluster-api/feature" + "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" + "sigs.k8s.io/controller-runtime/pkg/reconcile" +) + +var ( + cpName = "my-managed-cp" + clusterName = "my-cluster" ) func TestAzureClusterToAzureMachinesMapper(t *testing.T) { @@ -796,3 +805,490 @@ func Test_deprecatedClusterIdentityFinalizer(t *testing.T) { }) } } + +func TestAzureManagedClusterToAzureManagedMachinePoolsMapper(t *testing.T) { + g := NewWithT(t) + scheme, err := newScheme() + g.Expect(err).NotTo(HaveOccurred()) + initObjects := []runtime.Object{ + newCluster(clusterName), + // Create two Machines with an infrastructure ref and one without. + newManagedMachinePoolInfraReference(clusterName, "my-mmp-0"), + newManagedMachinePoolInfraReference(clusterName, "my-mmp-1"), + newManagedMachinePoolInfraReference(clusterName, "my-mmp-2"), + newMachinePool(clusterName, "my-machine-2"), + } + fakeClient := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(initObjects...).Build() + + sink := mock_log.NewMockLogSink(gomock.NewController(t)) + sink.EXPECT().Init(logr.RuntimeInfo{CallDepth: 1}) + sink.EXPECT().Enabled(4).Return(true) + sink.EXPECT().WithValues("AzureManagedCluster", "my-cluster", "Namespace", "default").Return(sink) + sink.EXPECT().Info(4, "gk does not match", "gk", gomock.Any(), "infraGK", gomock.Any()) + mapper, err := AzureManagedClusterToAzureManagedMachinePoolsMapper(context.Background(), fakeClient, scheme, logr.New(sink)) + g.Expect(err).NotTo(HaveOccurred()) + + requests := mapper(&infrav1.AzureManagedCluster{ + ObjectMeta: metav1.ObjectMeta{ + Name: clusterName, + Namespace: "default", + OwnerReferences: []metav1.OwnerReference{ + { + Name: clusterName, + Kind: "Cluster", + APIVersion: clusterv1.GroupVersion.String(), + }, + }, + }, + }) + g.Expect(requests).To(ConsistOf([]reconcile.Request{ + { + NamespacedName: types.NamespacedName{ + Name: "azuremy-mmp-0", + Namespace: "default", + }, + }, + { + NamespacedName: types.NamespacedName{ + Name: "azuremy-mmp-1", + Namespace: "default", + }, + }, + { + NamespacedName: types.NamespacedName{ + Name: "azuremy-mmp-2", + Namespace: "default", + }, + }, + })) +} + +func TestAzureManagedControlPlaneToAzureManagedMachinePoolsMapper(t *testing.T) { + g := NewWithT(t) + scheme, err := newScheme() + g.Expect(err).NotTo(HaveOccurred()) + cluster := newCluster("my-cluster") + cluster.Spec.ControlPlaneRef = &corev1.ObjectReference{ + APIVersion: infrav1.GroupVersion.String(), + Kind: "AzureManagedControlPlane", + Name: cpName, + Namespace: cluster.Namespace, + } + initObjects := []runtime.Object{ + cluster, + newAzureManagedControlPlane(cpName), + // Create two Machines with an infrastructure ref and one without. + newManagedMachinePoolInfraReference(clusterName, "my-mmp-0"), + newManagedMachinePoolInfraReference(clusterName, "my-mmp-1"), + newManagedMachinePoolInfraReference(clusterName, "my-mmp-2"), + newMachinePool(clusterName, "my-machine-2"), + } + fakeClient := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(initObjects...).Build() + + sink := mock_log.NewMockLogSink(gomock.NewController(t)) + sink.EXPECT().Init(logr.RuntimeInfo{CallDepth: 1}) + sink.EXPECT().Enabled(4).Return(true) + sink.EXPECT().WithValues("AzureManagedControlPlane", cpName, "Namespace", cluster.Namespace).Return(sink) + sink.EXPECT().Info(4, "gk does not match", "gk", gomock.Any(), "infraGK", gomock.Any()) + mapper, err := AzureManagedControlPlaneToAzureManagedMachinePoolsMapper(context.Background(), fakeClient, scheme, logr.New(sink)) + g.Expect(err).NotTo(HaveOccurred()) + + requests := mapper(&infrav1.AzureManagedControlPlane{ + ObjectMeta: metav1.ObjectMeta{ + Name: cpName, + Namespace: cluster.Namespace, + OwnerReferences: []metav1.OwnerReference{ + { + Name: cluster.Name, + Kind: "Cluster", + APIVersion: clusterv1.GroupVersion.String(), + }, + }, + }, + }) + g.Expect(requests).To(ConsistOf([]reconcile.Request{ + { + NamespacedName: types.NamespacedName{ + Name: "azuremy-mmp-0", + Namespace: "default", + }, + }, + { + NamespacedName: types.NamespacedName{ + Name: "azuremy-mmp-1", + Namespace: "default", + }, + }, + { + NamespacedName: types.NamespacedName{ + Name: "azuremy-mmp-2", + Namespace: "default", + }, + }, + })) +} + +func TestMachinePoolToAzureManagedControlPlaneMapFuncSuccess(t *testing.T) { + g := NewWithT(t) + scheme, err := newScheme() + g.Expect(err).NotTo(HaveOccurred()) + cluster := newCluster(clusterName) + controlPlane := newAzureManagedControlPlane(cpName) + cluster.Spec.ControlPlaneRef = &corev1.ObjectReference{ + APIVersion: infrav1.GroupVersion.String(), + Kind: "AzureManagedControlPlane", + Name: cpName, + Namespace: cluster.Namespace, + } + + managedMachinePool0 := newManagedMachinePoolInfraReference(clusterName, "my-mmp-0") + azureManagedMachinePool0 := newAzureManagedMachinePool(clusterName, "azuremy-mmp-0", "System") + managedMachinePool0.Spec.ClusterName = clusterName + + managedMachinePool1 := newManagedMachinePoolInfraReference(clusterName, "my-mmp-1") + azureManagedMachinePool1 := newAzureManagedMachinePool(clusterName, "azuremy-mmp-1", "User") + managedMachinePool1.Spec.ClusterName = clusterName + + initObjects := []runtime.Object{ + cluster, + controlPlane, + managedMachinePool0, + azureManagedMachinePool0, + // Create two Machines with an infrastructure ref and one without. + managedMachinePool1, + azureManagedMachinePool1, + } + fakeClient := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(initObjects...).Build() + + sink := mock_log.NewMockLogSink(gomock.NewController(t)) + sink.EXPECT().Init(logr.RuntimeInfo{CallDepth: 1}) + mapper := MachinePoolToAzureManagedControlPlaneMapFunc(context.Background(), fakeClient, infrav1.GroupVersion.WithKind("AzureManagedControlPlane"), logr.New(sink)) + + // system pool should trigger + requests := mapper(newManagedMachinePoolInfraReference(clusterName, "my-mmp-0")) + g.Expect(requests).To(ConsistOf([]reconcile.Request{ + { + NamespacedName: types.NamespacedName{ + Name: "my-managed-cp", + Namespace: "default", + }, + }, + })) + + // any other pool should not trigger + requests = mapper(newManagedMachinePoolInfraReference(clusterName, "my-mmp-1")) + g.Expect(requests).To(BeNil()) +} + +func TestMachinePoolToAzureManagedControlPlaneMapFuncFailure(t *testing.T) { + g := NewWithT(t) + scheme, err := newScheme() + g.Expect(err).NotTo(HaveOccurred()) + cluster := newCluster(clusterName) + cluster.Spec.ControlPlaneRef = &corev1.ObjectReference{ + APIVersion: infrav1.GroupVersion.String(), + Kind: "AzureManagedControlPlane", + Name: cpName, + Namespace: cluster.Namespace, + } + managedMachinePool := newManagedMachinePoolInfraReference(clusterName, "my-mmp-0") + managedMachinePool.Spec.ClusterName = clusterName + initObjects := []runtime.Object{ + cluster, + managedMachinePool, + // Create two Machines with an infrastructure ref and one without. + newManagedMachinePoolInfraReference(clusterName, "my-mmp-1"), + } + fakeClient := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(initObjects...).Build() + + sink := mock_log.NewMockLogSink(gomock.NewController(t)) + sink.EXPECT().Init(logr.RuntimeInfo{CallDepth: 1}) + sink.EXPECT().Error(gomock.Any(), "failed to fetch default pool reference") + sink.EXPECT().Error(gomock.Any(), "failed to fetch default pool reference") // twice because we are testing two calls + + mapper := MachinePoolToAzureManagedControlPlaneMapFunc(context.Background(), fakeClient, infrav1.GroupVersion.WithKind("AzureManagedControlPlane"), logr.New(sink)) + + // default pool should trigger if owned cluster could not be fetched + requests := mapper(newManagedMachinePoolInfraReference(clusterName, "my-mmp-0")) + g.Expect(requests).To(ConsistOf([]reconcile.Request{ + { + NamespacedName: types.NamespacedName{ + Name: "my-managed-cp", + Namespace: "default", + }, + }, + })) + + // any other pool should also trigger if owned cluster could not be fetched + requests = mapper(newManagedMachinePoolInfraReference(clusterName, "my-mmp-1")) + g.Expect(requests).To(ConsistOf([]reconcile.Request{ + { + NamespacedName: types.NamespacedName{ + Name: "my-managed-cp", + Namespace: "default", + }, + }, + })) +} + +func TestAzureManagedClusterToAzureManagedControlPlaneMapper(t *testing.T) { + g := NewWithT(t) + scheme, err := newScheme() + g.Expect(err).NotTo(HaveOccurred()) + cluster := newCluster("my-cluster") + cluster.Spec.ControlPlaneRef = &corev1.ObjectReference{ + APIVersion: infrav1.GroupVersion.String(), + Kind: "AzureManagedControlPlane", + Name: cpName, + Namespace: cluster.Namespace, + } + + initObjects := []runtime.Object{ + cluster, + newAzureManagedControlPlane(cpName), + } + fakeClient := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(initObjects...).Build() + + sink := mock_log.NewMockLogSink(gomock.NewController(t)) + sink.EXPECT().Init(logr.RuntimeInfo{CallDepth: 1}) + sink.EXPECT().WithValues("AzureManagedCluster", "az-"+cluster.Name, "Namespace", "default") + + mapper, err := AzureManagedClusterToAzureManagedControlPlaneMapper(context.Background(), fakeClient, logr.New(sink)) + g.Expect(err).NotTo(HaveOccurred()) + requests := mapper(&infrav1.AzureManagedCluster{ + ObjectMeta: metav1.ObjectMeta{ + Name: "az-" + cluster.Name, + Namespace: "default", + OwnerReferences: []metav1.OwnerReference{ + { + Name: cluster.Name, + Kind: "Cluster", + APIVersion: clusterv1.GroupVersion.String(), + }, + }, + }, + }) + g.Expect(requests).To(HaveLen(1)) + g.Expect(requests).To(Equal([]reconcile.Request{ + { + NamespacedName: types.NamespacedName{ + Name: cpName, + Namespace: cluster.Namespace, + }, + }, + })) +} + +func TestAzureManagedControlPlaneToAzureManagedClusterMapper(t *testing.T) { + g := NewWithT(t) + scheme, err := newScheme() + g.Expect(err).NotTo(HaveOccurred()) + cluster := newCluster("my-cluster") + azManagedCluster := &infrav1.AzureManagedCluster{ + ObjectMeta: metav1.ObjectMeta{ + Name: "az-" + cluster.Name, + Namespace: "default", + OwnerReferences: []metav1.OwnerReference{ + { + Name: cluster.Name, + Kind: "Cluster", + APIVersion: clusterv1.GroupVersion.String(), + }, + }, + }, + } + + cluster.Spec.ControlPlaneRef = &corev1.ObjectReference{ + APIVersion: infrav1.GroupVersion.String(), + Kind: "AzureManagedControlPlane", + Name: cpName, + Namespace: cluster.Namespace, + } + cluster.Spec.InfrastructureRef = &corev1.ObjectReference{ + APIVersion: infrav1.GroupVersion.String(), + Kind: "AzureManagedCluster", + Name: azManagedCluster.Name, + Namespace: azManagedCluster.Namespace, + } + + initObjects := []runtime.Object{ + cluster, + newAzureManagedControlPlane(cpName), + azManagedCluster, + } + fakeClient := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(initObjects...).Build() + + sink := mock_log.NewMockLogSink(gomock.NewController(t)) + sink.EXPECT().Init(logr.RuntimeInfo{CallDepth: 1}) + sink.EXPECT().WithValues("AzureManagedControlPlane", cpName, "Namespace", cluster.Namespace) + + mapper, err := AzureManagedControlPlaneToAzureManagedClusterMapper(context.Background(), fakeClient, logr.New(sink)) + g.Expect(err).NotTo(HaveOccurred()) + requests := mapper(&infrav1.AzureManagedControlPlane{ + ObjectMeta: metav1.ObjectMeta{ + Name: cpName, + Namespace: cluster.Namespace, + OwnerReferences: []metav1.OwnerReference{ + { + Name: cluster.Name, + Kind: "Cluster", + APIVersion: clusterv1.GroupVersion.String(), + }, + }, + }, + }) + g.Expect(requests).To(HaveLen(1)) + g.Expect(requests).To(Equal([]reconcile.Request{ + { + NamespacedName: types.NamespacedName{ + Name: azManagedCluster.Name, + Namespace: azManagedCluster.Namespace, + }, + }, + })) +} + +func newAzureManagedControlPlane(cpName string) *infrav1.AzureManagedControlPlane { + return &infrav1.AzureManagedControlPlane{ + ObjectMeta: metav1.ObjectMeta{ + Name: cpName, + Namespace: "default", + }, + } +} + +func newManagedMachinePoolInfraReference(clusterName, poolName string) *expv1.MachinePool { + m := newMachinePool(clusterName, poolName) + m.Spec.ClusterName = clusterName + m.Spec.Template.Spec.InfrastructureRef = corev1.ObjectReference{ + Kind: "AzureManagedMachinePool", + Namespace: m.Namespace, + Name: "azure" + poolName, + APIVersion: infrav1.GroupVersion.String(), + } + return m +} + +func newAzureManagedMachinePool(clusterName, poolName, mode string) *infrav1.AzureManagedMachinePool { + var cpuManagerPolicyStatic = infrav1.CPUManagerPolicyStatic + var topologyManagerPolicy = infrav1.TopologyManagerPolicyBestEffort + return &infrav1.AzureManagedMachinePool{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{ + clusterv1.ClusterLabelName: clusterName, + }, + Name: poolName, + Namespace: "default", + }, + Spec: infrav1.AzureManagedMachinePoolSpec{ + Mode: mode, + SKU: "Standard_B2s", + OSDiskSizeGB: to.Int32Ptr(512), + KubeletConfig: &infrav1.KubeletConfig{ + CPUManagerPolicy: &cpuManagerPolicyStatic, + TopologyManagerPolicy: &topologyManagerPolicy, + }, + }, + } +} + +func newMachinePool(clusterName, poolName string) *expv1.MachinePool { + return &expv1.MachinePool{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{ + clusterv1.ClusterLabelName: clusterName, + }, + Name: poolName, + Namespace: "default", + }, + Spec: expv1.MachinePoolSpec{ + Replicas: to.Int32Ptr(2), + }, + } +} + +func newManagedMachinePoolWithInfrastructureRef(clusterName, poolName string) *expv1.MachinePool { + m := newMachinePool(clusterName, poolName) + m.Spec.Template.Spec.InfrastructureRef = corev1.ObjectReference{ + Kind: "AzureManagedMachinePool", + Namespace: m.Namespace, + Name: "azure" + poolName, + APIVersion: infrav1.GroupVersion.String(), + } + return m +} + +func Test_ManagedMachinePoolToInfrastructureMapFunc(t *testing.T) { + cases := []struct { + Name string + Setup func(logMock *mock_log.MockLogSink) + MapObjectFactory func(*GomegaWithT) client.Object + Expect func(*GomegaWithT, []reconcile.Request) + }{ + { + Name: "MachinePoolToAzureManagedMachinePool", + MapObjectFactory: func(g *GomegaWithT) client.Object { + return newManagedMachinePoolWithInfrastructureRef("azureManagedCluster", "ManagedMachinePool") + }, + Setup: func(logMock *mock_log.MockLogSink) { + logMock.EXPECT().Init(logr.RuntimeInfo{CallDepth: 1}) + }, + Expect: func(g *GomegaWithT, reqs []reconcile.Request) { + g.Expect(reqs).To(HaveLen(1)) + g.Expect(reqs[0]).To(Equal(reconcile.Request{ + NamespacedName: types.NamespacedName{ + Name: "azureManagedMachinePool", + Namespace: "default", + }, + })) + }, + }, + { + Name: "MachinePoolWithoutMatchingInfraRef", + MapObjectFactory: func(g *GomegaWithT) client.Object { + return newMachinePool("azureManagedCluster", "machinePool") + }, + Setup: func(logMock *mock_log.MockLogSink) { + ampGK := infrav1.GroupVersion.WithKind("AzureManagedMachinePool").GroupKind() + logMock.EXPECT().Init(logr.RuntimeInfo{CallDepth: 1}) + logMock.EXPECT().Enabled(4).Return(true) + logMock.EXPECT().Info(4, "gk does not match", "gk", ampGK, "infraGK", gomock.Any()) + }, + Expect: func(g *GomegaWithT, reqs []reconcile.Request) { + g.Expect(reqs).To(BeEmpty()) + }, + }, + { + Name: "NotAMachinePool", + MapObjectFactory: func(g *GomegaWithT) client.Object { + return newCluster("azureManagedCluster") + }, + Setup: func(logMock *mock_log.MockLogSink) { + logMock.EXPECT().Init(logr.RuntimeInfo{CallDepth: 1}) + logMock.EXPECT().Enabled(4).Return(true) + logMock.EXPECT().Info(4, "attempt to map incorrect type", "type", "*v1beta1.Cluster") + }, + Expect: func(g *GomegaWithT, reqs []reconcile.Request) { + g.Expect(reqs).To(BeEmpty()) + }, + }, + } + + for _, c := range cases { + c := c + t.Run(c.Name, func(t *testing.T) { + g := NewWithT(t) + + mockCtrl := gomock.NewController(t) + defer mockCtrl.Finish() + + sink := mock_log.NewMockLogSink(mockCtrl) + if c.Setup != nil { + c.Setup(sink) + } + f := MachinePoolToInfrastructureMapFunc(infrav1.GroupVersion.WithKind("AzureManagedMachinePool"), logr.New(sink)) + reqs := f(c.MapObjectFactory(g)) + c.Expect(g, reqs) + }) + } +} diff --git a/controllers/suite_test.go b/controllers/suite_test.go index dca8f757069..df6d57f5cd4 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -49,6 +49,19 @@ var _ = BeforeSuite(func() { Expect(NewAzureMachineReconciler(testEnv, testEnv.GetEventRecorderFor("azuremachine-reconciler"), reconciler.DefaultLoopTimeout, ""). SetupWithManager(context.Background(), testEnv.Manager, Options{Options: controller.Options{MaxConcurrentReconciles: 1}})).To(Succeed()) + Expect((&AzureManagedClusterReconciler{ + Client: testEnv, + Recorder: testEnv.GetEventRecorderFor("azuremanagedcluster-reconciler"), + }).SetupWithManager(context.Background(), testEnv.Manager, Options{Options: controller.Options{MaxConcurrentReconciles: 1}})).To(Succeed()) + + Expect((&AzureManagedControlPlaneReconciler{ + Client: testEnv, + Recorder: testEnv.GetEventRecorderFor("azuremanagedcontrolplane-reconciler"), + }).SetupWithManager(context.Background(), testEnv.Manager, Options{Options: controller.Options{MaxConcurrentReconciles: 1}})).To(Succeed()) + + Expect(NewAzureManagedMachinePoolReconciler(testEnv, testEnv.GetEventRecorderFor("azuremanagedmachinepool-reconciler"), + reconciler.DefaultLoopTimeout, "").SetupWithManager(context.Background(), testEnv.Manager, Options{Options: controller.Options{MaxConcurrentReconciles: 1}})).To(Succeed()) + // +kubebuilder:scaffold:scheme By("starting the manager") diff --git a/docs/book/src/topics/managedcluster.md b/docs/book/src/topics/managedcluster.md index 04184f255c5..36aeca5b7bf 100644 --- a/docs/book/src/topics/managedcluster.md +++ b/docs/book/src/topics/managedcluster.md @@ -1,9 +1,9 @@ # Managed Clusters (AKS) -- **Feature status:** Experimental -- **Feature gate:** AKS=true,MachinePool=true +- **Feature status:** GA +- **Feature gate:** MachinePool=true -Cluster API Provider Azure (CAPZ) experimentally supports managing Azure +Cluster API Provider Azure (CAPZ) supports managing Azure Kubernetes Service (AKS) clusters. CAPZ implements this with three custom resources: @@ -56,14 +56,13 @@ export AZURE_CLUSTER_IDENTITY_SECRET_NAMESPACE="default" export CLUSTER_IDENTITY_NAME="cluster-identity" ``` -Managed clusters also require the following feature flags set as environment variables: +Managed clusters require the Cluster API "MachinePool" feature flag enabled. You can do that via an environment variable thusly: ```bash export EXP_MACHINE_POOL=true -export EXP_AKS=true ``` -Optionally, the following feature flags may be set: +Optionally, the you can enable the CAPZ "AKSResourceHealth" feature flag as well: ```bash export EXP_AKS_RESOURCE_HEALTH=true diff --git a/exp/api/v1alpha3/conversion.go b/exp/api/v1alpha3/conversion.go index 3b046bc0c5f..0a2c4d9a4c8 100644 --- a/exp/api/v1alpha3/conversion.go +++ b/exp/api/v1alpha3/conversion.go @@ -20,16 +20,10 @@ import ( conversion "k8s.io/apimachinery/pkg/conversion" infrav1alpha3 "sigs.k8s.io/cluster-api-provider-azure/api/v1alpha3" infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) -// Convert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha3_ManagedControlPlaneSubnet is a conversion function. -func Convert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha3_ManagedControlPlaneSubnet(in *infrav1exp.ManagedControlPlaneSubnet, out *ManagedControlPlaneSubnet, s conversion.Scope) error { - return autoConvert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha3_ManagedControlPlaneSubnet(in, out, s) -} - // Convert_v1alpha3_OSDisk_To_v1beta1_OSDisk is a conversion function. func Convert_v1alpha3_OSDisk_To_v1beta1_OSDisk(in *infrav1alpha3.OSDisk, out *infrav1.OSDisk, s conversion.Scope) error { return infrav1alpha3.Convert_v1alpha3_OSDisk_To_v1beta1_OSDisk(in, out, s) diff --git a/exp/api/v1alpha3/conversion_test.go b/exp/api/v1alpha3/conversion_test.go index 3d2b3eec906..105c195e001 100644 --- a/exp/api/v1alpha3/conversion_test.go +++ b/exp/api/v1alpha3/conversion_test.go @@ -36,22 +36,4 @@ func TestFuzzyConversion(t *testing.T) { Hub: &infrav1exp.AzureMachinePool{}, Spoke: &AzureMachinePool{}, })) - - t.Run("for AzureManagedCluster", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Scheme: scheme, - Hub: &infrav1exp.AzureManagedCluster{}, - Spoke: &AzureManagedCluster{}, - })) - - t.Run("for AzureManagedControlPlane", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Scheme: scheme, - Hub: &infrav1exp.AzureManagedControlPlane{}, - Spoke: &AzureManagedControlPlane{}, - })) - - t.Run("for AzureManagedMachinePool", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Scheme: scheme, - Hub: &infrav1exp.AzureManagedMachinePool{}, - Spoke: &AzureManagedMachinePool{}, - })) } diff --git a/exp/api/v1alpha3/zz_generated.conversion.go b/exp/api/v1alpha3/zz_generated.conversion.go index e61339fa993..a3eb54a79e7 100644 --- a/exp/api/v1alpha3/zz_generated.conversion.go +++ b/exp/api/v1alpha3/zz_generated.conversion.go @@ -41,16 +41,6 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*AADProfile)(nil), (*v1beta1.AADProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AADProfile_To_v1beta1_AADProfile(a.(*AADProfile), b.(*v1beta1.AADProfile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.AADProfile)(nil), (*AADProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AADProfile_To_v1alpha3_AADProfile(a.(*v1beta1.AADProfile), b.(*AADProfile), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*AzureMachinePool)(nil), (*v1beta1.AzureMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha3_AzureMachinePool_To_v1beta1_AzureMachinePool(a.(*AzureMachinePool), b.(*v1beta1.AzureMachinePool), scope) }); err != nil { @@ -91,116 +81,6 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AzureManagedCluster)(nil), (*v1beta1.AzureManagedCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AzureManagedCluster_To_v1beta1_AzureManagedCluster(a.(*AzureManagedCluster), b.(*v1beta1.AzureManagedCluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedCluster)(nil), (*AzureManagedCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedCluster_To_v1alpha3_AzureManagedCluster(a.(*v1beta1.AzureManagedCluster), b.(*AzureManagedCluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedClusterList)(nil), (*v1beta1.AzureManagedClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(a.(*AzureManagedClusterList), b.(*v1beta1.AzureManagedClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedClusterList)(nil), (*AzureManagedClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedClusterList_To_v1alpha3_AzureManagedClusterList(a.(*v1beta1.AzureManagedClusterList), b.(*AzureManagedClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedClusterSpec)(nil), (*v1beta1.AzureManagedClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(a.(*AzureManagedClusterSpec), b.(*v1beta1.AzureManagedClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedClusterSpec)(nil), (*AzureManagedClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedClusterSpec_To_v1alpha3_AzureManagedClusterSpec(a.(*v1beta1.AzureManagedClusterSpec), b.(*AzureManagedClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedClusterStatus)(nil), (*v1beta1.AzureManagedClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(a.(*AzureManagedClusterStatus), b.(*v1beta1.AzureManagedClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedClusterStatus)(nil), (*AzureManagedClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedClusterStatus_To_v1alpha3_AzureManagedClusterStatus(a.(*v1beta1.AzureManagedClusterStatus), b.(*AzureManagedClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedControlPlane)(nil), (*v1beta1.AzureManagedControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(a.(*AzureManagedControlPlane), b.(*v1beta1.AzureManagedControlPlane), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedControlPlane)(nil), (*AzureManagedControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedControlPlane_To_v1alpha3_AzureManagedControlPlane(a.(*v1beta1.AzureManagedControlPlane), b.(*AzureManagedControlPlane), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedControlPlaneList)(nil), (*v1beta1.AzureManagedControlPlaneList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(a.(*AzureManagedControlPlaneList), b.(*v1beta1.AzureManagedControlPlaneList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedControlPlaneList)(nil), (*AzureManagedControlPlaneList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedControlPlaneList_To_v1alpha3_AzureManagedControlPlaneList(a.(*v1beta1.AzureManagedControlPlaneList), b.(*AzureManagedControlPlaneList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedControlPlaneSpec)(nil), (*v1beta1.AzureManagedControlPlaneSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(a.(*AzureManagedControlPlaneSpec), b.(*v1beta1.AzureManagedControlPlaneSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedControlPlaneStatus)(nil), (*v1beta1.AzureManagedControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(a.(*AzureManagedControlPlaneStatus), b.(*v1beta1.AzureManagedControlPlaneStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedMachinePool)(nil), (*v1beta1.AzureManagedMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(a.(*AzureManagedMachinePool), b.(*v1beta1.AzureManagedMachinePool), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedMachinePool)(nil), (*AzureManagedMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedMachinePool_To_v1alpha3_AzureManagedMachinePool(a.(*v1beta1.AzureManagedMachinePool), b.(*AzureManagedMachinePool), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedMachinePoolList)(nil), (*v1beta1.AzureManagedMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(a.(*AzureManagedMachinePoolList), b.(*v1beta1.AzureManagedMachinePoolList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedMachinePoolList)(nil), (*AzureManagedMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedMachinePoolList_To_v1alpha3_AzureManagedMachinePoolList(a.(*v1beta1.AzureManagedMachinePoolList), b.(*AzureManagedMachinePoolList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedMachinePoolSpec)(nil), (*v1beta1.AzureManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(a.(*AzureManagedMachinePoolSpec), b.(*v1beta1.AzureManagedMachinePoolSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedMachinePoolStatus)(nil), (*v1beta1.AzureManagedMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(a.(*AzureManagedMachinePoolStatus), b.(*v1beta1.AzureManagedMachinePoolStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ManagedControlPlaneSubnet)(nil), (*v1beta1.ManagedControlPlaneSubnet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(a.(*ManagedControlPlaneSubnet), b.(*v1beta1.ManagedControlPlaneSubnet), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ManagedControlPlaneVirtualNetwork)(nil), (*v1beta1.ManagedControlPlaneVirtualNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(a.(*ManagedControlPlaneVirtualNetwork), b.(*v1beta1.ManagedControlPlaneVirtualNetwork), scope) - }); err != nil { - return err - } if err := s.AddConversionFunc((*apiv1alpha3.APIEndpoint)(nil), (*apiv1beta1.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint(a.(*apiv1alpha3.APIEndpoint), b.(*apiv1beta1.APIEndpoint), scope) }); err != nil { @@ -246,41 +126,11 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddConversionFunc((*v1beta1.AzureManagedControlPlaneSpec)(nil), (*AzureManagedControlPlaneSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha3_AzureManagedControlPlaneSpec(a.(*v1beta1.AzureManagedControlPlaneSpec), b.(*AzureManagedControlPlaneSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.AzureManagedControlPlaneStatus)(nil), (*AzureManagedControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha3_AzureManagedControlPlaneStatus(a.(*v1beta1.AzureManagedControlPlaneStatus), b.(*AzureManagedControlPlaneStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.AzureManagedMachinePoolSpec)(nil), (*AzureManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha3_AzureManagedMachinePoolSpec(a.(*v1beta1.AzureManagedMachinePoolSpec), b.(*AzureManagedMachinePoolSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.AzureManagedMachinePoolStatus)(nil), (*AzureManagedMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha3_AzureManagedMachinePoolStatus(a.(*v1beta1.AzureManagedMachinePoolStatus), b.(*AzureManagedMachinePoolStatus), scope) - }); err != nil { - return err - } if err := s.AddConversionFunc((*clusterapiproviderazureapiv1beta1.Image)(nil), (*clusterapiproviderazureapiv1alpha3.Image)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_Image_To_v1alpha3_Image(a.(*clusterapiproviderazureapiv1beta1.Image), b.(*clusterapiproviderazureapiv1alpha3.Image), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1beta1.ManagedControlPlaneSubnet)(nil), (*ManagedControlPlaneSubnet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha3_ManagedControlPlaneSubnet(a.(*v1beta1.ManagedControlPlaneSubnet), b.(*ManagedControlPlaneSubnet), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.ManagedControlPlaneVirtualNetwork)(nil), (*ManagedControlPlaneVirtualNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha3_ManagedControlPlaneVirtualNetwork(a.(*v1beta1.ManagedControlPlaneVirtualNetwork), b.(*ManagedControlPlaneVirtualNetwork), scope) - }); err != nil { - return err - } if err := s.AddConversionFunc((*clusterapiproviderazureapiv1beta1.OSDisk)(nil), (*clusterapiproviderazureapiv1alpha3.OSDisk)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_OSDisk_To_v1alpha3_OSDisk(a.(*clusterapiproviderazureapiv1beta1.OSDisk), b.(*clusterapiproviderazureapiv1alpha3.OSDisk), scope) }); err != nil { @@ -294,28 +144,6 @@ func RegisterConversions(s *runtime.Scheme) error { return nil } -func autoConvert_v1alpha3_AADProfile_To_v1beta1_AADProfile(in *AADProfile, out *v1beta1.AADProfile, s conversion.Scope) error { - out.Managed = in.Managed - out.AdminGroupObjectIDs = *(*[]string)(unsafe.Pointer(&in.AdminGroupObjectIDs)) - return nil -} - -// Convert_v1alpha3_AADProfile_To_v1beta1_AADProfile is an autogenerated conversion function. -func Convert_v1alpha3_AADProfile_To_v1beta1_AADProfile(in *AADProfile, out *v1beta1.AADProfile, s conversion.Scope) error { - return autoConvert_v1alpha3_AADProfile_To_v1beta1_AADProfile(in, out, s) -} - -func autoConvert_v1beta1_AADProfile_To_v1alpha3_AADProfile(in *v1beta1.AADProfile, out *AADProfile, s conversion.Scope) error { - out.Managed = in.Managed - out.AdminGroupObjectIDs = *(*[]string)(unsafe.Pointer(&in.AdminGroupObjectIDs)) - return nil -} - -// Convert_v1beta1_AADProfile_To_v1alpha3_AADProfile is an autogenerated conversion function. -func Convert_v1beta1_AADProfile_To_v1alpha3_AADProfile(in *v1beta1.AADProfile, out *AADProfile, s conversion.Scope) error { - return autoConvert_v1beta1_AADProfile_To_v1alpha3_AADProfile(in, out, s) -} - func autoConvert_v1alpha3_AzureMachinePool_To_v1beta1_AzureMachinePool(in *AzureMachinePool, out *v1beta1.AzureMachinePool, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_v1alpha3_AzureMachinePoolSpec_To_v1beta1_AzureMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { @@ -553,444 +381,3 @@ func autoConvert_v1beta1_AzureMachinePoolStatus_To_v1alpha3_AzureMachinePoolStat // WARNING: in.LongRunningOperationStates requires manual conversion: does not exist in peer-type return nil } - -func autoConvert_v1alpha3_AzureManagedCluster_To_v1beta1_AzureManagedCluster(in *AzureManagedCluster, out *v1beta1.AzureManagedCluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha3_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha3_AzureManagedCluster_To_v1beta1_AzureManagedCluster is an autogenerated conversion function. -func Convert_v1alpha3_AzureManagedCluster_To_v1beta1_AzureManagedCluster(in *AzureManagedCluster, out *v1beta1.AzureManagedCluster, s conversion.Scope) error { - return autoConvert_v1alpha3_AzureManagedCluster_To_v1beta1_AzureManagedCluster(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedCluster_To_v1alpha3_AzureManagedCluster(in *v1beta1.AzureManagedCluster, out *AzureManagedCluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_AzureManagedClusterSpec_To_v1alpha3_AzureManagedClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_AzureManagedClusterStatus_To_v1alpha3_AzureManagedClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AzureManagedCluster_To_v1alpha3_AzureManagedCluster is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedCluster_To_v1alpha3_AzureManagedCluster(in *v1beta1.AzureManagedCluster, out *AzureManagedCluster, s conversion.Scope) error { - return autoConvert_v1beta1_AzureManagedCluster_To_v1alpha3_AzureManagedCluster(in, out, s) -} - -func autoConvert_v1alpha3_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(in *AzureManagedClusterList, out *v1beta1.AzureManagedClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.AzureManagedCluster, len(*in)) - for i := range *in { - if err := Convert_v1alpha3_AzureManagedCluster_To_v1beta1_AzureManagedCluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha3_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList is an autogenerated conversion function. -func Convert_v1alpha3_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(in *AzureManagedClusterList, out *v1beta1.AzureManagedClusterList, s conversion.Scope) error { - return autoConvert_v1alpha3_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedClusterList_To_v1alpha3_AzureManagedClusterList(in *v1beta1.AzureManagedClusterList, out *AzureManagedClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AzureManagedCluster, len(*in)) - for i := range *in { - if err := Convert_v1beta1_AzureManagedCluster_To_v1alpha3_AzureManagedCluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_AzureManagedClusterList_To_v1alpha3_AzureManagedClusterList is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedClusterList_To_v1alpha3_AzureManagedClusterList(in *v1beta1.AzureManagedClusterList, out *AzureManagedClusterList, s conversion.Scope) error { - return autoConvert_v1beta1_AzureManagedClusterList_To_v1alpha3_AzureManagedClusterList(in, out, s) -} - -func autoConvert_v1alpha3_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(in *AzureManagedClusterSpec, out *v1beta1.AzureManagedClusterSpec, s conversion.Scope) error { - if err := Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha3_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec is an autogenerated conversion function. -func Convert_v1alpha3_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(in *AzureManagedClusterSpec, out *v1beta1.AzureManagedClusterSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedClusterSpec_To_v1alpha3_AzureManagedClusterSpec(in *v1beta1.AzureManagedClusterSpec, out *AzureManagedClusterSpec, s conversion.Scope) error { - if err := Convert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AzureManagedClusterSpec_To_v1alpha3_AzureManagedClusterSpec is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedClusterSpec_To_v1alpha3_AzureManagedClusterSpec(in *v1beta1.AzureManagedClusterSpec, out *AzureManagedClusterSpec, s conversion.Scope) error { - return autoConvert_v1beta1_AzureManagedClusterSpec_To_v1alpha3_AzureManagedClusterSpec(in, out, s) -} - -func autoConvert_v1alpha3_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(in *AzureManagedClusterStatus, out *v1beta1.AzureManagedClusterStatus, s conversion.Scope) error { - out.Ready = in.Ready - return nil -} - -// Convert_v1alpha3_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus is an autogenerated conversion function. -func Convert_v1alpha3_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(in *AzureManagedClusterStatus, out *v1beta1.AzureManagedClusterStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedClusterStatus_To_v1alpha3_AzureManagedClusterStatus(in *v1beta1.AzureManagedClusterStatus, out *AzureManagedClusterStatus, s conversion.Scope) error { - out.Ready = in.Ready - return nil -} - -// Convert_v1beta1_AzureManagedClusterStatus_To_v1alpha3_AzureManagedClusterStatus is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedClusterStatus_To_v1alpha3_AzureManagedClusterStatus(in *v1beta1.AzureManagedClusterStatus, out *AzureManagedClusterStatus, s conversion.Scope) error { - return autoConvert_v1beta1_AzureManagedClusterStatus_To_v1alpha3_AzureManagedClusterStatus(in, out, s) -} - -func autoConvert_v1alpha3_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(in *AzureManagedControlPlane, out *v1beta1.AzureManagedControlPlane, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha3_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha3_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane is an autogenerated conversion function. -func Convert_v1alpha3_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(in *AzureManagedControlPlane, out *v1beta1.AzureManagedControlPlane, s conversion.Scope) error { - return autoConvert_v1alpha3_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedControlPlane_To_v1alpha3_AzureManagedControlPlane(in *v1beta1.AzureManagedControlPlane, out *AzureManagedControlPlane, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha3_AzureManagedControlPlaneSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha3_AzureManagedControlPlaneStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AzureManagedControlPlane_To_v1alpha3_AzureManagedControlPlane is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedControlPlane_To_v1alpha3_AzureManagedControlPlane(in *v1beta1.AzureManagedControlPlane, out *AzureManagedControlPlane, s conversion.Scope) error { - return autoConvert_v1beta1_AzureManagedControlPlane_To_v1alpha3_AzureManagedControlPlane(in, out, s) -} - -func autoConvert_v1alpha3_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(in *AzureManagedControlPlaneList, out *v1beta1.AzureManagedControlPlaneList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.AzureManagedControlPlane, len(*in)) - for i := range *in { - if err := Convert_v1alpha3_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha3_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList is an autogenerated conversion function. -func Convert_v1alpha3_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(in *AzureManagedControlPlaneList, out *v1beta1.AzureManagedControlPlaneList, s conversion.Scope) error { - return autoConvert_v1alpha3_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedControlPlaneList_To_v1alpha3_AzureManagedControlPlaneList(in *v1beta1.AzureManagedControlPlaneList, out *AzureManagedControlPlaneList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AzureManagedControlPlane, len(*in)) - for i := range *in { - if err := Convert_v1beta1_AzureManagedControlPlane_To_v1alpha3_AzureManagedControlPlane(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_AzureManagedControlPlaneList_To_v1alpha3_AzureManagedControlPlaneList is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedControlPlaneList_To_v1alpha3_AzureManagedControlPlaneList(in *v1beta1.AzureManagedControlPlaneList, out *AzureManagedControlPlaneList, s conversion.Scope) error { - return autoConvert_v1beta1_AzureManagedControlPlaneList_To_v1alpha3_AzureManagedControlPlaneList(in, out, s) -} - -func autoConvert_v1alpha3_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(in *AzureManagedControlPlaneSpec, out *v1beta1.AzureManagedControlPlaneSpec, s conversion.Scope) error { - out.Version = in.Version - out.ResourceGroupName = in.ResourceGroupName - out.NodeResourceGroupName = in.NodeResourceGroupName - if err := Convert_v1alpha3_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(&in.VirtualNetwork, &out.VirtualNetwork, s); err != nil { - return err - } - out.SubscriptionID = in.SubscriptionID - out.Location = in.Location - if err := Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { - return err - } - out.AdditionalTags = *(*clusterapiproviderazureapiv1beta1.Tags)(unsafe.Pointer(&in.AdditionalTags)) - out.NetworkPlugin = (*string)(unsafe.Pointer(in.NetworkPlugin)) - out.NetworkPolicy = (*string)(unsafe.Pointer(in.NetworkPolicy)) - out.SSHPublicKey = in.SSHPublicKey - out.DNSServiceIP = (*string)(unsafe.Pointer(in.DNSServiceIP)) - out.LoadBalancerSKU = (*string)(unsafe.Pointer(in.LoadBalancerSKU)) - out.AADProfile = (*v1beta1.AADProfile)(unsafe.Pointer(in.AADProfile)) - return nil -} - -// Convert_v1alpha3_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec is an autogenerated conversion function. -func Convert_v1alpha3_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(in *AzureManagedControlPlaneSpec, out *v1beta1.AzureManagedControlPlaneSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha3_AzureManagedControlPlaneSpec(in *v1beta1.AzureManagedControlPlaneSpec, out *AzureManagedControlPlaneSpec, s conversion.Scope) error { - out.Version = in.Version - out.ResourceGroupName = in.ResourceGroupName - out.NodeResourceGroupName = in.NodeResourceGroupName - if err := Convert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha3_ManagedControlPlaneVirtualNetwork(&in.VirtualNetwork, &out.VirtualNetwork, s); err != nil { - return err - } - out.SubscriptionID = in.SubscriptionID - out.Location = in.Location - if err := Convert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { - return err - } - out.AdditionalTags = *(*clusterapiproviderazureapiv1alpha3.Tags)(unsafe.Pointer(&in.AdditionalTags)) - out.NetworkPlugin = (*string)(unsafe.Pointer(in.NetworkPlugin)) - out.NetworkPolicy = (*string)(unsafe.Pointer(in.NetworkPolicy)) - out.SSHPublicKey = in.SSHPublicKey - out.DNSServiceIP = (*string)(unsafe.Pointer(in.DNSServiceIP)) - out.LoadBalancerSKU = (*string)(unsafe.Pointer(in.LoadBalancerSKU)) - // WARNING: in.IdentityRef requires manual conversion: does not exist in peer-type - out.AADProfile = (*AADProfile)(unsafe.Pointer(in.AADProfile)) - // WARNING: in.AddonProfiles requires manual conversion: does not exist in peer-type - // WARNING: in.SKU requires manual conversion: does not exist in peer-type - // WARNING: in.LoadBalancerProfile requires manual conversion: does not exist in peer-type - // WARNING: in.APIServerAccessProfile requires manual conversion: does not exist in peer-type - // WARNING: in.AutoScalerProfile requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha3_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(in *AzureManagedControlPlaneStatus, out *v1beta1.AzureManagedControlPlaneStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Initialized = in.Initialized - return nil -} - -// Convert_v1alpha3_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus is an autogenerated conversion function. -func Convert_v1alpha3_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(in *AzureManagedControlPlaneStatus, out *v1beta1.AzureManagedControlPlaneStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha3_AzureManagedControlPlaneStatus(in *v1beta1.AzureManagedControlPlaneStatus, out *AzureManagedControlPlaneStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Initialized = in.Initialized - // WARNING: in.Conditions requires manual conversion: does not exist in peer-type - // WARNING: in.LongRunningOperationStates requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha3_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(in *AzureManagedMachinePool, out *v1beta1.AzureManagedMachinePool, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha3_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha3_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool is an autogenerated conversion function. -func Convert_v1alpha3_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(in *AzureManagedMachinePool, out *v1beta1.AzureManagedMachinePool, s conversion.Scope) error { - return autoConvert_v1alpha3_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedMachinePool_To_v1alpha3_AzureManagedMachinePool(in *v1beta1.AzureManagedMachinePool, out *AzureManagedMachinePool, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha3_AzureManagedMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha3_AzureManagedMachinePoolStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AzureManagedMachinePool_To_v1alpha3_AzureManagedMachinePool is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedMachinePool_To_v1alpha3_AzureManagedMachinePool(in *v1beta1.AzureManagedMachinePool, out *AzureManagedMachinePool, s conversion.Scope) error { - return autoConvert_v1beta1_AzureManagedMachinePool_To_v1alpha3_AzureManagedMachinePool(in, out, s) -} - -func autoConvert_v1alpha3_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(in *AzureManagedMachinePoolList, out *v1beta1.AzureManagedMachinePoolList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.AzureManagedMachinePool, len(*in)) - for i := range *in { - if err := Convert_v1alpha3_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha3_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList is an autogenerated conversion function. -func Convert_v1alpha3_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(in *AzureManagedMachinePoolList, out *v1beta1.AzureManagedMachinePoolList, s conversion.Scope) error { - return autoConvert_v1alpha3_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedMachinePoolList_To_v1alpha3_AzureManagedMachinePoolList(in *v1beta1.AzureManagedMachinePoolList, out *AzureManagedMachinePoolList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AzureManagedMachinePool, len(*in)) - for i := range *in { - if err := Convert_v1beta1_AzureManagedMachinePool_To_v1alpha3_AzureManagedMachinePool(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_AzureManagedMachinePoolList_To_v1alpha3_AzureManagedMachinePoolList is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedMachinePoolList_To_v1alpha3_AzureManagedMachinePoolList(in *v1beta1.AzureManagedMachinePoolList, out *AzureManagedMachinePoolList, s conversion.Scope) error { - return autoConvert_v1beta1_AzureManagedMachinePoolList_To_v1alpha3_AzureManagedMachinePoolList(in, out, s) -} - -func autoConvert_v1alpha3_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(in *AzureManagedMachinePoolSpec, out *v1beta1.AzureManagedMachinePoolSpec, s conversion.Scope) error { - out.Mode = in.Mode - out.SKU = in.SKU - out.OSDiskSizeGB = (*int32)(unsafe.Pointer(in.OSDiskSizeGB)) - out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) - return nil -} - -// Convert_v1alpha3_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec is an autogenerated conversion function. -func Convert_v1alpha3_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(in *AzureManagedMachinePoolSpec, out *v1beta1.AzureManagedMachinePoolSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha3_AzureManagedMachinePoolSpec(in *v1beta1.AzureManagedMachinePoolSpec, out *AzureManagedMachinePoolSpec, s conversion.Scope) error { - // WARNING: in.AdditionalTags requires manual conversion: does not exist in peer-type - // WARNING: in.Name requires manual conversion: does not exist in peer-type - out.Mode = in.Mode - out.SKU = in.SKU - out.OSDiskSizeGB = (*int32)(unsafe.Pointer(in.OSDiskSizeGB)) - // WARNING: in.AvailabilityZones requires manual conversion: does not exist in peer-type - // WARNING: in.NodeLabels requires manual conversion: does not exist in peer-type - // WARNING: in.Taints requires manual conversion: does not exist in peer-type - out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) - // WARNING: in.Scaling requires manual conversion: does not exist in peer-type - // WARNING: in.MaxPods requires manual conversion: does not exist in peer-type - // WARNING: in.OsDiskType requires manual conversion: does not exist in peer-type - // WARNING: in.EnableUltraSSD requires manual conversion: does not exist in peer-type - // WARNING: in.OSType requires manual conversion: does not exist in peer-type - // WARNING: in.EnableNodePublicIP requires manual conversion: does not exist in peer-type - // WARNING: in.NodePublicIPPrefixID requires manual conversion: does not exist in peer-type - // WARNING: in.ScaleSetPriority requires manual conversion: does not exist in peer-type - // WARNING: in.KubeletConfig requires manual conversion: does not exist in peer-type - // WARNING: in.KubeletDiskType requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha3_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(in *AzureManagedMachinePoolStatus, out *v1beta1.AzureManagedMachinePoolStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Replicas = in.Replicas - out.ErrorReason = (*errors.MachineStatusError)(unsafe.Pointer(in.ErrorReason)) - out.ErrorMessage = (*string)(unsafe.Pointer(in.ErrorMessage)) - return nil -} - -// Convert_v1alpha3_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus is an autogenerated conversion function. -func Convert_v1alpha3_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(in *AzureManagedMachinePoolStatus, out *v1beta1.AzureManagedMachinePoolStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha3_AzureManagedMachinePoolStatus(in *v1beta1.AzureManagedMachinePoolStatus, out *AzureManagedMachinePoolStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Replicas = in.Replicas - out.ErrorReason = (*errors.MachineStatusError)(unsafe.Pointer(in.ErrorReason)) - out.ErrorMessage = (*string)(unsafe.Pointer(in.ErrorMessage)) - // WARNING: in.Conditions requires manual conversion: does not exist in peer-type - // WARNING: in.LongRunningOperationStates requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha3_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(in *ManagedControlPlaneSubnet, out *v1beta1.ManagedControlPlaneSubnet, s conversion.Scope) error { - out.Name = in.Name - out.CIDRBlock = in.CIDRBlock - return nil -} - -// Convert_v1alpha3_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet is an autogenerated conversion function. -func Convert_v1alpha3_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(in *ManagedControlPlaneSubnet, out *v1beta1.ManagedControlPlaneSubnet, s conversion.Scope) error { - return autoConvert_v1alpha3_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(in, out, s) -} - -func autoConvert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha3_ManagedControlPlaneSubnet(in *v1beta1.ManagedControlPlaneSubnet, out *ManagedControlPlaneSubnet, s conversion.Scope) error { - out.Name = in.Name - out.CIDRBlock = in.CIDRBlock - // WARNING: in.ServiceEndpoints requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha3_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(in *ManagedControlPlaneVirtualNetwork, out *v1beta1.ManagedControlPlaneVirtualNetwork, s conversion.Scope) error { - out.Name = in.Name - out.CIDRBlock = in.CIDRBlock - if err := Convert_v1alpha3_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(&in.Subnet, &out.Subnet, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha3_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork is an autogenerated conversion function. -func Convert_v1alpha3_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(in *ManagedControlPlaneVirtualNetwork, out *v1beta1.ManagedControlPlaneVirtualNetwork, s conversion.Scope) error { - return autoConvert_v1alpha3_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(in, out, s) -} - -func autoConvert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha3_ManagedControlPlaneVirtualNetwork(in *v1beta1.ManagedControlPlaneVirtualNetwork, out *ManagedControlPlaneVirtualNetwork, s conversion.Scope) error { - out.Name = in.Name - out.CIDRBlock = in.CIDRBlock - if err := Convert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha3_ManagedControlPlaneSubnet(&in.Subnet, &out.Subnet, s); err != nil { - return err - } - // WARNING: in.ResourceGroup requires manual conversion: does not exist in peer-type - return nil -} diff --git a/exp/api/v1alpha3/zz_generated.deepcopy.go b/exp/api/v1alpha3/zz_generated.deepcopy.go index c97f33062b7..1c55e29e266 100644 --- a/exp/api/v1alpha3/zz_generated.deepcopy.go +++ b/exp/api/v1alpha3/zz_generated.deepcopy.go @@ -28,26 +28,6 @@ import ( "sigs.k8s.io/cluster-api/errors" ) -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AADProfile) DeepCopyInto(out *AADProfile) { - *out = *in - if in.AdminGroupObjectIDs != nil { - in, out := &in.AdminGroupObjectIDs, &out.AdminGroupObjectIDs - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AADProfile. -func (in *AADProfile) DeepCopy() *AADProfile { - if in == nil { - return nil - } - out := new(AADProfile) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AzureMachinePool) DeepCopyInto(out *AzureMachinePool) { *out = *in @@ -260,356 +240,3 @@ func (in *AzureMachinePoolStatus) DeepCopy() *AzureMachinePoolStatus { in.DeepCopyInto(out) return out } - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedCluster) DeepCopyInto(out *AzureManagedCluster) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedCluster. -func (in *AzureManagedCluster) DeepCopy() *AzureManagedCluster { - if in == nil { - return nil - } - out := new(AzureManagedCluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureManagedCluster) 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 *AzureManagedClusterList) DeepCopyInto(out *AzureManagedClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AzureManagedCluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterList. -func (in *AzureManagedClusterList) DeepCopy() *AzureManagedClusterList { - if in == nil { - return nil - } - out := new(AzureManagedClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureManagedClusterList) 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 *AzureManagedClusterSpec) DeepCopyInto(out *AzureManagedClusterSpec) { - *out = *in - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterSpec. -func (in *AzureManagedClusterSpec) DeepCopy() *AzureManagedClusterSpec { - if in == nil { - return nil - } - out := new(AzureManagedClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedClusterStatus) DeepCopyInto(out *AzureManagedClusterStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterStatus. -func (in *AzureManagedClusterStatus) DeepCopy() *AzureManagedClusterStatus { - if in == nil { - return nil - } - out := new(AzureManagedClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedControlPlane) DeepCopyInto(out *AzureManagedControlPlane) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlane. -func (in *AzureManagedControlPlane) DeepCopy() *AzureManagedControlPlane { - if in == nil { - return nil - } - out := new(AzureManagedControlPlane) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureManagedControlPlane) 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 *AzureManagedControlPlaneList) DeepCopyInto(out *AzureManagedControlPlaneList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AzureManagedControlPlane, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneList. -func (in *AzureManagedControlPlaneList) DeepCopy() *AzureManagedControlPlaneList { - if in == nil { - return nil - } - out := new(AzureManagedControlPlaneList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureManagedControlPlaneList) 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 *AzureManagedControlPlaneSpec) DeepCopyInto(out *AzureManagedControlPlaneSpec) { - *out = *in - out.VirtualNetwork = in.VirtualNetwork - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if in.AdditionalTags != nil { - in, out := &in.AdditionalTags, &out.AdditionalTags - *out = make(apiv1alpha3.Tags, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.NetworkPlugin != nil { - in, out := &in.NetworkPlugin, &out.NetworkPlugin - *out = new(string) - **out = **in - } - if in.NetworkPolicy != nil { - in, out := &in.NetworkPolicy, &out.NetworkPolicy - *out = new(string) - **out = **in - } - if in.DNSServiceIP != nil { - in, out := &in.DNSServiceIP, &out.DNSServiceIP - *out = new(string) - **out = **in - } - if in.LoadBalancerSKU != nil { - in, out := &in.LoadBalancerSKU, &out.LoadBalancerSKU - *out = new(string) - **out = **in - } - if in.AADProfile != nil { - in, out := &in.AADProfile, &out.AADProfile - *out = new(AADProfile) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneSpec. -func (in *AzureManagedControlPlaneSpec) DeepCopy() *AzureManagedControlPlaneSpec { - if in == nil { - return nil - } - out := new(AzureManagedControlPlaneSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedControlPlaneStatus) DeepCopyInto(out *AzureManagedControlPlaneStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneStatus. -func (in *AzureManagedControlPlaneStatus) DeepCopy() *AzureManagedControlPlaneStatus { - if in == nil { - return nil - } - out := new(AzureManagedControlPlaneStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedMachinePool) DeepCopyInto(out *AzureManagedMachinePool) { - *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 AzureManagedMachinePool. -func (in *AzureManagedMachinePool) DeepCopy() *AzureManagedMachinePool { - if in == nil { - return nil - } - out := new(AzureManagedMachinePool) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureManagedMachinePool) 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 *AzureManagedMachinePoolList) DeepCopyInto(out *AzureManagedMachinePoolList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AzureManagedMachinePool, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolList. -func (in *AzureManagedMachinePoolList) DeepCopy() *AzureManagedMachinePoolList { - if in == nil { - return nil - } - out := new(AzureManagedMachinePoolList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureManagedMachinePoolList) 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 *AzureManagedMachinePoolSpec) DeepCopyInto(out *AzureManagedMachinePoolSpec) { - *out = *in - if in.OSDiskSizeGB != nil { - in, out := &in.OSDiskSizeGB, &out.OSDiskSizeGB - *out = new(int32) - **out = **in - } - if in.ProviderIDList != nil { - in, out := &in.ProviderIDList, &out.ProviderIDList - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolSpec. -func (in *AzureManagedMachinePoolSpec) DeepCopy() *AzureManagedMachinePoolSpec { - if in == nil { - return nil - } - out := new(AzureManagedMachinePoolSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedMachinePoolStatus) DeepCopyInto(out *AzureManagedMachinePoolStatus) { - *out = *in - if in.ErrorReason != nil { - in, out := &in.ErrorReason, &out.ErrorReason - *out = new(errors.MachineStatusError) - **out = **in - } - if in.ErrorMessage != nil { - in, out := &in.ErrorMessage, &out.ErrorMessage - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolStatus. -func (in *AzureManagedMachinePoolStatus) DeepCopy() *AzureManagedMachinePoolStatus { - if in == nil { - return nil - } - out := new(AzureManagedMachinePoolStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManagedControlPlaneSubnet) DeepCopyInto(out *ManagedControlPlaneSubnet) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedControlPlaneSubnet. -func (in *ManagedControlPlaneSubnet) DeepCopy() *ManagedControlPlaneSubnet { - if in == nil { - return nil - } - out := new(ManagedControlPlaneSubnet) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManagedControlPlaneVirtualNetwork) DeepCopyInto(out *ManagedControlPlaneVirtualNetwork) { - *out = *in - out.Subnet = in.Subnet -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedControlPlaneVirtualNetwork. -func (in *ManagedControlPlaneVirtualNetwork) DeepCopy() *ManagedControlPlaneVirtualNetwork { - if in == nil { - return nil - } - out := new(ManagedControlPlaneVirtualNetwork) - in.DeepCopyInto(out) - return out -} diff --git a/exp/api/v1alpha4/conversion.go b/exp/api/v1alpha4/conversion.go index c9d9fdc88ed..b0c3a1ef545 100644 --- a/exp/api/v1alpha4/conversion.go +++ b/exp/api/v1alpha4/conversion.go @@ -20,16 +20,10 @@ import ( "k8s.io/apimachinery/pkg/conversion" infrav1alpha4 "sigs.k8s.io/cluster-api-provider-azure/api/v1alpha4" infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) -// Convert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha4_ManagedControlPlaneSubnet is a conversion function. -func Convert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha4_ManagedControlPlaneSubnet(in *infrav1exp.ManagedControlPlaneSubnet, out *ManagedControlPlaneSubnet, s conversion.Scope) error { - return autoConvert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha4_ManagedControlPlaneSubnet(in, out, s) -} - // Convert_v1alpha4_OSDisk_To_v1beta1_OSDisk is a conversion function. func Convert_v1alpha4_OSDisk_To_v1beta1_OSDisk(in *infrav1alpha4.OSDisk, out *infrav1.OSDisk, s conversion.Scope) error { return infrav1alpha4.Convert_v1alpha4_OSDisk_To_v1beta1_OSDisk(in, out, s) diff --git a/exp/api/v1alpha4/conversion_test.go b/exp/api/v1alpha4/conversion_test.go index 5a4464a749f..f7b3f27fe90 100644 --- a/exp/api/v1alpha4/conversion_test.go +++ b/exp/api/v1alpha4/conversion_test.go @@ -37,24 +37,6 @@ func TestFuzzyConversion(t *testing.T) { Spoke: &AzureMachinePool{}, })) - t.Run("for AzureManagedCluster", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Scheme: scheme, - Hub: &infrav1exp.AzureManagedCluster{}, - Spoke: &AzureManagedCluster{}, - })) - - t.Run("for AzureManagedControlPlane", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Scheme: scheme, - Hub: &infrav1exp.AzureManagedControlPlane{}, - Spoke: &AzureManagedControlPlane{}, - })) - - t.Run("for AzureManagedMachinePool", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Scheme: scheme, - Hub: &infrav1exp.AzureManagedMachinePool{}, - Spoke: &AzureManagedMachinePool{}, - })) - t.Run("for AzureMachinePoolMachine", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ Scheme: scheme, Hub: &infrav1exp.AzureMachinePoolMachine{}, diff --git a/exp/api/v1alpha4/zz_generated.conversion.go b/exp/api/v1alpha4/zz_generated.conversion.go index 1b7244d2c8a..a79a31cd724 100644 --- a/exp/api/v1alpha4/zz_generated.conversion.go +++ b/exp/api/v1alpha4/zz_generated.conversion.go @@ -44,26 +44,6 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*AADProfile)(nil), (*v1beta1.AADProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AADProfile_To_v1beta1_AADProfile(a.(*AADProfile), b.(*v1beta1.AADProfile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.AADProfile)(nil), (*AADProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AADProfile_To_v1alpha4_AADProfile(a.(*v1beta1.AADProfile), b.(*AADProfile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*APIServerAccessProfile)(nil), (*v1beta1.APIServerAccessProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_APIServerAccessProfile_To_v1beta1_APIServerAccessProfile(a.(*APIServerAccessProfile), b.(*v1beta1.APIServerAccessProfile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.APIServerAccessProfile)(nil), (*APIServerAccessProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_APIServerAccessProfile_To_v1alpha4_APIServerAccessProfile(a.(*v1beta1.APIServerAccessProfile), b.(*APIServerAccessProfile), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*AzureMachinePool)(nil), (*v1beta1.AzureMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha4_AzureMachinePool_To_v1beta1_AzureMachinePool(a.(*AzureMachinePool), b.(*v1beta1.AzureMachinePool), scope) }); err != nil { @@ -164,116 +144,6 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AzureManagedCluster)(nil), (*v1beta1.AzureManagedCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AzureManagedCluster_To_v1beta1_AzureManagedCluster(a.(*AzureManagedCluster), b.(*v1beta1.AzureManagedCluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedCluster)(nil), (*AzureManagedCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedCluster_To_v1alpha4_AzureManagedCluster(a.(*v1beta1.AzureManagedCluster), b.(*AzureManagedCluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedClusterList)(nil), (*v1beta1.AzureManagedClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(a.(*AzureManagedClusterList), b.(*v1beta1.AzureManagedClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedClusterList)(nil), (*AzureManagedClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedClusterList_To_v1alpha4_AzureManagedClusterList(a.(*v1beta1.AzureManagedClusterList), b.(*AzureManagedClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedClusterSpec)(nil), (*v1beta1.AzureManagedClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(a.(*AzureManagedClusterSpec), b.(*v1beta1.AzureManagedClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedClusterSpec)(nil), (*AzureManagedClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedClusterSpec_To_v1alpha4_AzureManagedClusterSpec(a.(*v1beta1.AzureManagedClusterSpec), b.(*AzureManagedClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedClusterStatus)(nil), (*v1beta1.AzureManagedClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(a.(*AzureManagedClusterStatus), b.(*v1beta1.AzureManagedClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedClusterStatus)(nil), (*AzureManagedClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedClusterStatus_To_v1alpha4_AzureManagedClusterStatus(a.(*v1beta1.AzureManagedClusterStatus), b.(*AzureManagedClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedControlPlane)(nil), (*v1beta1.AzureManagedControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(a.(*AzureManagedControlPlane), b.(*v1beta1.AzureManagedControlPlane), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedControlPlane)(nil), (*AzureManagedControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedControlPlane_To_v1alpha4_AzureManagedControlPlane(a.(*v1beta1.AzureManagedControlPlane), b.(*AzureManagedControlPlane), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedControlPlaneList)(nil), (*v1beta1.AzureManagedControlPlaneList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(a.(*AzureManagedControlPlaneList), b.(*v1beta1.AzureManagedControlPlaneList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedControlPlaneList)(nil), (*AzureManagedControlPlaneList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedControlPlaneList_To_v1alpha4_AzureManagedControlPlaneList(a.(*v1beta1.AzureManagedControlPlaneList), b.(*AzureManagedControlPlaneList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedControlPlaneSpec)(nil), (*v1beta1.AzureManagedControlPlaneSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(a.(*AzureManagedControlPlaneSpec), b.(*v1beta1.AzureManagedControlPlaneSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedControlPlaneStatus)(nil), (*v1beta1.AzureManagedControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(a.(*AzureManagedControlPlaneStatus), b.(*v1beta1.AzureManagedControlPlaneStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedMachinePool)(nil), (*v1beta1.AzureManagedMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(a.(*AzureManagedMachinePool), b.(*v1beta1.AzureManagedMachinePool), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedMachinePool)(nil), (*AzureManagedMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedMachinePool_To_v1alpha4_AzureManagedMachinePool(a.(*v1beta1.AzureManagedMachinePool), b.(*AzureManagedMachinePool), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedMachinePoolList)(nil), (*v1beta1.AzureManagedMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(a.(*AzureManagedMachinePoolList), b.(*v1beta1.AzureManagedMachinePoolList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.AzureManagedMachinePoolList)(nil), (*AzureManagedMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedMachinePoolList_To_v1alpha4_AzureManagedMachinePoolList(a.(*v1beta1.AzureManagedMachinePoolList), b.(*AzureManagedMachinePoolList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedMachinePoolSpec)(nil), (*v1beta1.AzureManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(a.(*AzureManagedMachinePoolSpec), b.(*v1beta1.AzureManagedMachinePoolSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedMachinePoolStatus)(nil), (*v1beta1.AzureManagedMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(a.(*AzureManagedMachinePoolStatus), b.(*v1beta1.AzureManagedMachinePoolStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*LoadBalancerProfile)(nil), (*v1beta1.LoadBalancerProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_LoadBalancerProfile_To_v1beta1_LoadBalancerProfile(a.(*LoadBalancerProfile), b.(*v1beta1.LoadBalancerProfile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.LoadBalancerProfile)(nil), (*LoadBalancerProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_LoadBalancerProfile_To_v1alpha4_LoadBalancerProfile(a.(*v1beta1.LoadBalancerProfile), b.(*LoadBalancerProfile), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*MachineRollingUpdateDeployment)(nil), (*v1beta1.MachineRollingUpdateDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha4_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment(a.(*MachineRollingUpdateDeployment), b.(*v1beta1.MachineRollingUpdateDeployment), scope) }); err != nil { @@ -284,26 +154,6 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ManagedControlPlaneSubnet)(nil), (*v1beta1.ManagedControlPlaneSubnet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(a.(*ManagedControlPlaneSubnet), b.(*v1beta1.ManagedControlPlaneSubnet), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ManagedControlPlaneVirtualNetwork)(nil), (*v1beta1.ManagedControlPlaneVirtualNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(a.(*ManagedControlPlaneVirtualNetwork), b.(*v1beta1.ManagedControlPlaneVirtualNetwork), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*SKU)(nil), (*v1beta1.SKU)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_SKU_To_v1beta1_SKU(a.(*SKU), b.(*v1beta1.SKU), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.SKU)(nil), (*SKU)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_SKU_To_v1alpha4_SKU(a.(*v1beta1.SKU), b.(*SKU), scope) - }); err != nil { - return err - } if err := s.AddConversionFunc((*apiv1alpha4.APIEndpoint)(nil), (*apiv1beta1.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(a.(*apiv1alpha4.APIEndpoint), b.(*apiv1beta1.APIEndpoint), scope) }); err != nil { @@ -339,41 +189,11 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddConversionFunc((*v1beta1.AzureManagedControlPlaneSpec)(nil), (*AzureManagedControlPlaneSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha4_AzureManagedControlPlaneSpec(a.(*v1beta1.AzureManagedControlPlaneSpec), b.(*AzureManagedControlPlaneSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.AzureManagedControlPlaneStatus)(nil), (*AzureManagedControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha4_AzureManagedControlPlaneStatus(a.(*v1beta1.AzureManagedControlPlaneStatus), b.(*AzureManagedControlPlaneStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.AzureManagedMachinePoolSpec)(nil), (*AzureManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha4_AzureManagedMachinePoolSpec(a.(*v1beta1.AzureManagedMachinePoolSpec), b.(*AzureManagedMachinePoolSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.AzureManagedMachinePoolStatus)(nil), (*AzureManagedMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha4_AzureManagedMachinePoolStatus(a.(*v1beta1.AzureManagedMachinePoolStatus), b.(*AzureManagedMachinePoolStatus), scope) - }); err != nil { - return err - } if err := s.AddConversionFunc((*clusterapiproviderazureapiv1beta1.Image)(nil), (*clusterapiproviderazureapiv1alpha4.Image)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_Image_To_v1alpha4_Image(a.(*clusterapiproviderazureapiv1beta1.Image), b.(*clusterapiproviderazureapiv1alpha4.Image), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1beta1.ManagedControlPlaneSubnet)(nil), (*ManagedControlPlaneSubnet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha4_ManagedControlPlaneSubnet(a.(*v1beta1.ManagedControlPlaneSubnet), b.(*ManagedControlPlaneSubnet), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.ManagedControlPlaneVirtualNetwork)(nil), (*ManagedControlPlaneVirtualNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha4_ManagedControlPlaneVirtualNetwork(a.(*v1beta1.ManagedControlPlaneVirtualNetwork), b.(*ManagedControlPlaneVirtualNetwork), scope) - }); err != nil { - return err - } if err := s.AddConversionFunc((*clusterapiproviderazureapiv1beta1.OSDisk)(nil), (*clusterapiproviderazureapiv1alpha4.OSDisk)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_OSDisk_To_v1alpha4_OSDisk(a.(*clusterapiproviderazureapiv1beta1.OSDisk), b.(*clusterapiproviderazureapiv1alpha4.OSDisk), scope) }); err != nil { @@ -387,54 +207,6 @@ func RegisterConversions(s *runtime.Scheme) error { return nil } -func autoConvert_v1alpha4_AADProfile_To_v1beta1_AADProfile(in *AADProfile, out *v1beta1.AADProfile, s conversion.Scope) error { - out.Managed = in.Managed - out.AdminGroupObjectIDs = *(*[]string)(unsafe.Pointer(&in.AdminGroupObjectIDs)) - return nil -} - -// Convert_v1alpha4_AADProfile_To_v1beta1_AADProfile is an autogenerated conversion function. -func Convert_v1alpha4_AADProfile_To_v1beta1_AADProfile(in *AADProfile, out *v1beta1.AADProfile, s conversion.Scope) error { - return autoConvert_v1alpha4_AADProfile_To_v1beta1_AADProfile(in, out, s) -} - -func autoConvert_v1beta1_AADProfile_To_v1alpha4_AADProfile(in *v1beta1.AADProfile, out *AADProfile, s conversion.Scope) error { - out.Managed = in.Managed - out.AdminGroupObjectIDs = *(*[]string)(unsafe.Pointer(&in.AdminGroupObjectIDs)) - return nil -} - -// Convert_v1beta1_AADProfile_To_v1alpha4_AADProfile is an autogenerated conversion function. -func Convert_v1beta1_AADProfile_To_v1alpha4_AADProfile(in *v1beta1.AADProfile, out *AADProfile, s conversion.Scope) error { - return autoConvert_v1beta1_AADProfile_To_v1alpha4_AADProfile(in, out, s) -} - -func autoConvert_v1alpha4_APIServerAccessProfile_To_v1beta1_APIServerAccessProfile(in *APIServerAccessProfile, out *v1beta1.APIServerAccessProfile, s conversion.Scope) error { - out.AuthorizedIPRanges = *(*[]string)(unsafe.Pointer(&in.AuthorizedIPRanges)) - out.EnablePrivateCluster = (*bool)(unsafe.Pointer(in.EnablePrivateCluster)) - out.PrivateDNSZone = (*string)(unsafe.Pointer(in.PrivateDNSZone)) - out.EnablePrivateClusterPublicFQDN = (*bool)(unsafe.Pointer(in.EnablePrivateClusterPublicFQDN)) - return nil -} - -// Convert_v1alpha4_APIServerAccessProfile_To_v1beta1_APIServerAccessProfile is an autogenerated conversion function. -func Convert_v1alpha4_APIServerAccessProfile_To_v1beta1_APIServerAccessProfile(in *APIServerAccessProfile, out *v1beta1.APIServerAccessProfile, s conversion.Scope) error { - return autoConvert_v1alpha4_APIServerAccessProfile_To_v1beta1_APIServerAccessProfile(in, out, s) -} - -func autoConvert_v1beta1_APIServerAccessProfile_To_v1alpha4_APIServerAccessProfile(in *v1beta1.APIServerAccessProfile, out *APIServerAccessProfile, s conversion.Scope) error { - out.AuthorizedIPRanges = *(*[]string)(unsafe.Pointer(&in.AuthorizedIPRanges)) - out.EnablePrivateCluster = (*bool)(unsafe.Pointer(in.EnablePrivateCluster)) - out.PrivateDNSZone = (*string)(unsafe.Pointer(in.PrivateDNSZone)) - out.EnablePrivateClusterPublicFQDN = (*bool)(unsafe.Pointer(in.EnablePrivateClusterPublicFQDN)) - return nil -} - -// Convert_v1beta1_APIServerAccessProfile_To_v1alpha4_APIServerAccessProfile is an autogenerated conversion function. -func Convert_v1beta1_APIServerAccessProfile_To_v1alpha4_APIServerAccessProfile(in *v1beta1.APIServerAccessProfile, out *APIServerAccessProfile, s conversion.Scope) error { - return autoConvert_v1beta1_APIServerAccessProfile_To_v1alpha4_APIServerAccessProfile(in, out, s) -} - func autoConvert_v1alpha4_AzureMachinePool_To_v1beta1_AzureMachinePool(in *AzureMachinePool, out *v1beta1.AzureMachinePool, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_v1alpha4_AzureMachinePoolSpec_To_v1beta1_AzureMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { @@ -843,439 +615,6 @@ func Convert_v1beta1_AzureMachinePoolStatus_To_v1alpha4_AzureMachinePoolStatus(i return autoConvert_v1beta1_AzureMachinePoolStatus_To_v1alpha4_AzureMachinePoolStatus(in, out, s) } -func autoConvert_v1alpha4_AzureManagedCluster_To_v1beta1_AzureManagedCluster(in *AzureManagedCluster, out *v1beta1.AzureManagedCluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_AzureManagedCluster_To_v1beta1_AzureManagedCluster is an autogenerated conversion function. -func Convert_v1alpha4_AzureManagedCluster_To_v1beta1_AzureManagedCluster(in *AzureManagedCluster, out *v1beta1.AzureManagedCluster, s conversion.Scope) error { - return autoConvert_v1alpha4_AzureManagedCluster_To_v1beta1_AzureManagedCluster(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedCluster_To_v1alpha4_AzureManagedCluster(in *v1beta1.AzureManagedCluster, out *AzureManagedCluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_AzureManagedClusterSpec_To_v1alpha4_AzureManagedClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_AzureManagedClusterStatus_To_v1alpha4_AzureManagedClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AzureManagedCluster_To_v1alpha4_AzureManagedCluster is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedCluster_To_v1alpha4_AzureManagedCluster(in *v1beta1.AzureManagedCluster, out *AzureManagedCluster, s conversion.Scope) error { - return autoConvert_v1beta1_AzureManagedCluster_To_v1alpha4_AzureManagedCluster(in, out, s) -} - -func autoConvert_v1alpha4_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(in *AzureManagedClusterList, out *v1beta1.AzureManagedClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.AzureManagedCluster, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_AzureManagedCluster_To_v1beta1_AzureManagedCluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList is an autogenerated conversion function. -func Convert_v1alpha4_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(in *AzureManagedClusterList, out *v1beta1.AzureManagedClusterList, s conversion.Scope) error { - return autoConvert_v1alpha4_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedClusterList_To_v1alpha4_AzureManagedClusterList(in *v1beta1.AzureManagedClusterList, out *AzureManagedClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AzureManagedCluster, len(*in)) - for i := range *in { - if err := Convert_v1beta1_AzureManagedCluster_To_v1alpha4_AzureManagedCluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_AzureManagedClusterList_To_v1alpha4_AzureManagedClusterList is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedClusterList_To_v1alpha4_AzureManagedClusterList(in *v1beta1.AzureManagedClusterList, out *AzureManagedClusterList, s conversion.Scope) error { - return autoConvert_v1beta1_AzureManagedClusterList_To_v1alpha4_AzureManagedClusterList(in, out, s) -} - -func autoConvert_v1alpha4_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(in *AzureManagedClusterSpec, out *v1beta1.AzureManagedClusterSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec is an autogenerated conversion function. -func Convert_v1alpha4_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(in *AzureManagedClusterSpec, out *v1beta1.AzureManagedClusterSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_AzureManagedClusterSpec_To_v1beta1_AzureManagedClusterSpec(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedClusterSpec_To_v1alpha4_AzureManagedClusterSpec(in *v1beta1.AzureManagedClusterSpec, out *AzureManagedClusterSpec, s conversion.Scope) error { - if err := Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AzureManagedClusterSpec_To_v1alpha4_AzureManagedClusterSpec is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedClusterSpec_To_v1alpha4_AzureManagedClusterSpec(in *v1beta1.AzureManagedClusterSpec, out *AzureManagedClusterSpec, s conversion.Scope) error { - return autoConvert_v1beta1_AzureManagedClusterSpec_To_v1alpha4_AzureManagedClusterSpec(in, out, s) -} - -func autoConvert_v1alpha4_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(in *AzureManagedClusterStatus, out *v1beta1.AzureManagedClusterStatus, s conversion.Scope) error { - out.Ready = in.Ready - return nil -} - -// Convert_v1alpha4_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus is an autogenerated conversion function. -func Convert_v1alpha4_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(in *AzureManagedClusterStatus, out *v1beta1.AzureManagedClusterStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_AzureManagedClusterStatus_To_v1beta1_AzureManagedClusterStatus(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedClusterStatus_To_v1alpha4_AzureManagedClusterStatus(in *v1beta1.AzureManagedClusterStatus, out *AzureManagedClusterStatus, s conversion.Scope) error { - out.Ready = in.Ready - return nil -} - -// Convert_v1beta1_AzureManagedClusterStatus_To_v1alpha4_AzureManagedClusterStatus is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedClusterStatus_To_v1alpha4_AzureManagedClusterStatus(in *v1beta1.AzureManagedClusterStatus, out *AzureManagedClusterStatus, s conversion.Scope) error { - return autoConvert_v1beta1_AzureManagedClusterStatus_To_v1alpha4_AzureManagedClusterStatus(in, out, s) -} - -func autoConvert_v1alpha4_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(in *AzureManagedControlPlane, out *v1beta1.AzureManagedControlPlane, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane is an autogenerated conversion function. -func Convert_v1alpha4_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(in *AzureManagedControlPlane, out *v1beta1.AzureManagedControlPlane, s conversion.Scope) error { - return autoConvert_v1alpha4_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedControlPlane_To_v1alpha4_AzureManagedControlPlane(in *v1beta1.AzureManagedControlPlane, out *AzureManagedControlPlane, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha4_AzureManagedControlPlaneSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha4_AzureManagedControlPlaneStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AzureManagedControlPlane_To_v1alpha4_AzureManagedControlPlane is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedControlPlane_To_v1alpha4_AzureManagedControlPlane(in *v1beta1.AzureManagedControlPlane, out *AzureManagedControlPlane, s conversion.Scope) error { - return autoConvert_v1beta1_AzureManagedControlPlane_To_v1alpha4_AzureManagedControlPlane(in, out, s) -} - -func autoConvert_v1alpha4_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(in *AzureManagedControlPlaneList, out *v1beta1.AzureManagedControlPlaneList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.AzureManagedControlPlane, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList is an autogenerated conversion function. -func Convert_v1alpha4_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(in *AzureManagedControlPlaneList, out *v1beta1.AzureManagedControlPlaneList, s conversion.Scope) error { - return autoConvert_v1alpha4_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedControlPlaneList_To_v1alpha4_AzureManagedControlPlaneList(in *v1beta1.AzureManagedControlPlaneList, out *AzureManagedControlPlaneList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AzureManagedControlPlane, len(*in)) - for i := range *in { - if err := Convert_v1beta1_AzureManagedControlPlane_To_v1alpha4_AzureManagedControlPlane(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_AzureManagedControlPlaneList_To_v1alpha4_AzureManagedControlPlaneList is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedControlPlaneList_To_v1alpha4_AzureManagedControlPlaneList(in *v1beta1.AzureManagedControlPlaneList, out *AzureManagedControlPlaneList, s conversion.Scope) error { - return autoConvert_v1beta1_AzureManagedControlPlaneList_To_v1alpha4_AzureManagedControlPlaneList(in, out, s) -} - -func autoConvert_v1alpha4_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(in *AzureManagedControlPlaneSpec, out *v1beta1.AzureManagedControlPlaneSpec, s conversion.Scope) error { - out.Version = in.Version - out.ResourceGroupName = in.ResourceGroupName - out.NodeResourceGroupName = in.NodeResourceGroupName - if err := Convert_v1alpha4_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(&in.VirtualNetwork, &out.VirtualNetwork, s); err != nil { - return err - } - out.SubscriptionID = in.SubscriptionID - out.Location = in.Location - if err := Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { - return err - } - out.AdditionalTags = *(*clusterapiproviderazureapiv1beta1.Tags)(unsafe.Pointer(&in.AdditionalTags)) - out.NetworkPlugin = (*string)(unsafe.Pointer(in.NetworkPlugin)) - out.NetworkPolicy = (*string)(unsafe.Pointer(in.NetworkPolicy)) - out.SSHPublicKey = in.SSHPublicKey - out.DNSServiceIP = (*string)(unsafe.Pointer(in.DNSServiceIP)) - out.LoadBalancerSKU = (*string)(unsafe.Pointer(in.LoadBalancerSKU)) - out.IdentityRef = (*v1.ObjectReference)(unsafe.Pointer(in.IdentityRef)) - out.AADProfile = (*v1beta1.AADProfile)(unsafe.Pointer(in.AADProfile)) - out.SKU = (*v1beta1.SKU)(unsafe.Pointer(in.SKU)) - out.LoadBalancerProfile = (*v1beta1.LoadBalancerProfile)(unsafe.Pointer(in.LoadBalancerProfile)) - out.APIServerAccessProfile = (*v1beta1.APIServerAccessProfile)(unsafe.Pointer(in.APIServerAccessProfile)) - return nil -} - -// Convert_v1alpha4_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec is an autogenerated conversion function. -func Convert_v1alpha4_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(in *AzureManagedControlPlaneSpec, out *v1beta1.AzureManagedControlPlaneSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_AzureManagedControlPlaneSpec_To_v1beta1_AzureManagedControlPlaneSpec(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha4_AzureManagedControlPlaneSpec(in *v1beta1.AzureManagedControlPlaneSpec, out *AzureManagedControlPlaneSpec, s conversion.Scope) error { - out.Version = in.Version - out.ResourceGroupName = in.ResourceGroupName - out.NodeResourceGroupName = in.NodeResourceGroupName - if err := Convert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha4_ManagedControlPlaneVirtualNetwork(&in.VirtualNetwork, &out.VirtualNetwork, s); err != nil { - return err - } - out.SubscriptionID = in.SubscriptionID - out.Location = in.Location - if err := Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { - return err - } - out.AdditionalTags = *(*clusterapiproviderazureapiv1alpha4.Tags)(unsafe.Pointer(&in.AdditionalTags)) - out.NetworkPlugin = (*string)(unsafe.Pointer(in.NetworkPlugin)) - out.NetworkPolicy = (*string)(unsafe.Pointer(in.NetworkPolicy)) - out.SSHPublicKey = in.SSHPublicKey - out.DNSServiceIP = (*string)(unsafe.Pointer(in.DNSServiceIP)) - out.LoadBalancerSKU = (*string)(unsafe.Pointer(in.LoadBalancerSKU)) - out.IdentityRef = (*v1.ObjectReference)(unsafe.Pointer(in.IdentityRef)) - out.AADProfile = (*AADProfile)(unsafe.Pointer(in.AADProfile)) - // WARNING: in.AddonProfiles requires manual conversion: does not exist in peer-type - out.SKU = (*SKU)(unsafe.Pointer(in.SKU)) - out.LoadBalancerProfile = (*LoadBalancerProfile)(unsafe.Pointer(in.LoadBalancerProfile)) - out.APIServerAccessProfile = (*APIServerAccessProfile)(unsafe.Pointer(in.APIServerAccessProfile)) - // WARNING: in.AutoScalerProfile requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(in *AzureManagedControlPlaneStatus, out *v1beta1.AzureManagedControlPlaneStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Initialized = in.Initialized - out.LongRunningOperationStates = *(*clusterapiproviderazureapiv1beta1.Futures)(unsafe.Pointer(&in.LongRunningOperationStates)) - return nil -} - -// Convert_v1alpha4_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus is an autogenerated conversion function. -func Convert_v1alpha4_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(in *AzureManagedControlPlaneStatus, out *v1beta1.AzureManagedControlPlaneStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_AzureManagedControlPlaneStatus_To_v1beta1_AzureManagedControlPlaneStatus(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha4_AzureManagedControlPlaneStatus(in *v1beta1.AzureManagedControlPlaneStatus, out *AzureManagedControlPlaneStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Initialized = in.Initialized - // WARNING: in.Conditions requires manual conversion: does not exist in peer-type - out.LongRunningOperationStates = *(*clusterapiproviderazureapiv1alpha4.Futures)(unsafe.Pointer(&in.LongRunningOperationStates)) - return nil -} - -func autoConvert_v1alpha4_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(in *AzureManagedMachinePool, out *v1beta1.AzureManagedMachinePool, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool is an autogenerated conversion function. -func Convert_v1alpha4_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(in *AzureManagedMachinePool, out *v1beta1.AzureManagedMachinePool, s conversion.Scope) error { - return autoConvert_v1alpha4_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedMachinePool_To_v1alpha4_AzureManagedMachinePool(in *v1beta1.AzureManagedMachinePool, out *AzureManagedMachinePool, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha4_AzureManagedMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha4_AzureManagedMachinePoolStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AzureManagedMachinePool_To_v1alpha4_AzureManagedMachinePool is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedMachinePool_To_v1alpha4_AzureManagedMachinePool(in *v1beta1.AzureManagedMachinePool, out *AzureManagedMachinePool, s conversion.Scope) error { - return autoConvert_v1beta1_AzureManagedMachinePool_To_v1alpha4_AzureManagedMachinePool(in, out, s) -} - -func autoConvert_v1alpha4_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(in *AzureManagedMachinePoolList, out *v1beta1.AzureManagedMachinePoolList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.AzureManagedMachinePool, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList is an autogenerated conversion function. -func Convert_v1alpha4_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(in *AzureManagedMachinePoolList, out *v1beta1.AzureManagedMachinePoolList, s conversion.Scope) error { - return autoConvert_v1alpha4_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedMachinePoolList_To_v1alpha4_AzureManagedMachinePoolList(in *v1beta1.AzureManagedMachinePoolList, out *AzureManagedMachinePoolList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AzureManagedMachinePool, len(*in)) - for i := range *in { - if err := Convert_v1beta1_AzureManagedMachinePool_To_v1alpha4_AzureManagedMachinePool(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_AzureManagedMachinePoolList_To_v1alpha4_AzureManagedMachinePoolList is an autogenerated conversion function. -func Convert_v1beta1_AzureManagedMachinePoolList_To_v1alpha4_AzureManagedMachinePoolList(in *v1beta1.AzureManagedMachinePoolList, out *AzureManagedMachinePoolList, s conversion.Scope) error { - return autoConvert_v1beta1_AzureManagedMachinePoolList_To_v1alpha4_AzureManagedMachinePoolList(in, out, s) -} - -func autoConvert_v1alpha4_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(in *AzureManagedMachinePoolSpec, out *v1beta1.AzureManagedMachinePoolSpec, s conversion.Scope) error { - out.Name = (*string)(unsafe.Pointer(in.Name)) - out.Mode = in.Mode - out.SKU = in.SKU - out.OSDiskSizeGB = (*int32)(unsafe.Pointer(in.OSDiskSizeGB)) - out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) - return nil -} - -// Convert_v1alpha4_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec is an autogenerated conversion function. -func Convert_v1alpha4_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(in *AzureManagedMachinePoolSpec, out *v1beta1.AzureManagedMachinePoolSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_AzureManagedMachinePoolSpec_To_v1beta1_AzureManagedMachinePoolSpec(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha4_AzureManagedMachinePoolSpec(in *v1beta1.AzureManagedMachinePoolSpec, out *AzureManagedMachinePoolSpec, s conversion.Scope) error { - // WARNING: in.AdditionalTags requires manual conversion: does not exist in peer-type - out.Name = (*string)(unsafe.Pointer(in.Name)) - out.Mode = in.Mode - out.SKU = in.SKU - out.OSDiskSizeGB = (*int32)(unsafe.Pointer(in.OSDiskSizeGB)) - // WARNING: in.AvailabilityZones requires manual conversion: does not exist in peer-type - // WARNING: in.NodeLabels requires manual conversion: does not exist in peer-type - // WARNING: in.Taints requires manual conversion: does not exist in peer-type - out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) - // WARNING: in.Scaling requires manual conversion: does not exist in peer-type - // WARNING: in.MaxPods requires manual conversion: does not exist in peer-type - // WARNING: in.OsDiskType requires manual conversion: does not exist in peer-type - // WARNING: in.EnableUltraSSD requires manual conversion: does not exist in peer-type - // WARNING: in.OSType requires manual conversion: does not exist in peer-type - // WARNING: in.EnableNodePublicIP requires manual conversion: does not exist in peer-type - // WARNING: in.NodePublicIPPrefixID requires manual conversion: does not exist in peer-type - // WARNING: in.ScaleSetPriority requires manual conversion: does not exist in peer-type - // WARNING: in.KubeletConfig requires manual conversion: does not exist in peer-type - // WARNING: in.KubeletDiskType requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(in *AzureManagedMachinePoolStatus, out *v1beta1.AzureManagedMachinePoolStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Replicas = in.Replicas - out.ErrorReason = (*errors.MachineStatusError)(unsafe.Pointer(in.ErrorReason)) - out.ErrorMessage = (*string)(unsafe.Pointer(in.ErrorMessage)) - return nil -} - -// Convert_v1alpha4_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus is an autogenerated conversion function. -func Convert_v1alpha4_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(in *AzureManagedMachinePoolStatus, out *v1beta1.AzureManagedMachinePoolStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_AzureManagedMachinePoolStatus_To_v1beta1_AzureManagedMachinePoolStatus(in, out, s) -} - -func autoConvert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha4_AzureManagedMachinePoolStatus(in *v1beta1.AzureManagedMachinePoolStatus, out *AzureManagedMachinePoolStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Replicas = in.Replicas - out.ErrorReason = (*errors.MachineStatusError)(unsafe.Pointer(in.ErrorReason)) - out.ErrorMessage = (*string)(unsafe.Pointer(in.ErrorMessage)) - // WARNING: in.Conditions requires manual conversion: does not exist in peer-type - // WARNING: in.LongRunningOperationStates requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_LoadBalancerProfile_To_v1beta1_LoadBalancerProfile(in *LoadBalancerProfile, out *v1beta1.LoadBalancerProfile, s conversion.Scope) error { - out.ManagedOutboundIPs = (*int32)(unsafe.Pointer(in.ManagedOutboundIPs)) - out.OutboundIPPrefixes = *(*[]string)(unsafe.Pointer(&in.OutboundIPPrefixes)) - out.OutboundIPs = *(*[]string)(unsafe.Pointer(&in.OutboundIPs)) - out.AllocatedOutboundPorts = (*int32)(unsafe.Pointer(in.AllocatedOutboundPorts)) - out.IdleTimeoutInMinutes = (*int32)(unsafe.Pointer(in.IdleTimeoutInMinutes)) - return nil -} - -// Convert_v1alpha4_LoadBalancerProfile_To_v1beta1_LoadBalancerProfile is an autogenerated conversion function. -func Convert_v1alpha4_LoadBalancerProfile_To_v1beta1_LoadBalancerProfile(in *LoadBalancerProfile, out *v1beta1.LoadBalancerProfile, s conversion.Scope) error { - return autoConvert_v1alpha4_LoadBalancerProfile_To_v1beta1_LoadBalancerProfile(in, out, s) -} - -func autoConvert_v1beta1_LoadBalancerProfile_To_v1alpha4_LoadBalancerProfile(in *v1beta1.LoadBalancerProfile, out *LoadBalancerProfile, s conversion.Scope) error { - out.ManagedOutboundIPs = (*int32)(unsafe.Pointer(in.ManagedOutboundIPs)) - out.OutboundIPPrefixes = *(*[]string)(unsafe.Pointer(&in.OutboundIPPrefixes)) - out.OutboundIPs = *(*[]string)(unsafe.Pointer(&in.OutboundIPs)) - out.AllocatedOutboundPorts = (*int32)(unsafe.Pointer(in.AllocatedOutboundPorts)) - out.IdleTimeoutInMinutes = (*int32)(unsafe.Pointer(in.IdleTimeoutInMinutes)) - return nil -} - -// Convert_v1beta1_LoadBalancerProfile_To_v1alpha4_LoadBalancerProfile is an autogenerated conversion function. -func Convert_v1beta1_LoadBalancerProfile_To_v1alpha4_LoadBalancerProfile(in *v1beta1.LoadBalancerProfile, out *LoadBalancerProfile, s conversion.Scope) error { - return autoConvert_v1beta1_LoadBalancerProfile_To_v1alpha4_LoadBalancerProfile(in, out, s) -} - func autoConvert_v1alpha4_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment(in *MachineRollingUpdateDeployment, out *v1beta1.MachineRollingUpdateDeployment, s conversion.Scope) error { out.MaxUnavailable = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUnavailable)) out.MaxSurge = (*intstr.IntOrString)(unsafe.Pointer(in.MaxSurge)) @@ -1299,65 +638,3 @@ func autoConvert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha4_MachineRolli func Convert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment(in *v1beta1.MachineRollingUpdateDeployment, out *MachineRollingUpdateDeployment, s conversion.Scope) error { return autoConvert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment(in, out, s) } - -func autoConvert_v1alpha4_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(in *ManagedControlPlaneSubnet, out *v1beta1.ManagedControlPlaneSubnet, s conversion.Scope) error { - out.Name = in.Name - out.CIDRBlock = in.CIDRBlock - return nil -} - -// Convert_v1alpha4_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet is an autogenerated conversion function. -func Convert_v1alpha4_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(in *ManagedControlPlaneSubnet, out *v1beta1.ManagedControlPlaneSubnet, s conversion.Scope) error { - return autoConvert_v1alpha4_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(in, out, s) -} - -func autoConvert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha4_ManagedControlPlaneSubnet(in *v1beta1.ManagedControlPlaneSubnet, out *ManagedControlPlaneSubnet, s conversion.Scope) error { - out.Name = in.Name - out.CIDRBlock = in.CIDRBlock - // WARNING: in.ServiceEndpoints requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(in *ManagedControlPlaneVirtualNetwork, out *v1beta1.ManagedControlPlaneVirtualNetwork, s conversion.Scope) error { - out.Name = in.Name - out.CIDRBlock = in.CIDRBlock - if err := Convert_v1alpha4_ManagedControlPlaneSubnet_To_v1beta1_ManagedControlPlaneSubnet(&in.Subnet, &out.Subnet, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork is an autogenerated conversion function. -func Convert_v1alpha4_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(in *ManagedControlPlaneVirtualNetwork, out *v1beta1.ManagedControlPlaneVirtualNetwork, s conversion.Scope) error { - return autoConvert_v1alpha4_ManagedControlPlaneVirtualNetwork_To_v1beta1_ManagedControlPlaneVirtualNetwork(in, out, s) -} - -func autoConvert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha4_ManagedControlPlaneVirtualNetwork(in *v1beta1.ManagedControlPlaneVirtualNetwork, out *ManagedControlPlaneVirtualNetwork, s conversion.Scope) error { - out.Name = in.Name - out.CIDRBlock = in.CIDRBlock - if err := Convert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha4_ManagedControlPlaneSubnet(&in.Subnet, &out.Subnet, s); err != nil { - return err - } - // WARNING: in.ResourceGroup requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_SKU_To_v1beta1_SKU(in *SKU, out *v1beta1.SKU, s conversion.Scope) error { - out.Tier = v1beta1.AzureManagedControlPlaneSkuTier(in.Tier) - return nil -} - -// Convert_v1alpha4_SKU_To_v1beta1_SKU is an autogenerated conversion function. -func Convert_v1alpha4_SKU_To_v1beta1_SKU(in *SKU, out *v1beta1.SKU, s conversion.Scope) error { - return autoConvert_v1alpha4_SKU_To_v1beta1_SKU(in, out, s) -} - -func autoConvert_v1beta1_SKU_To_v1alpha4_SKU(in *v1beta1.SKU, out *SKU, s conversion.Scope) error { - out.Tier = string(in.Tier) - return nil -} - -// Convert_v1beta1_SKU_To_v1alpha4_SKU is an autogenerated conversion function. -func Convert_v1beta1_SKU_To_v1alpha4_SKU(in *v1beta1.SKU, out *SKU, s conversion.Scope) error { - return autoConvert_v1beta1_SKU_To_v1alpha4_SKU(in, out, s) -} diff --git a/exp/api/v1alpha4/zz_generated.deepcopy.go b/exp/api/v1alpha4/zz_generated.deepcopy.go index 56fba3899c4..ca62d6534f9 100644 --- a/exp/api/v1alpha4/zz_generated.deepcopy.go +++ b/exp/api/v1alpha4/zz_generated.deepcopy.go @@ -31,61 +31,6 @@ import ( "sigs.k8s.io/cluster-api/errors" ) -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AADProfile) DeepCopyInto(out *AADProfile) { - *out = *in - if in.AdminGroupObjectIDs != nil { - in, out := &in.AdminGroupObjectIDs, &out.AdminGroupObjectIDs - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AADProfile. -func (in *AADProfile) DeepCopy() *AADProfile { - if in == nil { - return nil - } - out := new(AADProfile) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIServerAccessProfile) DeepCopyInto(out *APIServerAccessProfile) { - *out = *in - if in.AuthorizedIPRanges != nil { - in, out := &in.AuthorizedIPRanges, &out.AuthorizedIPRanges - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.EnablePrivateCluster != nil { - in, out := &in.EnablePrivateCluster, &out.EnablePrivateCluster - *out = new(bool) - **out = **in - } - if in.PrivateDNSZone != nil { - in, out := &in.PrivateDNSZone, &out.PrivateDNSZone - *out = new(string) - **out = **in - } - if in.EnablePrivateClusterPublicFQDN != nil { - in, out := &in.EnablePrivateClusterPublicFQDN, &out.EnablePrivateClusterPublicFQDN - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIServerAccessProfile. -func (in *APIServerAccessProfile) DeepCopy() *APIServerAccessProfile { - if in == nil { - return nil - } - out := new(APIServerAccessProfile) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AzureMachinePool) DeepCopyInto(out *AzureMachinePool) { *out = *in @@ -451,398 +396,6 @@ func (in *AzureMachinePoolStatus) DeepCopy() *AzureMachinePoolStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedCluster) DeepCopyInto(out *AzureManagedCluster) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedCluster. -func (in *AzureManagedCluster) DeepCopy() *AzureManagedCluster { - if in == nil { - return nil - } - out := new(AzureManagedCluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureManagedCluster) 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 *AzureManagedClusterList) DeepCopyInto(out *AzureManagedClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AzureManagedCluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterList. -func (in *AzureManagedClusterList) DeepCopy() *AzureManagedClusterList { - if in == nil { - return nil - } - out := new(AzureManagedClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureManagedClusterList) 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 *AzureManagedClusterSpec) DeepCopyInto(out *AzureManagedClusterSpec) { - *out = *in - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterSpec. -func (in *AzureManagedClusterSpec) DeepCopy() *AzureManagedClusterSpec { - if in == nil { - return nil - } - out := new(AzureManagedClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedClusterStatus) DeepCopyInto(out *AzureManagedClusterStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterStatus. -func (in *AzureManagedClusterStatus) DeepCopy() *AzureManagedClusterStatus { - if in == nil { - return nil - } - out := new(AzureManagedClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedControlPlane) DeepCopyInto(out *AzureManagedControlPlane) { - *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 AzureManagedControlPlane. -func (in *AzureManagedControlPlane) DeepCopy() *AzureManagedControlPlane { - if in == nil { - return nil - } - out := new(AzureManagedControlPlane) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureManagedControlPlane) 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 *AzureManagedControlPlaneList) DeepCopyInto(out *AzureManagedControlPlaneList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AzureManagedControlPlane, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneList. -func (in *AzureManagedControlPlaneList) DeepCopy() *AzureManagedControlPlaneList { - if in == nil { - return nil - } - out := new(AzureManagedControlPlaneList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureManagedControlPlaneList) 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 *AzureManagedControlPlaneSpec) DeepCopyInto(out *AzureManagedControlPlaneSpec) { - *out = *in - out.VirtualNetwork = in.VirtualNetwork - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if in.AdditionalTags != nil { - in, out := &in.AdditionalTags, &out.AdditionalTags - *out = make(apiv1alpha4.Tags, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.NetworkPlugin != nil { - in, out := &in.NetworkPlugin, &out.NetworkPlugin - *out = new(string) - **out = **in - } - if in.NetworkPolicy != nil { - in, out := &in.NetworkPolicy, &out.NetworkPolicy - *out = new(string) - **out = **in - } - if in.DNSServiceIP != nil { - in, out := &in.DNSServiceIP, &out.DNSServiceIP - *out = new(string) - **out = **in - } - if in.LoadBalancerSKU != nil { - in, out := &in.LoadBalancerSKU, &out.LoadBalancerSKU - *out = new(string) - **out = **in - } - if in.IdentityRef != nil { - in, out := &in.IdentityRef, &out.IdentityRef - *out = new(corev1.ObjectReference) - **out = **in - } - if in.AADProfile != nil { - in, out := &in.AADProfile, &out.AADProfile - *out = new(AADProfile) - (*in).DeepCopyInto(*out) - } - if in.SKU != nil { - in, out := &in.SKU, &out.SKU - *out = new(SKU) - **out = **in - } - if in.LoadBalancerProfile != nil { - in, out := &in.LoadBalancerProfile, &out.LoadBalancerProfile - *out = new(LoadBalancerProfile) - (*in).DeepCopyInto(*out) - } - if in.APIServerAccessProfile != nil { - in, out := &in.APIServerAccessProfile, &out.APIServerAccessProfile - *out = new(APIServerAccessProfile) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneSpec. -func (in *AzureManagedControlPlaneSpec) DeepCopy() *AzureManagedControlPlaneSpec { - if in == nil { - return nil - } - out := new(AzureManagedControlPlaneSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedControlPlaneStatus) DeepCopyInto(out *AzureManagedControlPlaneStatus) { - *out = *in - if in.LongRunningOperationStates != nil { - in, out := &in.LongRunningOperationStates, &out.LongRunningOperationStates - *out = make(apiv1alpha4.Futures, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneStatus. -func (in *AzureManagedControlPlaneStatus) DeepCopy() *AzureManagedControlPlaneStatus { - if in == nil { - return nil - } - out := new(AzureManagedControlPlaneStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedMachinePool) DeepCopyInto(out *AzureManagedMachinePool) { - *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 AzureManagedMachinePool. -func (in *AzureManagedMachinePool) DeepCopy() *AzureManagedMachinePool { - if in == nil { - return nil - } - out := new(AzureManagedMachinePool) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureManagedMachinePool) 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 *AzureManagedMachinePoolList) DeepCopyInto(out *AzureManagedMachinePoolList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AzureManagedMachinePool, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolList. -func (in *AzureManagedMachinePoolList) DeepCopy() *AzureManagedMachinePoolList { - if in == nil { - return nil - } - out := new(AzureManagedMachinePoolList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureManagedMachinePoolList) 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 *AzureManagedMachinePoolSpec) DeepCopyInto(out *AzureManagedMachinePoolSpec) { - *out = *in - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(string) - **out = **in - } - if in.OSDiskSizeGB != nil { - in, out := &in.OSDiskSizeGB, &out.OSDiskSizeGB - *out = new(int32) - **out = **in - } - if in.ProviderIDList != nil { - in, out := &in.ProviderIDList, &out.ProviderIDList - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolSpec. -func (in *AzureManagedMachinePoolSpec) DeepCopy() *AzureManagedMachinePoolSpec { - if in == nil { - return nil - } - out := new(AzureManagedMachinePoolSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedMachinePoolStatus) DeepCopyInto(out *AzureManagedMachinePoolStatus) { - *out = *in - if in.ErrorReason != nil { - in, out := &in.ErrorReason, &out.ErrorReason - *out = new(errors.MachineStatusError) - **out = **in - } - if in.ErrorMessage != nil { - in, out := &in.ErrorMessage, &out.ErrorMessage - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolStatus. -func (in *AzureManagedMachinePoolStatus) DeepCopy() *AzureManagedMachinePoolStatus { - if in == nil { - return nil - } - out := new(AzureManagedMachinePoolStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LoadBalancerProfile) DeepCopyInto(out *LoadBalancerProfile) { - *out = *in - if in.ManagedOutboundIPs != nil { - in, out := &in.ManagedOutboundIPs, &out.ManagedOutboundIPs - *out = new(int32) - **out = **in - } - if in.OutboundIPPrefixes != nil { - in, out := &in.OutboundIPPrefixes, &out.OutboundIPPrefixes - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.OutboundIPs != nil { - in, out := &in.OutboundIPs, &out.OutboundIPs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.AllocatedOutboundPorts != nil { - in, out := &in.AllocatedOutboundPorts, &out.AllocatedOutboundPorts - *out = new(int32) - **out = **in - } - if in.IdleTimeoutInMinutes != nil { - in, out := &in.IdleTimeoutInMinutes, &out.IdleTimeoutInMinutes - *out = new(int32) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerProfile. -func (in *LoadBalancerProfile) DeepCopy() *LoadBalancerProfile { - if in == nil { - return nil - } - out := new(LoadBalancerProfile) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MachineRollingUpdateDeployment) DeepCopyInto(out *MachineRollingUpdateDeployment) { *out = *in @@ -867,49 +420,3 @@ func (in *MachineRollingUpdateDeployment) DeepCopy() *MachineRollingUpdateDeploy in.DeepCopyInto(out) return out } - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManagedControlPlaneSubnet) DeepCopyInto(out *ManagedControlPlaneSubnet) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedControlPlaneSubnet. -func (in *ManagedControlPlaneSubnet) DeepCopy() *ManagedControlPlaneSubnet { - if in == nil { - return nil - } - out := new(ManagedControlPlaneSubnet) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManagedControlPlaneVirtualNetwork) DeepCopyInto(out *ManagedControlPlaneVirtualNetwork) { - *out = *in - out.Subnet = in.Subnet -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedControlPlaneVirtualNetwork. -func (in *ManagedControlPlaneVirtualNetwork) DeepCopy() *ManagedControlPlaneVirtualNetwork { - if in == nil { - return nil - } - out := new(ManagedControlPlaneVirtualNetwork) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SKU) DeepCopyInto(out *SKU) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SKU. -func (in *SKU) DeepCopy() *SKU { - if in == nil { - return nil - } - out := new(SKU) - in.DeepCopyInto(out) - return out -} diff --git a/exp/api/v1beta1/zz_generated.deepcopy.go b/exp/api/v1beta1/zz_generated.deepcopy.go index b48a176a9e1..d5e5f243093 100644 --- a/exp/api/v1beta1/zz_generated.deepcopy.go +++ b/exp/api/v1beta1/zz_generated.deepcopy.go @@ -31,183 +31,6 @@ import ( "sigs.k8s.io/cluster-api/errors" ) -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AADProfile) DeepCopyInto(out *AADProfile) { - *out = *in - if in.AdminGroupObjectIDs != nil { - in, out := &in.AdminGroupObjectIDs, &out.AdminGroupObjectIDs - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AADProfile. -func (in *AADProfile) DeepCopy() *AADProfile { - if in == nil { - return nil - } - out := new(AADProfile) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIServerAccessProfile) DeepCopyInto(out *APIServerAccessProfile) { - *out = *in - if in.AuthorizedIPRanges != nil { - in, out := &in.AuthorizedIPRanges, &out.AuthorizedIPRanges - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.EnablePrivateCluster != nil { - in, out := &in.EnablePrivateCluster, &out.EnablePrivateCluster - *out = new(bool) - **out = **in - } - if in.PrivateDNSZone != nil { - in, out := &in.PrivateDNSZone, &out.PrivateDNSZone - *out = new(string) - **out = **in - } - if in.EnablePrivateClusterPublicFQDN != nil { - in, out := &in.EnablePrivateClusterPublicFQDN, &out.EnablePrivateClusterPublicFQDN - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIServerAccessProfile. -func (in *APIServerAccessProfile) DeepCopy() *APIServerAccessProfile { - if in == nil { - return nil - } - out := new(APIServerAccessProfile) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AddonProfile) DeepCopyInto(out *AddonProfile) { - *out = *in - if in.Config != nil { - in, out := &in.Config, &out.Config - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddonProfile. -func (in *AddonProfile) DeepCopy() *AddonProfile { - if in == nil { - return nil - } - out := new(AddonProfile) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AutoScalerProfile) DeepCopyInto(out *AutoScalerProfile) { - *out = *in - if in.BalanceSimilarNodeGroups != nil { - in, out := &in.BalanceSimilarNodeGroups, &out.BalanceSimilarNodeGroups - *out = new(BalanceSimilarNodeGroups) - **out = **in - } - if in.Expander != nil { - in, out := &in.Expander, &out.Expander - *out = new(Expander) - **out = **in - } - if in.MaxEmptyBulkDelete != nil { - in, out := &in.MaxEmptyBulkDelete, &out.MaxEmptyBulkDelete - *out = new(string) - **out = **in - } - if in.MaxGracefulTerminationSec != nil { - in, out := &in.MaxGracefulTerminationSec, &out.MaxGracefulTerminationSec - *out = new(string) - **out = **in - } - if in.MaxNodeProvisionTime != nil { - in, out := &in.MaxNodeProvisionTime, &out.MaxNodeProvisionTime - *out = new(string) - **out = **in - } - if in.MaxTotalUnreadyPercentage != nil { - in, out := &in.MaxTotalUnreadyPercentage, &out.MaxTotalUnreadyPercentage - *out = new(string) - **out = **in - } - if in.NewPodScaleUpDelay != nil { - in, out := &in.NewPodScaleUpDelay, &out.NewPodScaleUpDelay - *out = new(string) - **out = **in - } - if in.OkTotalUnreadyCount != nil { - in, out := &in.OkTotalUnreadyCount, &out.OkTotalUnreadyCount - *out = new(string) - **out = **in - } - if in.ScanInterval != nil { - in, out := &in.ScanInterval, &out.ScanInterval - *out = new(string) - **out = **in - } - if in.ScaleDownDelayAfterAdd != nil { - in, out := &in.ScaleDownDelayAfterAdd, &out.ScaleDownDelayAfterAdd - *out = new(string) - **out = **in - } - if in.ScaleDownDelayAfterDelete != nil { - in, out := &in.ScaleDownDelayAfterDelete, &out.ScaleDownDelayAfterDelete - *out = new(string) - **out = **in - } - if in.ScaleDownDelayAfterFailure != nil { - in, out := &in.ScaleDownDelayAfterFailure, &out.ScaleDownDelayAfterFailure - *out = new(string) - **out = **in - } - if in.ScaleDownUnneededTime != nil { - in, out := &in.ScaleDownUnneededTime, &out.ScaleDownUnneededTime - *out = new(string) - **out = **in - } - if in.ScaleDownUnreadyTime != nil { - in, out := &in.ScaleDownUnreadyTime, &out.ScaleDownUnreadyTime - *out = new(string) - **out = **in - } - if in.ScaleDownUtilizationThreshold != nil { - in, out := &in.ScaleDownUtilizationThreshold, &out.ScaleDownUtilizationThreshold - *out = new(string) - **out = **in - } - if in.SkipNodesWithLocalStorage != nil { - in, out := &in.SkipNodesWithLocalStorage, &out.SkipNodesWithLocalStorage - *out = new(SkipNodesWithLocalStorage) - **out = **in - } - if in.SkipNodesWithSystemPods != nil { - in, out := &in.SkipNodesWithSystemPods, &out.SkipNodesWithSystemPods - *out = new(SkipNodesWithSystemPods) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoScalerProfile. -func (in *AutoScalerProfile) DeepCopy() *AutoScalerProfile { - if in == nil { - return nil - } - out := new(AutoScalerProfile) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AzureMachinePool) DeepCopyInto(out *AzureMachinePool) { *out = *in @@ -593,705 +416,26 @@ func (in *AzureMachinePoolStatus) DeepCopy() *AzureMachinePoolStatus { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedCluster) DeepCopyInto(out *AzureManagedCluster) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedCluster. -func (in *AzureManagedCluster) DeepCopy() *AzureManagedCluster { - if in == nil { - return nil - } - out := new(AzureManagedCluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureManagedCluster) 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 *AzureManagedClusterList) DeepCopyInto(out *AzureManagedClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AzureManagedCluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterList. -func (in *AzureManagedClusterList) DeepCopy() *AzureManagedClusterList { - if in == nil { - return nil - } - out := new(AzureManagedClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureManagedClusterList) 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 *AzureManagedClusterSpec) DeepCopyInto(out *AzureManagedClusterSpec) { - *out = *in - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterSpec. -func (in *AzureManagedClusterSpec) DeepCopy() *AzureManagedClusterSpec { - if in == nil { - return nil - } - out := new(AzureManagedClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedClusterStatus) DeepCopyInto(out *AzureManagedClusterStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedClusterStatus. -func (in *AzureManagedClusterStatus) DeepCopy() *AzureManagedClusterStatus { - if in == nil { - return nil - } - out := new(AzureManagedClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedControlPlane) DeepCopyInto(out *AzureManagedControlPlane) { +func (in *MachineRollingUpdateDeployment) DeepCopyInto(out *MachineRollingUpdateDeployment) { *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 AzureManagedControlPlane. -func (in *AzureManagedControlPlane) DeepCopy() *AzureManagedControlPlane { - if in == nil { - return nil - } - out := new(AzureManagedControlPlane) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureManagedControlPlane) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c + if in.MaxUnavailable != nil { + in, out := &in.MaxUnavailable, &out.MaxUnavailable + *out = new(intstr.IntOrString) + **out = **in } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedControlPlaneList) DeepCopyInto(out *AzureManagedControlPlaneList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AzureManagedControlPlane, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + if in.MaxSurge != nil { + in, out := &in.MaxSurge, &out.MaxSurge + *out = new(intstr.IntOrString) + **out = **in } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneList. -func (in *AzureManagedControlPlaneList) DeepCopy() *AzureManagedControlPlaneList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineRollingUpdateDeployment. +func (in *MachineRollingUpdateDeployment) DeepCopy() *MachineRollingUpdateDeployment { if in == nil { return nil } - out := new(AzureManagedControlPlaneList) + out := new(MachineRollingUpdateDeployment) in.DeepCopyInto(out) return out } - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureManagedControlPlaneList) 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 *AzureManagedControlPlaneSpec) DeepCopyInto(out *AzureManagedControlPlaneSpec) { - *out = *in - in.VirtualNetwork.DeepCopyInto(&out.VirtualNetwork) - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if in.AdditionalTags != nil { - in, out := &in.AdditionalTags, &out.AdditionalTags - *out = make(apiv1beta1.Tags, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.NetworkPlugin != nil { - in, out := &in.NetworkPlugin, &out.NetworkPlugin - *out = new(string) - **out = **in - } - if in.NetworkPolicy != nil { - in, out := &in.NetworkPolicy, &out.NetworkPolicy - *out = new(string) - **out = **in - } - if in.DNSServiceIP != nil { - in, out := &in.DNSServiceIP, &out.DNSServiceIP - *out = new(string) - **out = **in - } - if in.LoadBalancerSKU != nil { - in, out := &in.LoadBalancerSKU, &out.LoadBalancerSKU - *out = new(string) - **out = **in - } - if in.IdentityRef != nil { - in, out := &in.IdentityRef, &out.IdentityRef - *out = new(corev1.ObjectReference) - **out = **in - } - if in.AADProfile != nil { - in, out := &in.AADProfile, &out.AADProfile - *out = new(AADProfile) - (*in).DeepCopyInto(*out) - } - if in.AddonProfiles != nil { - in, out := &in.AddonProfiles, &out.AddonProfiles - *out = make([]AddonProfile, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.SKU != nil { - in, out := &in.SKU, &out.SKU - *out = new(SKU) - **out = **in - } - if in.LoadBalancerProfile != nil { - in, out := &in.LoadBalancerProfile, &out.LoadBalancerProfile - *out = new(LoadBalancerProfile) - (*in).DeepCopyInto(*out) - } - if in.APIServerAccessProfile != nil { - in, out := &in.APIServerAccessProfile, &out.APIServerAccessProfile - *out = new(APIServerAccessProfile) - (*in).DeepCopyInto(*out) - } - if in.AutoScalerProfile != nil { - in, out := &in.AutoScalerProfile, &out.AutoScalerProfile - *out = new(AutoScalerProfile) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneSpec. -func (in *AzureManagedControlPlaneSpec) DeepCopy() *AzureManagedControlPlaneSpec { - if in == nil { - return nil - } - out := new(AzureManagedControlPlaneSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedControlPlaneStatus) DeepCopyInto(out *AzureManagedControlPlaneStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(cluster_apiapiv1beta1.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.LongRunningOperationStates != nil { - in, out := &in.LongRunningOperationStates, &out.LongRunningOperationStates - *out = make(apiv1beta1.Futures, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedControlPlaneStatus. -func (in *AzureManagedControlPlaneStatus) DeepCopy() *AzureManagedControlPlaneStatus { - if in == nil { - return nil - } - out := new(AzureManagedControlPlaneStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedMachinePool) DeepCopyInto(out *AzureManagedMachinePool) { - *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 AzureManagedMachinePool. -func (in *AzureManagedMachinePool) DeepCopy() *AzureManagedMachinePool { - if in == nil { - return nil - } - out := new(AzureManagedMachinePool) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureManagedMachinePool) 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 *AzureManagedMachinePoolList) DeepCopyInto(out *AzureManagedMachinePoolList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AzureManagedMachinePool, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolList. -func (in *AzureManagedMachinePoolList) DeepCopy() *AzureManagedMachinePoolList { - if in == nil { - return nil - } - out := new(AzureManagedMachinePoolList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureManagedMachinePoolList) 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 *AzureManagedMachinePoolSpec) DeepCopyInto(out *AzureManagedMachinePoolSpec) { - *out = *in - if in.AdditionalTags != nil { - in, out := &in.AdditionalTags, &out.AdditionalTags - *out = make(apiv1beta1.Tags, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(string) - **out = **in - } - if in.OSDiskSizeGB != nil { - in, out := &in.OSDiskSizeGB, &out.OSDiskSizeGB - *out = new(int32) - **out = **in - } - if in.AvailabilityZones != nil { - in, out := &in.AvailabilityZones, &out.AvailabilityZones - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.NodeLabels != nil { - in, out := &in.NodeLabels, &out.NodeLabels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Taints != nil { - in, out := &in.Taints, &out.Taints - *out = make(Taints, len(*in)) - copy(*out, *in) - } - if in.ProviderIDList != nil { - in, out := &in.ProviderIDList, &out.ProviderIDList - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Scaling != nil { - in, out := &in.Scaling, &out.Scaling - *out = new(ManagedMachinePoolScaling) - (*in).DeepCopyInto(*out) - } - if in.MaxPods != nil { - in, out := &in.MaxPods, &out.MaxPods - *out = new(int32) - **out = **in - } - if in.OsDiskType != nil { - in, out := &in.OsDiskType, &out.OsDiskType - *out = new(string) - **out = **in - } - if in.EnableUltraSSD != nil { - in, out := &in.EnableUltraSSD, &out.EnableUltraSSD - *out = new(bool) - **out = **in - } - if in.OSType != nil { - in, out := &in.OSType, &out.OSType - *out = new(string) - **out = **in - } - if in.EnableNodePublicIP != nil { - in, out := &in.EnableNodePublicIP, &out.EnableNodePublicIP - *out = new(bool) - **out = **in - } - if in.NodePublicIPPrefixID != nil { - in, out := &in.NodePublicIPPrefixID, &out.NodePublicIPPrefixID - *out = new(string) - **out = **in - } - if in.ScaleSetPriority != nil { - in, out := &in.ScaleSetPriority, &out.ScaleSetPriority - *out = new(string) - **out = **in - } - if in.KubeletConfig != nil { - in, out := &in.KubeletConfig, &out.KubeletConfig - *out = new(KubeletConfig) - (*in).DeepCopyInto(*out) - } - if in.KubeletDiskType != nil { - in, out := &in.KubeletDiskType, &out.KubeletDiskType - *out = new(KubeletDiskType) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolSpec. -func (in *AzureManagedMachinePoolSpec) DeepCopy() *AzureManagedMachinePoolSpec { - if in == nil { - return nil - } - out := new(AzureManagedMachinePoolSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedMachinePoolStatus) DeepCopyInto(out *AzureManagedMachinePoolStatus) { - *out = *in - if in.ErrorReason != nil { - in, out := &in.ErrorReason, &out.ErrorReason - *out = new(errors.MachineStatusError) - **out = **in - } - if in.ErrorMessage != nil { - in, out := &in.ErrorMessage, &out.ErrorMessage - *out = new(string) - **out = **in - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(cluster_apiapiv1beta1.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.LongRunningOperationStates != nil { - in, out := &in.LongRunningOperationStates, &out.LongRunningOperationStates - *out = make(apiv1beta1.Futures, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedMachinePoolStatus. -func (in *AzureManagedMachinePoolStatus) DeepCopy() *AzureManagedMachinePoolStatus { - if in == nil { - return nil - } - out := new(AzureManagedMachinePoolStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeletConfig) DeepCopyInto(out *KubeletConfig) { - *out = *in - if in.CPUManagerPolicy != nil { - in, out := &in.CPUManagerPolicy, &out.CPUManagerPolicy - *out = new(CPUManagerPolicy) - **out = **in - } - if in.CPUCfsQuota != nil { - in, out := &in.CPUCfsQuota, &out.CPUCfsQuota - *out = new(bool) - **out = **in - } - if in.CPUCfsQuotaPeriod != nil { - in, out := &in.CPUCfsQuotaPeriod, &out.CPUCfsQuotaPeriod - *out = new(string) - **out = **in - } - if in.ImageGcHighThreshold != nil { - in, out := &in.ImageGcHighThreshold, &out.ImageGcHighThreshold - *out = new(int32) - **out = **in - } - if in.ImageGcLowThreshold != nil { - in, out := &in.ImageGcLowThreshold, &out.ImageGcLowThreshold - *out = new(int32) - **out = **in - } - if in.TopologyManagerPolicy != nil { - in, out := &in.TopologyManagerPolicy, &out.TopologyManagerPolicy - *out = new(TopologyManagerPolicy) - **out = **in - } - if in.AllowedUnsafeSysctls != nil { - in, out := &in.AllowedUnsafeSysctls, &out.AllowedUnsafeSysctls - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.FailSwapOn != nil { - in, out := &in.FailSwapOn, &out.FailSwapOn - *out = new(bool) - **out = **in - } - if in.ContainerLogMaxSizeMB != nil { - in, out := &in.ContainerLogMaxSizeMB, &out.ContainerLogMaxSizeMB - *out = new(int32) - **out = **in - } - if in.ContainerLogMaxFiles != nil { - in, out := &in.ContainerLogMaxFiles, &out.ContainerLogMaxFiles - *out = new(int32) - **out = **in - } - if in.PodMaxPids != nil { - in, out := &in.PodMaxPids, &out.PodMaxPids - *out = new(int32) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeletConfig. -func (in *KubeletConfig) DeepCopy() *KubeletConfig { - if in == nil { - return nil - } - out := new(KubeletConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LoadBalancerProfile) DeepCopyInto(out *LoadBalancerProfile) { - *out = *in - if in.ManagedOutboundIPs != nil { - in, out := &in.ManagedOutboundIPs, &out.ManagedOutboundIPs - *out = new(int32) - **out = **in - } - if in.OutboundIPPrefixes != nil { - in, out := &in.OutboundIPPrefixes, &out.OutboundIPPrefixes - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.OutboundIPs != nil { - in, out := &in.OutboundIPs, &out.OutboundIPs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.AllocatedOutboundPorts != nil { - in, out := &in.AllocatedOutboundPorts, &out.AllocatedOutboundPorts - *out = new(int32) - **out = **in - } - if in.IdleTimeoutInMinutes != nil { - in, out := &in.IdleTimeoutInMinutes, &out.IdleTimeoutInMinutes - *out = new(int32) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerProfile. -func (in *LoadBalancerProfile) DeepCopy() *LoadBalancerProfile { - if in == nil { - return nil - } - out := new(LoadBalancerProfile) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineRollingUpdateDeployment) DeepCopyInto(out *MachineRollingUpdateDeployment) { - *out = *in - if in.MaxUnavailable != nil { - in, out := &in.MaxUnavailable, &out.MaxUnavailable - *out = new(intstr.IntOrString) - **out = **in - } - if in.MaxSurge != nil { - in, out := &in.MaxSurge, &out.MaxSurge - *out = new(intstr.IntOrString) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineRollingUpdateDeployment. -func (in *MachineRollingUpdateDeployment) DeepCopy() *MachineRollingUpdateDeployment { - if in == nil { - return nil - } - out := new(MachineRollingUpdateDeployment) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManagedControlPlaneSubnet) DeepCopyInto(out *ManagedControlPlaneSubnet) { - *out = *in - if in.ServiceEndpoints != nil { - in, out := &in.ServiceEndpoints, &out.ServiceEndpoints - *out = make(apiv1beta1.ServiceEndpoints, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedControlPlaneSubnet. -func (in *ManagedControlPlaneSubnet) DeepCopy() *ManagedControlPlaneSubnet { - if in == nil { - return nil - } - out := new(ManagedControlPlaneSubnet) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManagedControlPlaneVirtualNetwork) DeepCopyInto(out *ManagedControlPlaneVirtualNetwork) { - *out = *in - in.Subnet.DeepCopyInto(&out.Subnet) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedControlPlaneVirtualNetwork. -func (in *ManagedControlPlaneVirtualNetwork) DeepCopy() *ManagedControlPlaneVirtualNetwork { - if in == nil { - return nil - } - out := new(ManagedControlPlaneVirtualNetwork) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ManagedMachinePoolScaling) DeepCopyInto(out *ManagedMachinePoolScaling) { - *out = *in - if in.MinSize != nil { - in, out := &in.MinSize, &out.MinSize - *out = new(int32) - **out = **in - } - if in.MaxSize != nil { - in, out := &in.MaxSize, &out.MaxSize - *out = new(int32) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedMachinePoolScaling. -func (in *ManagedMachinePoolScaling) DeepCopy() *ManagedMachinePoolScaling { - if in == nil { - return nil - } - out := new(ManagedMachinePoolScaling) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SKU) DeepCopyInto(out *SKU) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SKU. -func (in *SKU) DeepCopy() *SKU { - if in == nil { - return nil - } - out := new(SKU) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Taint) DeepCopyInto(out *Taint) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Taint. -func (in *Taint) DeepCopy() *Taint { - if in == nil { - return nil - } - out := new(Taint) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in Taints) DeepCopyInto(out *Taints) { - { - in := &in - *out = make(Taints, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Taints. -func (in Taints) DeepCopy() Taints { - if in == nil { - return nil - } - out := new(Taints) - in.DeepCopyInto(out) - return *out -} diff --git a/exp/controllers/azuremachinepool_controller_unit_test.go b/exp/controllers/azuremachinepool_controller_unit_test.go index 5eff9395409..d7174305ab8 100644 --- a/exp/controllers/azuremachinepool_controller_unit_test.go +++ b/exp/controllers/azuremachinepool_controller_unit_test.go @@ -122,17 +122,6 @@ func newMachinePoolWithInfrastructureRef(clusterName, poolName string) *expv1.Ma return m } -func newManagedMachinePoolWithInfrastructureRef(clusterName, poolName string) *expv1.MachinePool { - m := newMachinePool(clusterName, poolName) - m.Spec.Template.Spec.InfrastructureRef = corev1.ObjectReference{ - Kind: "AzureManagedMachinePool", - Namespace: m.Namespace, - Name: "azure" + poolName, - APIVersion: infrav1exp.GroupVersion.String(), - } - return m -} - func newAzureCluster(clusterName string) *infrav1.AzureCluster { return &infrav1.AzureCluster{ ObjectMeta: metav1.ObjectMeta{ diff --git a/exp/controllers/helpers.go b/exp/controllers/helpers.go index 2ef1a74f527..fc96d07ac99 100644 --- a/exp/controllers/helpers.go +++ b/exp/controllers/helpers.go @@ -139,311 +139,6 @@ func AzureMachinePoolMachineMapper(scheme *runtime.Scheme, log logr.Logger) hand } } -// AzureManagedClusterToAzureManagedMachinePoolsMapper creates a mapping handler to transform AzureManagedClusters into -// AzureManagedMachinePools. The transform requires AzureManagedCluster to map to the owning Cluster, then from the -// Cluster, collect the MachinePools belonging to the cluster, then finally projecting the infrastructure reference -// to the AzureManagedMachinePools. -func AzureManagedClusterToAzureManagedMachinePoolsMapper(ctx context.Context, c client.Client, scheme *runtime.Scheme, log logr.Logger) (handler.MapFunc, error) { - gvk, err := apiutil.GVKForObject(new(infrav1exp.AzureManagedMachinePool), scheme) - if err != nil { - return nil, errors.Wrap(err, "failed to find GVK for AzureManagedMachinePool") - } - - return func(o client.Object) []ctrl.Request { - ctx, cancel := context.WithTimeout(ctx, reconciler.DefaultMappingTimeout) - defer cancel() - - azCluster, ok := o.(*infrav1exp.AzureManagedCluster) - if !ok { - log.Error(errors.Errorf("expected an AzureManagedCluster, got %T instead", o.GetObjectKind()), "failed to map AzureManagedCluster") - return nil - } - - log = log.WithValues("AzureManagedCluster", azCluster.Name, "Namespace", azCluster.Namespace) - - // Don't handle deleted AzureManagedClusters - if !azCluster.ObjectMeta.DeletionTimestamp.IsZero() { - log.V(4).Info("AzureManagedCluster has a deletion timestamp, skipping mapping.") - return nil - } - - clusterName, ok := controllers.GetOwnerClusterName(azCluster.ObjectMeta) - if !ok { - log.V(4).Info("unable to get the owner cluster") - return nil - } - - machineList := &expv1.MachinePoolList{} - machineList.SetGroupVersionKind(gvk) - // list all of the requested objects within the cluster namespace with the cluster name label - if err := c.List(ctx, machineList, client.InNamespace(azCluster.Namespace), client.MatchingLabels{clusterv1.ClusterLabelName: clusterName}); err != nil { - return nil - } - - mapFunc := MachinePoolToInfrastructureMapFunc(gvk, log) - var results []ctrl.Request - for _, machine := range machineList.Items { - m := machine - azureMachines := mapFunc(&m) - results = append(results, azureMachines...) - } - - return results - }, nil -} - -// AzureManagedControlPlaneToAzureManagedMachinePoolsMapper creates a mapping handler to transform AzureManagedControlPlanes into -// AzureManagedMachinePools. The transform requires AzureManagedControlPlane to map to the owning Cluster, then from the -// Cluster, collect the MachinePools belonging to the cluster, then finally projecting the infrastructure reference -// to the AzureManagedMachinePools. -func AzureManagedControlPlaneToAzureManagedMachinePoolsMapper(ctx context.Context, c client.Client, scheme *runtime.Scheme, log logr.Logger) (handler.MapFunc, error) { - gvk, err := apiutil.GVKForObject(new(infrav1exp.AzureManagedMachinePool), scheme) - if err != nil { - return nil, errors.Wrap(err, "failed to find GVK for AzureManagedMachinePool") - } - - return func(o client.Object) []ctrl.Request { - ctx, cancel := context.WithTimeout(ctx, reconciler.DefaultMappingTimeout) - defer cancel() - - azControlPlane, ok := o.(*infrav1exp.AzureManagedControlPlane) - if !ok { - log.Error(errors.Errorf("expected an AzureManagedControlPlane, got %T instead", o.GetObjectKind()), "failed to map AzureManagedControlPlane") - return nil - } - - log = log.WithValues("AzureManagedControlPlane", azControlPlane.Name, "Namespace", azControlPlane.Namespace) - - // Don't handle deleted AzureManagedControlPlanes - if !azControlPlane.ObjectMeta.DeletionTimestamp.IsZero() { - log.V(4).Info("AzureManagedControlPlane has a deletion timestamp, skipping mapping.") - return nil - } - - clusterName, ok := controllers.GetOwnerClusterName(azControlPlane.ObjectMeta) - if !ok { - log.Info("unable to get the owner cluster") - return nil - } - - machineList := &expv1.MachinePoolList{} - machineList.SetGroupVersionKind(gvk) - // list all of the requested objects within the cluster namespace with the cluster name label - if err := c.List(ctx, machineList, client.InNamespace(azControlPlane.Namespace), client.MatchingLabels{clusterv1.ClusterLabelName: clusterName}); err != nil { - return nil - } - - mapFunc := MachinePoolToInfrastructureMapFunc(gvk, log) - var results []ctrl.Request - for _, machine := range machineList.Items { - m := machine - azureMachines := mapFunc(&m) - results = append(results, azureMachines...) - } - - return results - }, nil -} - -// AzureManagedClusterToAzureManagedControlPlaneMapper creates a mapping handler to transform AzureManagedClusters into -// AzureManagedControlPlane. The transform requires AzureManagedCluster to map to the owning Cluster, then from the -// Cluster, collect the control plane infrastructure reference. -func AzureManagedClusterToAzureManagedControlPlaneMapper(ctx context.Context, c client.Client, log logr.Logger) (handler.MapFunc, error) { - return func(o client.Object) []ctrl.Request { - ctx, cancel := context.WithTimeout(ctx, reconciler.DefaultMappingTimeout) - defer cancel() - - azCluster, ok := o.(*infrav1exp.AzureManagedCluster) - if !ok { - log.Error(errors.Errorf("expected an AzureManagedCluster, got %T instead", o), "failed to map AzureManagedCluster") - return nil - } - - log = log.WithValues("AzureManagedCluster", azCluster.Name, "Namespace", azCluster.Namespace) - - // Don't handle deleted AzureManagedClusters - if !azCluster.ObjectMeta.DeletionTimestamp.IsZero() { - log.V(4).Info("AzureManagedCluster has a deletion timestamp, skipping mapping.") - return nil - } - - cluster, err := util.GetOwnerCluster(ctx, c, azCluster.ObjectMeta) - if err != nil { - log.Error(err, "failed to get the owning cluster") - return nil - } - - if cluster == nil { - log.Error(err, "cluster has not set owner ref yet") - return nil - } - - ref := cluster.Spec.ControlPlaneRef - if ref == nil || ref.Name == "" { - return nil - } - - return []ctrl.Request{ - { - NamespacedName: types.NamespacedName{ - Namespace: ref.Namespace, - Name: ref.Name, - }, - }, - } - }, nil -} - -// AzureManagedControlPlaneToAzureManagedClusterMapper creates a mapping handler to transform AzureManagedClusters into -// AzureManagedControlPlane. The transform requires AzureManagedCluster to map to the owning Cluster, then from the -// Cluster, collect the control plane infrastructure reference. -func AzureManagedControlPlaneToAzureManagedClusterMapper(ctx context.Context, c client.Client, log logr.Logger) (handler.MapFunc, error) { - return func(o client.Object) []ctrl.Request { - ctx, cancel := context.WithTimeout(ctx, reconciler.DefaultMappingTimeout) - defer cancel() - - azManagedControlPlane, ok := o.(*infrav1exp.AzureManagedControlPlane) - if !ok { - log.Error(errors.Errorf("expected an AzureManagedControlPlane, got %T instead", o), "failed to map AzureManagedControlPlane") - return nil - } - - log = log.WithValues("AzureManagedControlPlane", azManagedControlPlane.Name, "Namespace", azManagedControlPlane.Namespace) - - // Don't handle deleted AzureManagedControlPlanes - if !azManagedControlPlane.ObjectMeta.DeletionTimestamp.IsZero() { - log.V(4).Info("AzureManagedControlPlane has a deletion timestamp, skipping mapping.") - return nil - } - - cluster, err := util.GetOwnerCluster(ctx, c, azManagedControlPlane.ObjectMeta) - if err != nil { - log.Error(err, "failed to get the owning cluster") - return nil - } - - if cluster == nil { - log.Error(err, "cluster has not set owner ref yet") - return nil - } - - ref := cluster.Spec.InfrastructureRef - if ref == nil || ref.Name == "" { - return nil - } - - return []ctrl.Request{ - { - NamespacedName: types.NamespacedName{ - Namespace: ref.Namespace, - Name: ref.Name, - }, - }, - } - }, nil -} - -// MachinePoolToAzureManagedControlPlaneMapFunc returns a handler.MapFunc that watches for -// MachinePool events and returns reconciliation requests for a control plane object. -func MachinePoolToAzureManagedControlPlaneMapFunc(ctx context.Context, c client.Client, gvk schema.GroupVersionKind, log logr.Logger) handler.MapFunc { - return func(o client.Object) []reconcile.Request { - ctx, cancel := context.WithTimeout(ctx, reconciler.DefaultMappingTimeout) - defer cancel() - - machinePool, ok := o.(*expv1.MachinePool) - if !ok { - log.Info("expected a MachinePool, got wrong type", "type", fmt.Sprintf("%T", o)) - return nil - } - - cluster, err := util.GetClusterByName(ctx, c, machinePool.ObjectMeta.Namespace, machinePool.Spec.ClusterName) - if err != nil { - log.Error(err, "failed to get the owning cluster") - return nil - } - - gk := gvk.GroupKind() - ref := cluster.Spec.ControlPlaneRef - // Return early if the GroupKind doesn't match what we expect. - controlPlaneGK := ref.GroupVersionKind().GroupKind() - if gk != controlPlaneGK { - log.Info("gk does not match", "gk", gk, "controlPlaneGK", controlPlaneGK) - return nil - } - - controlPlaneKey := client.ObjectKey{ - Name: ref.Name, - Namespace: ref.Namespace, - } - controlPlane := &infrav1exp.AzureManagedControlPlane{} - if err := c.Get(ctx, controlPlaneKey, controlPlane); err != nil { - log.Error(err, "failed to fetch default pool reference") - // If we get here, we might want to reconcile but aren't sure. - // Do it anyway to be safe. Worst case we reconcile a few extra times with no-ops. - return []reconcile.Request{ - { - NamespacedName: client.ObjectKey{ - Namespace: ref.Namespace, - Name: ref.Name, - }, - }, - } - } - - infraMachinePoolRef := machinePool.Spec.Template.Spec.InfrastructureRef - - gv, err := schema.ParseGroupVersion(infraMachinePoolRef.APIVersion) - if err != nil { - log.Error(err, "failed to parse group version") - // If we get here, we might want to reconcile but aren't sure. - // Do it anyway to be safe. Worst case we reconcile a few extra times with no-ops. - return []reconcile.Request{ - { - NamespacedName: client.ObjectKey{ - Namespace: ref.Namespace, - Name: ref.Name, - }, - }, - } - } - - kindMatches := infraMachinePoolRef.Kind == "AzureManagedMachinePool" - groupMatches := controlPlaneGK.Group == gv.Group - - ammp := &infrav1exp.AzureManagedMachinePool{} - key := types.NamespacedName{Namespace: infraMachinePoolRef.Namespace, Name: infraMachinePoolRef.Name} - if err := c.Get(ctx, key, ammp); err != nil { - log.Error(err, fmt.Sprintf("failed to fetch azure managed machine pool for Machinepool: %s", infraMachinePoolRef.Name)) - // If we get here, we might want to reconcile but aren't sure. - // Do it anyway to be safe. Worst case we reconcile a few extra times with no-ops. - return []reconcile.Request{ - { - NamespacedName: client.ObjectKey{ - Namespace: ref.Namespace, - Name: ref.Name, - }, - }, - } - } - - isSystemNodePool := ammp.Spec.Mode == string(infrav1exp.NodePoolModeSystem) - - if groupMatches && kindMatches && isSystemNodePool { - return []reconcile.Request{ - { - NamespacedName: client.ObjectKey{ - Namespace: ref.Namespace, - Name: ref.Name, - }, - }, - } - } - - // By default, return nothing for a machine pool which is not the default pool for a control plane. - return nil - } -} - // MachinePoolToInfrastructureMapFunc returns a handler.MapFunc that watches for // MachinePool events and returns reconciliation requests for an infrastructure provider object. func MachinePoolToInfrastructureMapFunc(gvk schema.GroupVersionKind, log logr.Logger) handler.MapFunc { diff --git a/exp/controllers/helpers_test.go b/exp/controllers/helpers_test.go index fa54c9d0286..0f79610b214 100644 --- a/exp/controllers/helpers_test.go +++ b/exp/controllers/helpers_test.go @@ -20,11 +20,9 @@ import ( "context" "testing" - "github.com/Azure/go-autorest/autorest/to" "github.com/go-logr/logr" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" @@ -33,14 +31,12 @@ import ( gomockinternal "sigs.k8s.io/cluster-api-provider-azure/internal/test/matchers/gomock" "sigs.k8s.io/cluster-api-provider-azure/internal/test/mock_log" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/reconcile" ) var ( - cpName = "my-managed-cp" clusterName = "my-cluster" ) @@ -80,342 +76,6 @@ func TestAzureClusterToAzureMachinePoolsMapper(t *testing.T) { g.Expect(requests).To(HaveLen(2)) } -func TestAzureManagedClusterToAzureManagedMachinePoolsMapper(t *testing.T) { - g := NewWithT(t) - scheme := newScheme(g) - initObjects := []runtime.Object{ - newCluster(clusterName), - // Create two Machines with an infrastructure ref and one without. - newManagedMachinePoolInfraReference(clusterName, "my-mmp-0"), - newManagedMachinePoolInfraReference(clusterName, "my-mmp-1"), - newManagedMachinePoolInfraReference(clusterName, "my-mmp-2"), - newMachinePool(clusterName, "my-machine-2"), - } - fakeClient := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(initObjects...).Build() - - sink := mock_log.NewMockLogSink(gomock.NewController(t)) - sink.EXPECT().Init(logr.RuntimeInfo{CallDepth: 1}) - sink.EXPECT().Enabled(4).Return(true) - sink.EXPECT().WithValues("AzureManagedCluster", "my-cluster", "Namespace", "default").Return(sink) - sink.EXPECT().Info(4, "gk does not match", "gk", gomock.Any(), "infraGK", gomock.Any()) - mapper, err := AzureManagedClusterToAzureManagedMachinePoolsMapper(context.Background(), fakeClient, scheme, logr.New(sink)) - g.Expect(err).NotTo(HaveOccurred()) - - requests := mapper(&infrav1exp.AzureManagedCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: clusterName, - Namespace: "default", - OwnerReferences: []metav1.OwnerReference{ - { - Name: clusterName, - Kind: "Cluster", - APIVersion: clusterv1.GroupVersion.String(), - }, - }, - }, - }) - g.Expect(requests).To(ConsistOf([]reconcile.Request{ - { - NamespacedName: types.NamespacedName{ - Name: "azuremy-mmp-0", - Namespace: "default", - }, - }, - { - NamespacedName: types.NamespacedName{ - Name: "azuremy-mmp-1", - Namespace: "default", - }, - }, - { - NamespacedName: types.NamespacedName{ - Name: "azuremy-mmp-2", - Namespace: "default", - }, - }, - })) -} - -func TestAzureManagedControlPlaneToAzureManagedMachinePoolsMapper(t *testing.T) { - g := NewWithT(t) - scheme := newScheme(g) - cluster := newCluster("my-cluster") - cluster.Spec.ControlPlaneRef = &corev1.ObjectReference{ - APIVersion: infrav1exp.GroupVersion.String(), - Kind: "AzureManagedControlPlane", - Name: cpName, - Namespace: cluster.Namespace, - } - initObjects := []runtime.Object{ - cluster, - newAzureManagedControlPlane(cpName), - // Create two Machines with an infrastructure ref and one without. - newManagedMachinePoolInfraReference(clusterName, "my-mmp-0"), - newManagedMachinePoolInfraReference(clusterName, "my-mmp-1"), - newManagedMachinePoolInfraReference(clusterName, "my-mmp-2"), - newMachinePool(clusterName, "my-machine-2"), - } - fakeClient := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(initObjects...).Build() - - sink := mock_log.NewMockLogSink(gomock.NewController(t)) - sink.EXPECT().Init(logr.RuntimeInfo{CallDepth: 1}) - sink.EXPECT().Enabled(4).Return(true) - sink.EXPECT().WithValues("AzureManagedControlPlane", cpName, "Namespace", cluster.Namespace).Return(sink) - sink.EXPECT().Info(4, "gk does not match", "gk", gomock.Any(), "infraGK", gomock.Any()) - mapper, err := AzureManagedControlPlaneToAzureManagedMachinePoolsMapper(context.Background(), fakeClient, scheme, logr.New(sink)) - g.Expect(err).NotTo(HaveOccurred()) - - requests := mapper(&infrav1exp.AzureManagedControlPlane{ - ObjectMeta: metav1.ObjectMeta{ - Name: cpName, - Namespace: cluster.Namespace, - OwnerReferences: []metav1.OwnerReference{ - { - Name: cluster.Name, - Kind: "Cluster", - APIVersion: clusterv1.GroupVersion.String(), - }, - }, - }, - }) - g.Expect(requests).To(ConsistOf([]reconcile.Request{ - { - NamespacedName: types.NamespacedName{ - Name: "azuremy-mmp-0", - Namespace: "default", - }, - }, - { - NamespacedName: types.NamespacedName{ - Name: "azuremy-mmp-1", - Namespace: "default", - }, - }, - { - NamespacedName: types.NamespacedName{ - Name: "azuremy-mmp-2", - Namespace: "default", - }, - }, - })) -} - -func TestMachinePoolToAzureManagedControlPlaneMapFuncSuccess(t *testing.T) { - g := NewWithT(t) - scheme := newScheme(g) - cluster := newCluster(clusterName) - controlPlane := newAzureManagedControlPlane(cpName) - cluster.Spec.ControlPlaneRef = &corev1.ObjectReference{ - APIVersion: infrav1exp.GroupVersion.String(), - Kind: "AzureManagedControlPlane", - Name: cpName, - Namespace: cluster.Namespace, - } - - managedMachinePool0 := newManagedMachinePoolInfraReference(clusterName, "my-mmp-0") - azureManagedMachinePool0 := newAzureManagedMachinePool(clusterName, "azuremy-mmp-0", "System") - managedMachinePool0.Spec.ClusterName = clusterName - - managedMachinePool1 := newManagedMachinePoolInfraReference(clusterName, "my-mmp-1") - azureManagedMachinePool1 := newAzureManagedMachinePool(clusterName, "azuremy-mmp-1", "User") - managedMachinePool1.Spec.ClusterName = clusterName - - initObjects := []runtime.Object{ - cluster, - controlPlane, - managedMachinePool0, - azureManagedMachinePool0, - // Create two Machines with an infrastructure ref and one without. - managedMachinePool1, - azureManagedMachinePool1, - } - fakeClient := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(initObjects...).Build() - - sink := mock_log.NewMockLogSink(gomock.NewController(t)) - sink.EXPECT().Init(logr.RuntimeInfo{CallDepth: 1}) - mapper := MachinePoolToAzureManagedControlPlaneMapFunc(context.Background(), fakeClient, infrav1exp.GroupVersion.WithKind("AzureManagedControlPlane"), logr.New(sink)) - - // system pool should trigger - requests := mapper(newManagedMachinePoolInfraReference(clusterName, "my-mmp-0")) - g.Expect(requests).To(ConsistOf([]reconcile.Request{ - { - NamespacedName: types.NamespacedName{ - Name: "my-managed-cp", - Namespace: "default", - }, - }, - })) - - // any other pool should not trigger - requests = mapper(newManagedMachinePoolInfraReference(clusterName, "my-mmp-1")) - g.Expect(requests).To(BeNil()) -} - -func TestMachinePoolToAzureManagedControlPlaneMapFuncFailure(t *testing.T) { - g := NewWithT(t) - scheme := newScheme(g) - cluster := newCluster(clusterName) - cluster.Spec.ControlPlaneRef = &corev1.ObjectReference{ - APIVersion: infrav1exp.GroupVersion.String(), - Kind: "AzureManagedControlPlane", - Name: cpName, - Namespace: cluster.Namespace, - } - managedMachinePool := newManagedMachinePoolInfraReference(clusterName, "my-mmp-0") - managedMachinePool.Spec.ClusterName = clusterName - initObjects := []runtime.Object{ - cluster, - managedMachinePool, - // Create two Machines with an infrastructure ref and one without. - newManagedMachinePoolInfraReference(clusterName, "my-mmp-1"), - } - fakeClient := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(initObjects...).Build() - - sink := mock_log.NewMockLogSink(gomock.NewController(t)) - sink.EXPECT().Init(logr.RuntimeInfo{CallDepth: 1}) - sink.EXPECT().Error(gomock.Any(), "failed to fetch default pool reference") - sink.EXPECT().Error(gomock.Any(), "failed to fetch default pool reference") // twice because we are testing two calls - - mapper := MachinePoolToAzureManagedControlPlaneMapFunc(context.Background(), fakeClient, infrav1exp.GroupVersion.WithKind("AzureManagedControlPlane"), logr.New(sink)) - - // default pool should trigger if owned cluster could not be fetched - requests := mapper(newManagedMachinePoolInfraReference(clusterName, "my-mmp-0")) - g.Expect(requests).To(ConsistOf([]reconcile.Request{ - { - NamespacedName: types.NamespacedName{ - Name: "my-managed-cp", - Namespace: "default", - }, - }, - })) - - // any other pool should also trigger if owned cluster could not be fetched - requests = mapper(newManagedMachinePoolInfraReference(clusterName, "my-mmp-1")) - g.Expect(requests).To(ConsistOf([]reconcile.Request{ - { - NamespacedName: types.NamespacedName{ - Name: "my-managed-cp", - Namespace: "default", - }, - }, - })) -} - -func TestAzureManagedClusterToAzureManagedControlPlaneMapper(t *testing.T) { - g := NewWithT(t) - scheme := newScheme(g) - cluster := newCluster("my-cluster") - cluster.Spec.ControlPlaneRef = &corev1.ObjectReference{ - APIVersion: infrav1exp.GroupVersion.String(), - Kind: "AzureManagedControlPlane", - Name: cpName, - Namespace: cluster.Namespace, - } - - initObjects := []runtime.Object{ - cluster, - newAzureManagedControlPlane(cpName), - } - fakeClient := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(initObjects...).Build() - - sink := mock_log.NewMockLogSink(gomock.NewController(t)) - sink.EXPECT().Init(logr.RuntimeInfo{CallDepth: 1}) - sink.EXPECT().WithValues("AzureManagedCluster", "az-"+cluster.Name, "Namespace", "default") - - mapper, err := AzureManagedClusterToAzureManagedControlPlaneMapper(context.Background(), fakeClient, logr.New(sink)) - g.Expect(err).NotTo(HaveOccurred()) - requests := mapper(&infrav1exp.AzureManagedCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "az-" + cluster.Name, - Namespace: "default", - OwnerReferences: []metav1.OwnerReference{ - { - Name: cluster.Name, - Kind: "Cluster", - APIVersion: clusterv1.GroupVersion.String(), - }, - }, - }, - }) - g.Expect(requests).To(HaveLen(1)) - g.Expect(requests).To(Equal([]reconcile.Request{ - { - NamespacedName: types.NamespacedName{ - Name: cpName, - Namespace: cluster.Namespace, - }, - }, - })) -} - -func TestAzureManagedControlPlaneToAzureManagedClusterMapper(t *testing.T) { - g := NewWithT(t) - scheme := newScheme(g) - cluster := newCluster("my-cluster") - azManagedCluster := &infrav1exp.AzureManagedCluster{ - ObjectMeta: metav1.ObjectMeta{ - Name: "az-" + cluster.Name, - Namespace: "default", - OwnerReferences: []metav1.OwnerReference{ - { - Name: cluster.Name, - Kind: "Cluster", - APIVersion: clusterv1.GroupVersion.String(), - }, - }, - }, - } - - cluster.Spec.ControlPlaneRef = &corev1.ObjectReference{ - APIVersion: infrav1exp.GroupVersion.String(), - Kind: "AzureManagedControlPlane", - Name: cpName, - Namespace: cluster.Namespace, - } - cluster.Spec.InfrastructureRef = &corev1.ObjectReference{ - APIVersion: infrav1exp.GroupVersion.String(), - Kind: "AzureManagedCluster", - Name: azManagedCluster.Name, - Namespace: azManagedCluster.Namespace, - } - - initObjects := []runtime.Object{ - cluster, - newAzureManagedControlPlane(cpName), - azManagedCluster, - } - fakeClient := fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(initObjects...).Build() - - sink := mock_log.NewMockLogSink(gomock.NewController(t)) - sink.EXPECT().Init(logr.RuntimeInfo{CallDepth: 1}) - sink.EXPECT().WithValues("AzureManagedControlPlane", cpName, "Namespace", cluster.Namespace) - - mapper, err := AzureManagedControlPlaneToAzureManagedClusterMapper(context.Background(), fakeClient, logr.New(sink)) - g.Expect(err).NotTo(HaveOccurred()) - requests := mapper(&infrav1exp.AzureManagedControlPlane{ - ObjectMeta: metav1.ObjectMeta{ - Name: cpName, - Namespace: cluster.Namespace, - OwnerReferences: []metav1.OwnerReference{ - { - Name: cluster.Name, - Kind: "Cluster", - APIVersion: clusterv1.GroupVersion.String(), - }, - }, - }, - }) - g.Expect(requests).To(HaveLen(1)) - g.Expect(requests).To(Equal([]reconcile.Request{ - { - NamespacedName: types.NamespacedName{ - Name: azManagedCluster.Name, - Namespace: azManagedCluster.Namespace, - }, - }, - })) -} - func Test_MachinePoolToInfrastructureMapFunc(t *testing.T) { cases := []struct { Name string @@ -491,81 +151,6 @@ func Test_MachinePoolToInfrastructureMapFunc(t *testing.T) { } } -func Test_ManagedMachinePoolToInfrastructureMapFunc(t *testing.T) { - cases := []struct { - Name string - Setup func(logMock *mock_log.MockLogSink) - MapObjectFactory func(*GomegaWithT) client.Object - Expect func(*GomegaWithT, []reconcile.Request) - }{ - { - Name: "MachinePoolToAzureManagedMachinePool", - MapObjectFactory: func(g *GomegaWithT) client.Object { - return newManagedMachinePoolWithInfrastructureRef("azureManagedCluster", "ManagedMachinePool") - }, - Setup: func(logMock *mock_log.MockLogSink) { - logMock.EXPECT().Init(logr.RuntimeInfo{CallDepth: 1}) - }, - Expect: func(g *GomegaWithT, reqs []reconcile.Request) { - g.Expect(reqs).To(HaveLen(1)) - g.Expect(reqs[0]).To(Equal(reconcile.Request{ - NamespacedName: types.NamespacedName{ - Name: "azureManagedMachinePool", - Namespace: "default", - }, - })) - }, - }, - { - Name: "MachinePoolWithoutMatchingInfraRef", - MapObjectFactory: func(g *GomegaWithT) client.Object { - return newMachinePool("azureManagedCluster", "machinePool") - }, - Setup: func(logMock *mock_log.MockLogSink) { - ampGK := infrav1exp.GroupVersion.WithKind("AzureManagedMachinePool").GroupKind() - logMock.EXPECT().Init(logr.RuntimeInfo{CallDepth: 1}) - logMock.EXPECT().Enabled(4).Return(true) - logMock.EXPECT().Info(4, "gk does not match", "gk", ampGK, "infraGK", gomock.Any()) - }, - Expect: func(g *GomegaWithT, reqs []reconcile.Request) { - g.Expect(reqs).To(BeEmpty()) - }, - }, - { - Name: "NotAMachinePool", - MapObjectFactory: func(g *GomegaWithT) client.Object { - return newCluster("azureManagedCluster") - }, - Setup: func(logMock *mock_log.MockLogSink) { - logMock.EXPECT().Init(logr.RuntimeInfo{CallDepth: 1}) - logMock.EXPECT().Enabled(4).Return(true) - logMock.EXPECT().Info(4, "attempt to map incorrect type", "type", "*v1beta1.Cluster") - }, - Expect: func(g *GomegaWithT, reqs []reconcile.Request) { - g.Expect(reqs).To(BeEmpty()) - }, - }, - } - - for _, c := range cases { - c := c - t.Run(c.Name, func(t *testing.T) { - g := NewWithT(t) - - mockCtrl := gomock.NewController(t) - defer mockCtrl.Finish() - - sink := mock_log.NewMockLogSink(mockCtrl) - if c.Setup != nil { - c.Setup(sink) - } - f := MachinePoolToInfrastructureMapFunc(infrav1exp.GroupVersion.WithKind("AzureManagedMachinePool"), logr.New(sink)) - reqs := f(c.MapObjectFactory(g)) - c.Expect(g, reqs) - }) - } -} - func Test_azureClusterToAzureMachinePoolsFunc(t *testing.T) { cases := []struct { Name string @@ -711,47 +296,3 @@ func Test_azureClusterToAzureMachinePoolsFunc(t *testing.T) { }) } } - -func newAzureManagedControlPlane(cpName string) *infrav1exp.AzureManagedControlPlane { - return &infrav1exp.AzureManagedControlPlane{ - ObjectMeta: metav1.ObjectMeta{ - Name: cpName, - Namespace: "default", - }, - } -} - -func newManagedMachinePoolInfraReference(clusterName, poolName string) *expv1.MachinePool { - m := newMachinePool(clusterName, poolName) - m.Spec.ClusterName = clusterName - m.Spec.Template.Spec.InfrastructureRef = corev1.ObjectReference{ - Kind: "AzureManagedMachinePool", - Namespace: m.Namespace, - Name: "azure" + poolName, - APIVersion: infrav1exp.GroupVersion.String(), - } - return m -} - -func newAzureManagedMachinePool(clusterName, poolName, mode string) *infrav1exp.AzureManagedMachinePool { - var cpuManagerPolicyStatic = infrav1exp.CPUManagerPolicyStatic - var topologyManagerPolicy = infrav1exp.TopologyManagerPolicyBestEffort - return &infrav1exp.AzureManagedMachinePool{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{ - clusterv1.ClusterLabelName: clusterName, - }, - Name: poolName, - Namespace: "default", - }, - Spec: infrav1exp.AzureManagedMachinePoolSpec{ - Mode: mode, - SKU: "Standard_B2s", - OSDiskSizeGB: to.Int32Ptr(512), - KubeletConfig: &infrav1exp.KubeletConfig{ - CPUManagerPolicy: &cpuManagerPolicyStatic, - TopologyManagerPolicy: &topologyManagerPolicy, - }, - }, - } -} diff --git a/exp/controllers/suite_test.go b/exp/controllers/suite_test.go index a379303e1c8..912e580fd2a 100644 --- a/exp/controllers/suite_test.go +++ b/exp/controllers/suite_test.go @@ -52,19 +52,6 @@ var _ = BeforeSuite(func() { ctx = log.IntoContext(ctx, logr.New(testEnv.Log)) - Expect((&AzureManagedClusterReconciler{ - Client: testEnv, - Recorder: testEnv.GetEventRecorderFor("azuremanagedcluster-reconciler"), - }).SetupWithManager(ctx, testEnv.Manager, controllers.Options{Options: controller.Options{MaxConcurrentReconciles: 1}})).To(Succeed()) - - Expect((&AzureManagedControlPlaneReconciler{ - Client: testEnv, - Recorder: testEnv.GetEventRecorderFor("azuremanagedcontrolplane-reconciler"), - }).SetupWithManager(ctx, testEnv.Manager, controllers.Options{Options: controller.Options{MaxConcurrentReconciles: 1}})).To(Succeed()) - - Expect(NewAzureManagedMachinePoolReconciler(testEnv, testEnv.GetEventRecorderFor("azuremanagedmachinepool-reconciler"), - reconciler.DefaultLoopTimeout, "").SetupWithManager(ctx, testEnv.Manager, controllers.Options{Options: controller.Options{MaxConcurrentReconciles: 1}})).To(Succeed()) - Expect(NewAzureMachinePoolReconciler(testEnv, testEnv.GetEventRecorderFor("azuremachinepool-reconciler"), reconciler.DefaultLoopTimeout, "").SetupWithManager(ctx, testEnv.Manager, controllers.Options{Options: controller.Options{MaxConcurrentReconciles: 1}})).To(Succeed()) diff --git a/feature/feature.go b/feature/feature.go index d217517082c..cb489c57f40 100644 --- a/feature/feature.go +++ b/feature/feature.go @@ -30,9 +30,11 @@ const ( // // alpha: v1.X // MyFeature featuregate.Feature = "MyFeature" + //nolint:godot // Ignore "Comment should end in a period" check. // AKS is the feature gate for AKS managed clusters. // owner: @alexeldeib // alpha: v0.4 + // GA: v1.8 AKS featuregate.Feature = "AKS" // AKSResourceHealth is the feature gate for reporting Azure Resource Health @@ -50,6 +52,6 @@ func init() { // To add a new feature, define a key for it above and add it here. var defaultCAPZFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{ // Every feature should be initiated here: - AKS: {Default: false, PreRelease: featuregate.Alpha}, + AKS: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // Remove in 1.12 AKSResourceHealth: {Default: false, PreRelease: featuregate.Alpha}, } diff --git a/hack/observability/opentelemetry/controller-manager-patch.yaml b/hack/observability/opentelemetry/controller-manager-patch.yaml index 8b8db675132..9bd48950914 100644 --- a/hack/observability/opentelemetry/controller-manager-patch.yaml +++ b/hack/observability/opentelemetry/controller-manager-patch.yaml @@ -11,5 +11,5 @@ spec: args: - "--metrics-bind-addr=:8080" - "--leader-elect" - - "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=false},AKS=${EXP_AKS:=false},AKSResourceHealth=${EXP_AKS_RESOURCE_HEALTH:=false}" + - "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=false},AKSResourceHealth=${EXP_AKS_RESOURCE_HEALTH:=false}" - "--enable-tracing" diff --git a/main.go b/main.go index e58d558be24..7f5844f45bc 100644 --- a/main.go +++ b/main.go @@ -430,51 +430,49 @@ func registerControllers(ctx context.Context, mgr manager.Manager) { os.Exit(1) } - if feature.Gates.Enabled(feature.AKS) { - mmpmCache, err := coalescing.NewRequestCache(debouncingTimer) - if err != nil { - setupLog.Error(err, "failed to build mmpmCache ReconcileCache") - } + mmpmCache, err := coalescing.NewRequestCache(debouncingTimer) + if err != nil { + setupLog.Error(err, "failed to build mmpmCache ReconcileCache") + } - if err := infrav1controllersexp.NewAzureManagedMachinePoolReconciler( - mgr.GetClient(), - mgr.GetEventRecorderFor("azuremanagedmachinepoolmachine-reconciler"), - reconcileTimeout, - watchFilterValue, - ).SetupWithManager(ctx, mgr, controllers.Options{Options: controller.Options{MaxConcurrentReconciles: azureMachinePoolConcurrency}, Cache: mmpmCache}); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "AzureManagedMachinePool") - os.Exit(1) - } + if err := controllers.NewAzureManagedMachinePoolReconciler( + mgr.GetClient(), + mgr.GetEventRecorderFor("azuremanagedmachinepoolmachine-reconciler"), + reconcileTimeout, + watchFilterValue, + ).SetupWithManager(ctx, mgr, controllers.Options{Options: controller.Options{MaxConcurrentReconciles: azureMachinePoolConcurrency}, Cache: mmpmCache}); err != nil { + setupLog.Error(err, "unable to create controller", "controller", "AzureManagedMachinePool") + os.Exit(1) + } - mcCache, err := coalescing.NewRequestCache(debouncingTimer) - if err != nil { - setupLog.Error(err, "failed to build mcCache ReconcileCache") - } + mcCache, err := coalescing.NewRequestCache(debouncingTimer) + if err != nil { + setupLog.Error(err, "failed to build mcCache ReconcileCache") + } - if err := (&infrav1controllersexp.AzureManagedClusterReconciler{ - Client: mgr.GetClient(), - Recorder: mgr.GetEventRecorderFor("azuremanagedcluster-reconciler"), - ReconcileTimeout: reconcileTimeout, - WatchFilterValue: watchFilterValue, - }).SetupWithManager(ctx, mgr, controllers.Options{Options: controller.Options{MaxConcurrentReconciles: azureClusterConcurrency}, Cache: mcCache}); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "AzureManagedCluster") - os.Exit(1) - } + if err := (&controllers.AzureManagedClusterReconciler{ + Client: mgr.GetClient(), + Recorder: mgr.GetEventRecorderFor("azuremanagedcluster-reconciler"), + ReconcileTimeout: reconcileTimeout, + WatchFilterValue: watchFilterValue, + }).SetupWithManager(ctx, mgr, controllers.Options{Options: controller.Options{MaxConcurrentReconciles: azureClusterConcurrency}, Cache: mcCache}); err != nil { + setupLog.Error(err, "unable to create controller", "controller", "AzureManagedCluster") + os.Exit(1) + } - mcpCache, err := coalescing.NewRequestCache(debouncingTimer) - if err != nil { - setupLog.Error(err, "failed to build mcpCache ReconcileCache") - } + mcpCache, err := coalescing.NewRequestCache(debouncingTimer) + if err != nil { + setupLog.Error(err, "failed to build mcpCache ReconcileCache") + } - if err := (&infrav1controllersexp.AzureManagedControlPlaneReconciler{ - Client: mgr.GetClient(), - Recorder: mgr.GetEventRecorderFor("azuremanagedcontrolplane-reconciler"), - ReconcileTimeout: reconcileTimeout, - WatchFilterValue: watchFilterValue, - }).SetupWithManager(ctx, mgr, controllers.Options{Options: controller.Options{MaxConcurrentReconciles: azureClusterConcurrency}, Cache: mcpCache}); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "AzureManagedControlPlane") - os.Exit(1) - } + if err := (&controllers.AzureManagedControlPlaneReconciler{ + Client: mgr.GetClient(), + Recorder: mgr.GetEventRecorderFor("azuremanagedcontrolplane-reconciler"), + ReconcileTimeout: reconcileTimeout, + WatchFilterValue: watchFilterValue, + }).SetupWithManager(ctx, mgr, controllers.Options{Options: controller.Options{MaxConcurrentReconciles: azureClusterConcurrency}, Cache: mcpCache}); err != nil { + setupLog.Error(err, "unable to create controller", "controller", "AzureManagedControlPlane") + os.Exit(1) } } } @@ -512,7 +510,7 @@ func registerWebhooks(mgr manager.Manager) { // NOTE: AzureManagedCluster is behind AKS feature gate flag; the webhook // is going to prevent creating or updating new objects in case the feature flag is disabled - if err := (&infrav1exp.AzureManagedCluster{}).SetupWebhookWithManager(mgr); err != nil { + if err := (&infrav1.AzureManagedCluster{}).SetupWebhookWithManager(mgr); err != nil { setupLog.Error(err, "unable to create webhook", "webhook", "AzureManagedCluster") os.Exit(1) } @@ -525,16 +523,16 @@ func registerWebhooks(mgr manager.Manager) { &infrav1exp.AzureMachinePool{}, mgr.GetClient(), )) hookServer.Register("/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedmachinepool", webhookutils.NewMutatingWebhook( - &infrav1exp.AzureManagedMachinePool{}, mgr.GetClient(), + &infrav1.AzureManagedMachinePool{}, mgr.GetClient(), )) hookServer.Register("/validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedmachinepool", webhookutils.NewValidatingWebhook( - &infrav1exp.AzureManagedMachinePool{}, mgr.GetClient(), + &infrav1.AzureManagedMachinePool{}, mgr.GetClient(), )) hookServer.Register("/mutate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedcontrolplane", webhookutils.NewMutatingWebhook( - &infrav1exp.AzureManagedControlPlane{}, mgr.GetClient(), + &infrav1.AzureManagedControlPlane{}, mgr.GetClient(), )) hookServer.Register("/validate-infrastructure-cluster-x-k8s-io-v1beta1-azuremanagedcontrolplane", webhookutils.NewValidatingWebhook( - &infrav1exp.AzureManagedControlPlane{}, mgr.GetClient(), + &infrav1.AzureManagedControlPlane{}, mgr.GetClient(), )) if err := mgr.AddReadyzCheck("webhook", mgr.GetWebhookServer().StartedChecker()); err != nil { diff --git a/test/e2e/aks.go b/test/e2e/aks.go index 5b9f7e68e11..1a189a2e476 100644 --- a/test/e2e/aks.go +++ b/test/e2e/aks.go @@ -25,7 +25,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/types" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" @@ -120,8 +120,8 @@ type GetAzureManagedControlPlaneByClusterInput struct { // GetAzureManagedControlPlaneByCluster returns the AzureManagedControlPlane object for a cluster. // Important! this method relies on labels that are created by the CAPI controllers during the first reconciliation, so // it is necessary to ensure this is already happened before calling it. -func GetAzureManagedControlPlaneByCluster(ctx context.Context, input GetAzureManagedControlPlaneByClusterInput) *infrav1exp.AzureManagedControlPlane { - controlPlaneList := &infrav1exp.AzureManagedControlPlaneList{} +func GetAzureManagedControlPlaneByCluster(ctx context.Context, input GetAzureManagedControlPlaneByClusterInput) *infrav1.AzureManagedControlPlane { + controlPlaneList := &infrav1.AzureManagedControlPlaneList{} Expect(input.Lister.List(ctx, controlPlaneList, byClusterOptions(input.ClusterName, input.Namespace)...)).To(Succeed(), "Failed to list AzureManagedControlPlane object for Cluster %s/%s", input.Namespace, input.ClusterName) Expect(len(controlPlaneList.Items)).NotTo(BeNumerically(">", 1), "Cluster %s/%s should not have more than 1 AzureManagedControlPlane object", input.Namespace, input.ClusterName) if len(controlPlaneList.Items) == 1 { @@ -134,7 +134,7 @@ func GetAzureManagedControlPlaneByCluster(ctx context.Context, input GetAzureMan type WaitForControlPlaneAndMachinesReadyInput struct { Lister framework.Lister Getter framework.Getter - ControlPlane *infrav1exp.AzureManagedControlPlane + ControlPlane *infrav1.AzureManagedControlPlane ClusterName string Namespace string } @@ -175,11 +175,11 @@ func WaitForAKSSystemNodePoolMachinesToExist(ctx context.Context, input WaitForC Eventually(func() bool { opt1 := client.InNamespace(input.Namespace) opt2 := client.MatchingLabels(map[string]string{ - infrav1exp.LabelAgentPoolMode: string(infrav1exp.NodePoolModeSystem), - clusterv1.ClusterLabelName: input.ClusterName, + infrav1.LabelAgentPoolMode: string(infrav1.NodePoolModeSystem), + clusterv1.ClusterLabelName: input.ClusterName, }) - ammpList := &infrav1exp.AzureManagedMachinePoolList{} + ammpList := &infrav1.AzureManagedMachinePoolList{} if err := input.Lister.List(ctx, ammpList, opt1, opt2); err != nil { LogWarningf("Failed to get machinePool: %+v", err) diff --git a/test/e2e/aks_autoscaler.go b/test/e2e/aks_autoscaler.go index 78b79c65421..15604e658e0 100644 --- a/test/e2e/aks_autoscaler.go +++ b/test/e2e/aks_autoscaler.go @@ -28,7 +28,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/types" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" azureutil "sigs.k8s.io/cluster-api-provider-azure/util/azure" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" @@ -54,14 +54,14 @@ func AKSAutoscaleSpec(ctx context.Context, inputGetter func() AKSAutoscaleSpecIn mgmtClient := bootstrapClusterProxy.GetClient() Expect(mgmtClient).NotTo(BeNil()) - amcp := &infrav1exp.AzureManagedControlPlane{} + amcp := &infrav1.AzureManagedControlPlane{} err = mgmtClient.Get(ctx, types.NamespacedName{ Namespace: input.Cluster.Spec.ControlPlaneRef.Namespace, Name: input.Cluster.Spec.ControlPlaneRef.Name, }, amcp) Expect(err).NotTo(HaveOccurred()) - ammp := &infrav1exp.AzureManagedMachinePool{} + ammp := &infrav1.AzureManagedMachinePool{} err = mgmtClient.Get(ctx, client.ObjectKeyFromObject(input.MachinePool), ammp) Expect(err).NotTo(HaveOccurred()) @@ -83,7 +83,7 @@ func AKSAutoscaleSpec(ctx context.Context, inputGetter func() AKSAutoscaleSpecIn ammp.Spec.Scaling = nil } else { enabling = "Enabling" - ammp.Spec.Scaling = &infrav1exp.ManagedMachinePoolScaling{ + ammp.Spec.Scaling = &infrav1.ManagedMachinePoolScaling{ MinSize: to.Int32Ptr(1), MaxSize: to.Int32Ptr(2), } diff --git a/test/e2e/aks_azure_cluster_autoscaler.go b/test/e2e/aks_azure_cluster_autoscaler.go index b5292c0d003..1876ce88ad7 100644 --- a/test/e2e/aks_azure_cluster_autoscaler.go +++ b/test/e2e/aks_azure_cluster_autoscaler.go @@ -28,7 +28,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/types" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) @@ -50,7 +50,7 @@ func AKSAzureClusterAutoscalerSettingsSpec(ctx context.Context, inputGetter func containerserviceClient := containerservice.NewManagedClustersClient(subscriptionID) containerserviceClient.Authorizer = auth - amcp := &infrav1exp.AzureManagedControlPlane{} + amcp := &infrav1.AzureManagedControlPlane{} err = mgmtClient.Get(ctx, types.NamespacedName{ Namespace: input.Cluster.Spec.ControlPlaneRef.Namespace, Name: input.Cluster.Spec.ControlPlaneRef.Name, @@ -63,20 +63,20 @@ func AKSAzureClusterAutoscalerSettingsSpec(ctx context.Context, inputGetter func aksInitialAutoScalerProfile := aks.AutoScalerProfile var expectedAksExpander containerservice.Expander - var newExpanderValue infrav1exp.Expander + var newExpanderValue infrav1.Expander // Conditional is based off of the actual AKS settings not the AzureManagedControlPlane if aksInitialAutoScalerProfile == nil { expectedAksExpander = containerservice.ExpanderLeastWaste - newExpanderValue = infrav1exp.ExpanderLeastWaste + newExpanderValue = infrav1.ExpanderLeastWaste } else if aksInitialAutoScalerProfile.Expander == containerservice.ExpanderLeastWaste { expectedAksExpander = containerservice.ExpanderMostPods - newExpanderValue = infrav1exp.ExpanderMostPods + newExpanderValue = infrav1.ExpanderMostPods } amcp.Spec.AutoScalerProfile = nil Expect(mgmtClient.Update(ctx, amcp)).To(Succeed()) Eventually(func(g Gomega) { - amcp := &infrav1exp.AzureManagedControlPlane{} + amcp := &infrav1.AzureManagedControlPlane{} err = mgmtClient.Get(ctx, types.NamespacedName{ Namespace: input.Cluster.Spec.ControlPlaneRef.Namespace, Name: input.Cluster.Spec.ControlPlaneRef.Name, @@ -86,8 +86,8 @@ func AKSAzureClusterAutoscalerSettingsSpec(ctx context.Context, inputGetter func }, input.WaitIntervals...).Should(Succeed()) // Now set to the new value - amcp.Spec.AutoScalerProfile = &infrav1exp.AutoScalerProfile{ - Expander: (*infrav1exp.Expander)(to.StringPtr(string(newExpanderValue))), + amcp.Spec.AutoScalerProfile = &infrav1.AutoScalerProfile{ + Expander: (*infrav1.Expander)(to.StringPtr(string(newExpanderValue))), } Expect(mgmtClient.Update(ctx, amcp)).To(Succeed()) By("Verifying the cluster-autoscaler settings have changed") @@ -99,7 +99,7 @@ func AKSAzureClusterAutoscalerSettingsSpec(ctx context.Context, inputGetter func g.Expect(aks.AutoScalerProfile.Expander).To(Equal(expectedAksExpander)) }, input.WaitIntervals...).Should(Succeed()) - amcp = &infrav1exp.AzureManagedControlPlane{} + amcp = &infrav1.AzureManagedControlPlane{} err = mgmtClient.Get(ctx, types.NamespacedName{ Namespace: input.Cluster.Spec.ControlPlaneRef.Namespace, Name: input.Cluster.Spec.ControlPlaneRef.Name, @@ -109,7 +109,7 @@ func AKSAzureClusterAutoscalerSettingsSpec(ctx context.Context, inputGetter func Expect(mgmtClient.Update(ctx, amcp)).To(Succeed()) Eventually(func(g Gomega) { - amcp := &infrav1exp.AzureManagedControlPlane{} + amcp := &infrav1.AzureManagedControlPlane{} err = mgmtClient.Get(ctx, types.NamespacedName{ Namespace: input.Cluster.Spec.ControlPlaneRef.Namespace, Name: input.Cluster.Spec.ControlPlaneRef.Name, diff --git a/test/e2e/aks_machinepools.go b/test/e2e/aks_machinepools.go index e6137d7660e..063be52a80d 100644 --- a/test/e2e/aks_machinepools.go +++ b/test/e2e/aks_machinepools.go @@ -27,7 +27,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/types" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" @@ -87,14 +87,14 @@ func AKSMachinePoolSpec(ctx context.Context, inputGetter func() AKSMachinePoolSp // System node pools cannot be scaled to 0, so only include user node pools. var machinePoolsToScale []*expv1.MachinePool for _, mp := range input.MachinePools { - ammp := &infrav1exp.AzureManagedMachinePool{} + ammp := &infrav1.AzureManagedMachinePool{} err := bootstrapClusterProxy.GetClient().Get(ctx, types.NamespacedName{ Namespace: mp.Spec.Template.Spec.InfrastructureRef.Namespace, Name: mp.Spec.Template.Spec.InfrastructureRef.Name, }, ammp) Expect(err).NotTo(HaveOccurred()) - if ammp.Spec.Mode != string(infrav1exp.NodePoolModeSystem) { + if ammp.Spec.Mode != string(infrav1.NodePoolModeSystem) { machinePoolsToScale = append(machinePoolsToScale, mp) } } diff --git a/test/e2e/aks_public_ip_prefix.go b/test/e2e/aks_public_ip_prefix.go index abe22dea642..28c62fac3f4 100644 --- a/test/e2e/aks_public_ip_prefix.go +++ b/test/e2e/aks_public_ip_prefix.go @@ -31,7 +31,6 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" azureutil "sigs.k8s.io/cluster-api-provider-azure/util/azure" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" @@ -57,7 +56,7 @@ func AKSPublicIPPrefixSpec(ctx context.Context, inputGetter func() AKSPublicIPPr mgmtClient := bootstrapClusterProxy.GetClient() Expect(mgmtClient).NotTo(BeNil()) - infraControlPlane := &infrav1exp.AzureManagedControlPlane{} + infraControlPlane := &infrav1.AzureManagedControlPlane{} err = mgmtClient.Get(ctx, client.ObjectKey{Namespace: input.Cluster.Spec.ControlPlaneRef.Namespace, Name: input.Cluster.Spec.ControlPlaneRef.Name}, infraControlPlane) Expect(err).NotTo(HaveOccurred()) @@ -84,12 +83,12 @@ func AKSPublicIPPrefixSpec(ctx context.Context, inputGetter func() AKSPublicIPPr }, input.WaitIntervals...).Should(Succeed(), "failed to create public IP prefix") By("Creating node pool with 3 nodes") - infraMachinePool := &infrav1exp.AzureManagedMachinePool{ + infraMachinePool := &infrav1.AzureManagedMachinePool{ ObjectMeta: metav1.ObjectMeta{ Name: "pool3", Namespace: input.Cluster.Namespace, }, - Spec: infrav1exp.AzureManagedMachinePoolSpec{ + Spec: infrav1.AzureManagedMachinePoolSpec{ Mode: "User", SKU: "Standard_D2s_v3", EnableNodePublicIP: to.BoolPtr(true), @@ -114,7 +113,7 @@ func AKSPublicIPPrefixSpec(ctx context.Context, inputGetter func() AKSPublicIPPr }, ClusterName: input.Cluster.Name, InfrastructureRef: corev1.ObjectReference{ - APIVersion: infrav1exp.GroupVersion.String(), + APIVersion: infrav1.GroupVersion.String(), Kind: "AzureManagedMachinePool", Name: infraMachinePool.Name, }, @@ -137,14 +136,14 @@ func AKSPublicIPPrefixSpec(ctx context.Context, inputGetter func() AKSPublicIPPr }, input.WaitIntervals...).Should(BeTrue(), "Deleted MachinePool %s/%s still exists", machinePool.Namespace, machinePool.Name) Eventually(func() bool { - err := mgmtClient.Get(ctx, client.ObjectKeyFromObject(infraMachinePool), &infrav1exp.AzureManagedMachinePool{}) + err := mgmtClient.Get(ctx, client.ObjectKeyFromObject(infraMachinePool), &infrav1.AzureManagedMachinePool{}) return apierrors.IsNotFound(err) }, input.WaitIntervals...).Should(BeTrue(), "Deleted AzureManagedMachinePool %s/%s still exists", infraMachinePool.Namespace, infraMachinePool.Name) }() By("Verifying the AzureManagedMachinePool converges to a failed ready status") Eventually(func(g Gomega) { - infraMachinePool := &infrav1exp.AzureManagedMachinePool{} + infraMachinePool := &infrav1.AzureManagedMachinePool{} err := mgmtClient.Get(ctx, client.ObjectKeyFromObject(machinePool), infraMachinePool) g.Expect(err).NotTo(HaveOccurred()) cond := conditions.Get(infraMachinePool, infrav1.AgentPoolsReadyCondition) @@ -163,7 +162,7 @@ func AKSPublicIPPrefixSpec(ctx context.Context, inputGetter func() AKSPublicIPPr By("Verifying the AzureManagedMachinePool becomes ready") Eventually(func(g Gomega) { - infraMachinePool := &infrav1exp.AzureManagedMachinePool{} + infraMachinePool := &infrav1.AzureManagedMachinePool{} err := mgmtClient.Get(ctx, client.ObjectKeyFromObject(machinePool), infraMachinePool) g.Expect(err).NotTo(HaveOccurred()) g.Expect(conditions.IsTrue(infraMachinePool, infrav1.AgentPoolsReadyCondition)).To(BeTrue()) diff --git a/test/e2e/aks_tags.go b/test/e2e/aks_tags.go index 393bf468b50..60897c909b1 100644 --- a/test/e2e/aks_tags.go +++ b/test/e2e/aks_tags.go @@ -30,7 +30,6 @@ import ( "k8s.io/apimachinery/pkg/types" infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" "sigs.k8s.io/cluster-api-provider-azure/azure/converters" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" @@ -60,7 +59,7 @@ func AKSAdditionalTagsSpec(ctx context.Context, inputGetter func() AKSAdditional mgmtClient := bootstrapClusterProxy.GetClient() Expect(mgmtClient).NotTo(BeNil()) - infraControlPlane := &infrav1exp.AzureManagedControlPlane{} + infraControlPlane := &infrav1.AzureManagedControlPlane{} err = mgmtClient.Get(ctx, client.ObjectKey{ Namespace: input.Cluster.Spec.ControlPlaneRef.Namespace, Name: input.Cluster.Spec.ControlPlaneRef.Name, @@ -127,7 +126,7 @@ func AKSAdditionalTagsSpec(ctx context.Context, inputGetter func() AKSAdditional defer GinkgoRecover() defer wg.Done() - ammp := &infrav1exp.AzureManagedMachinePool{} + ammp := &infrav1.AzureManagedMachinePool{} Expect(mgmtClient.Get(ctx, types.NamespacedName{ Namespace: mp.Spec.Template.Spec.InfrastructureRef.Namespace, Name: mp.Spec.Template.Spec.InfrastructureRef.Name, diff --git a/test/e2e/aks_upgrade.go b/test/e2e/aks_upgrade.go index 1679516f6be..d6df34bb0c2 100644 --- a/test/e2e/aks_upgrade.go +++ b/test/e2e/aks_upgrade.go @@ -27,7 +27,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/pkg/errors" - infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1" azureutil "sigs.k8s.io/cluster-api-provider-azure/util/azure" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" @@ -58,7 +58,7 @@ func AKSUpgradeSpec(ctx context.Context, inputGetter func() AKSUpgradeSpecInput) mgmtClient := bootstrapClusterProxy.GetClient() Expect(mgmtClient).NotTo(BeNil()) - infraControlPlane := &infrav1exp.AzureManagedControlPlane{} + infraControlPlane := &infrav1.AzureManagedControlPlane{} err = mgmtClient.Get(ctx, client.ObjectKey{Namespace: input.Cluster.Spec.ControlPlaneRef.Namespace, Name: input.Cluster.Spec.ControlPlaneRef.Name}, infraControlPlane) Expect(err).NotTo(HaveOccurred()) diff --git a/test/e2e/azure_logcollector.go b/test/e2e/azure_logcollector.go index a1639c84228..111dabd9dca 100644 --- a/test/e2e/azure_logcollector.go +++ b/test/e2e/azure_logcollector.go @@ -189,13 +189,13 @@ func getAzureCluster(ctx context.Context, managementClusterClient client.Client, return azCluster, err } -func getAzureManagedControlPlane(ctx context.Context, managementClusterClient client.Client, namespace, name string) (*infrav1exp.AzureManagedControlPlane, error) { +func getAzureManagedControlPlane(ctx context.Context, managementClusterClient client.Client, namespace, name string) (*infrav1.AzureManagedControlPlane, error) { key := client.ObjectKey{ Namespace: namespace, Name: name, } - azManagedControlPlane := &infrav1exp.AzureManagedControlPlane{} + azManagedControlPlane := &infrav1.AzureManagedControlPlane{} err := managementClusterClient.Get(ctx, key, azManagedControlPlane) return azManagedControlPlane, err } @@ -222,13 +222,13 @@ func getAzureMachinePool(ctx context.Context, managementClusterClient client.Cli return azMachinePool, err } -func getAzureManagedMachinePool(ctx context.Context, managementClusterClient client.Client, mp *expv1.MachinePool) (*infrav1exp.AzureManagedMachinePool, error) { +func getAzureManagedMachinePool(ctx context.Context, managementClusterClient client.Client, mp *expv1.MachinePool) (*infrav1.AzureManagedMachinePool, error) { key := client.ObjectKey{ Namespace: mp.Spec.Template.Spec.InfrastructureRef.Namespace, Name: mp.Spec.Template.Spec.InfrastructureRef.Name, } - azManagedMachinePool := &infrav1exp.AzureManagedMachinePool{} + azManagedMachinePool := &infrav1.AzureManagedMachinePool{} err := managementClusterClient.Get(ctx, key, azManagedMachinePool) return azManagedMachinePool, err } diff --git a/test/e2e/azure_test.go b/test/e2e/azure_test.go index b0b234fbec0..f2cd8e2a9e6 100644 --- a/test/e2e/azure_test.go +++ b/test/e2e/azure_test.go @@ -622,7 +622,7 @@ var _ = Describe("Workload cluster creation", func() { // You can override the default SKU `Standard_D2s_v3` by setting the // `AZURE_AKS_NODE_MACHINE_TYPE` environment variable. - Context("Creating an AKS cluster [EXPERIMENTAL][Managed Kubernetes]", func() { + Context("Creating an AKS cluster [Managed Kubernetes]", func() { It("with a single control plane node and 1 node", func() { clusterName = getClusterName(clusterNamePrefix, aksClusterNameSuffix) kubernetesVersionUpgradeFrom, err := GetAKSKubernetesVersion(ctx, e2eConfig, AKSKubernetesVersionUpgradeFrom) diff --git a/test/e2e/config/azure-dev.yaml b/test/e2e/config/azure-dev.yaml index e49ad7c240c..6eb2d476e90 100644 --- a/test/e2e/config/azure-dev.yaml +++ b/test/e2e/config/azure-dev.yaml @@ -159,7 +159,6 @@ variables: CNI: "${PWD}/templates/addons/calico.yaml" ADDONS_PATH: "${PWD}/templates/addons" REDACT_LOG_SCRIPT: "${PWD}/hack/log/redact.sh" - EXP_AKS: "true" EXP_AKS_RESOURCE_HEALTH: "true" EXP_MACHINE_POOL: "true" EXP_CLUSTER_RESOURCE_SET: "true"