Skip to content

Commit 216befe

Browse files
committed
graduate AKS APIs from experimental
1 parent f3ca6bc commit 216befe

File tree

88 files changed

+4431
-4411
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+4431
-4411
lines changed

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,6 @@ create-aks-cluster: $(KUSTOMIZE) $(ENVSUBST) $(KUBECTL) ## Create a aks cluster.
337337
.PHONY: create-cluster
338338
create-cluster: ## Create a workload development Kubernetes cluster on Azure in a kind management cluster.
339339
EXP_CLUSTER_RESOURCE_SET=true \
340-
EXP_AKS=true \
341340
EXP_MACHINE_POOL=true \
342341
$(MAKE) create-management-cluster \
343342
create-workload-cluster
@@ -707,7 +706,7 @@ kind-create: $(KUBECTL) ## Create capz kind cluster if needed.
707706

708707
.PHONY: tilt-up
709708
tilt-up: install-tools kind-create ## Start tilt and build kind cluster if needed.
710-
EXP_CLUSTER_RESOURCE_SET=true EXP_AKS=true EXP_MACHINE_POOL=true tilt up
709+
EXP_CLUSTER_RESOURCE_SET=true EXP_MACHINE_POOL=true tilt up
711710

712711
.PHONY: delete-cluster
713712
delete-cluster: delete-workload-cluster ## Deletes the example kind cluster "capz".

exp/api/v1alpha3/azuremanagedcluster_conversion.go renamed to api/v1alpha3/azuremanagedcluster_conversion.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ limitations under the License.
1717
package v1alpha3
1818

1919
import (
20-
infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1"
20+
infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1"
2121
utilconversion "sigs.k8s.io/cluster-api/util/conversion"
2222
"sigs.k8s.io/controller-runtime/pkg/conversion"
2323
)
2424

2525
// ConvertTo converts this AzureManagedCluster to the Hub version (v1beta1).
2626
func (src *AzureManagedCluster) ConvertTo(dstRaw conversion.Hub) error {
27-
dst := dstRaw.(*infrav1exp.AzureManagedCluster)
27+
dst := dstRaw.(*infrav1.AzureManagedCluster)
2828
if err := Convert_v1alpha3_AzureManagedCluster_To_v1beta1_AzureManagedCluster(src, dst, nil); err != nil {
2929
return err
3030
}
3131

3232
// Manually restore data.
33-
restored := &infrav1exp.AzureManagedCluster{}
33+
restored := &infrav1.AzureManagedCluster{}
3434
if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok {
3535
return err
3636
}
@@ -40,7 +40,7 @@ func (src *AzureManagedCluster) ConvertTo(dstRaw conversion.Hub) error {
4040

4141
// ConvertFrom converts from the Hub version (v1beta1) to this version.
4242
func (dst *AzureManagedCluster) ConvertFrom(srcRaw conversion.Hub) error {
43-
src := srcRaw.(*infrav1exp.AzureManagedCluster)
43+
src := srcRaw.(*infrav1.AzureManagedCluster)
4444

4545
if err := Convert_v1beta1_AzureManagedCluster_To_v1alpha3_AzureManagedCluster(src, dst, nil); err != nil {
4646
return err
@@ -52,12 +52,12 @@ func (dst *AzureManagedCluster) ConvertFrom(srcRaw conversion.Hub) error {
5252

5353
// ConvertTo converts this AzureManagedClusterList to the Hub version (v1beta1).
5454
func (src *AzureManagedClusterList) ConvertTo(dstRaw conversion.Hub) error {
55-
dst := dstRaw.(*infrav1exp.AzureManagedClusterList)
55+
dst := dstRaw.(*infrav1.AzureManagedClusterList)
5656
return Convert_v1alpha3_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(src, dst, nil)
5757
}
5858

5959
// ConvertFrom converts from the Hub version (v1beta1) to this version.
6060
func (dst *AzureManagedClusterList) ConvertFrom(srcRaw conversion.Hub) error {
61-
src := srcRaw.(*infrav1exp.AzureManagedClusterList)
61+
src := srcRaw.(*infrav1.AzureManagedClusterList)
6262
return Convert_v1beta1_AzureManagedClusterList_To_v1alpha3_AzureManagedClusterList(src, dst, nil)
6363
}
File renamed without changes.

exp/api/v1alpha3/azuremanagedcontrolplane_conversion.go renamed to api/v1alpha3/azuremanagedcontrolplane_conversion.go

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ package v1alpha3
1818

1919
import (
2020
apiconversion "k8s.io/apimachinery/pkg/conversion"
21-
infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1"
21+
infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1"
2222
utilconversion "sigs.k8s.io/cluster-api/util/conversion"
2323
"sigs.k8s.io/controller-runtime/pkg/conversion"
2424
)
2525

2626
// ConvertTo converts this AzureManagedControlPlane to the Hub version (v1beta1).
2727
func (src *AzureManagedControlPlane) ConvertTo(dstRaw conversion.Hub) error {
28-
dst := dstRaw.(*infrav1exp.AzureManagedControlPlane)
28+
dst := dstRaw.(*infrav1.AzureManagedControlPlane)
2929
if err := Convert_v1alpha3_AzureManagedControlPlane_To_v1beta1_AzureManagedControlPlane(src, dst, nil); err != nil {
3030
return err
3131
}
3232

3333
// Manually restore data.
34-
restored := &infrav1exp.AzureManagedControlPlane{}
34+
restored := &infrav1.AzureManagedControlPlane{}
3535
if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok {
3636
return err
3737
}
@@ -53,7 +53,7 @@ func (src *AzureManagedControlPlane) ConvertTo(dstRaw conversion.Hub) error {
5353

5454
// ConvertFrom converts from the Hub version (v1beta1) to this version.
5555
func (dst *AzureManagedControlPlane) ConvertFrom(srcRaw conversion.Hub) error {
56-
src := srcRaw.(*infrav1exp.AzureManagedControlPlane)
56+
src := srcRaw.(*infrav1.AzureManagedControlPlane)
5757

5858
if err := Convert_v1beta1_AzureManagedControlPlane_To_v1alpha3_AzureManagedControlPlane(src, dst, nil); err != nil {
5959
return err
@@ -64,33 +64,38 @@ func (dst *AzureManagedControlPlane) ConvertFrom(srcRaw conversion.Hub) error {
6464
}
6565

6666
// Convert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha3_AzureManagedControlPlaneSpec is an autogenerated conversion function.
67-
func Convert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha3_AzureManagedControlPlaneSpec(in *infrav1exp.AzureManagedControlPlaneSpec, out *AzureManagedControlPlaneSpec, s apiconversion.Scope) error {
67+
func Convert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha3_AzureManagedControlPlaneSpec(in *infrav1.AzureManagedControlPlaneSpec, out *AzureManagedControlPlaneSpec, s apiconversion.Scope) error {
6868
return autoConvert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha3_AzureManagedControlPlaneSpec(in, out, s)
6969
}
7070

7171
// Convert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha3_AzureManagedControlPlaneStatus is an autogenerated conversion function.
72-
func Convert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha3_AzureManagedControlPlaneStatus(in *infrav1exp.AzureManagedControlPlaneStatus, out *AzureManagedControlPlaneStatus, s apiconversion.Scope) error {
72+
func Convert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha3_AzureManagedControlPlaneStatus(in *infrav1.AzureManagedControlPlaneStatus, out *AzureManagedControlPlaneStatus, s apiconversion.Scope) error {
7373
return autoConvert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha3_AzureManagedControlPlaneStatus(in, out, s)
7474
}
7575

7676
// ConvertTo converts this AzureManagedControlPlane to the Hub version (v1beta1).
7777
func (src *AzureManagedControlPlaneList) ConvertTo(dstRaw conversion.Hub) error {
78-
dst := dstRaw.(*infrav1exp.AzureManagedControlPlaneList)
78+
dst := dstRaw.(*infrav1.AzureManagedControlPlaneList)
7979
return Convert_v1alpha3_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(src, dst, nil)
8080
}
8181

8282
// ConvertFrom converts from the Hub version (v1beta1) to this version.
8383
func (dst *AzureManagedControlPlaneList) ConvertFrom(srcRaw conversion.Hub) error {
84-
src := srcRaw.(*infrav1exp.AzureManagedControlPlaneList)
84+
src := srcRaw.(*infrav1.AzureManagedControlPlaneList)
8585
return Convert_v1beta1_AzureManagedControlPlaneList_To_v1alpha3_AzureManagedControlPlaneList(src, dst, nil)
8686
}
8787

8888
// Convert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha3_ManagedControlPlaneVirtualNetwork converts v1beta1 ManagedControlPlaneVirtualNetwork to v1alpha3 ManagedControlPlaneVirtualNetwork.
89-
func Convert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha3_ManagedControlPlaneVirtualNetwork(in *infrav1exp.ManagedControlPlaneVirtualNetwork, out *ManagedControlPlaneVirtualNetwork, s apiconversion.Scope) error {
89+
func Convert_v1beta1_ManagedControlPlaneVirtualNetwork_To_v1alpha3_ManagedControlPlaneVirtualNetwork(in *infrav1.ManagedControlPlaneVirtualNetwork, out *ManagedControlPlaneVirtualNetwork, s apiconversion.Scope) error {
9090
out.Name = in.Name
9191
out.Subnet.Name = in.Subnet.Name
9292
out.Subnet.CIDRBlock = in.Subnet.CIDRBlock
9393
out.CIDRBlock = in.CIDRBlock
9494

9595
return nil
9696
}
97+
98+
// Convert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha3_ManagedControlPlaneSubnet is a conversion function.
99+
func Convert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha3_ManagedControlPlaneSubnet(in *infrav1.ManagedControlPlaneSubnet, out *ManagedControlPlaneSubnet, s apiconversion.Scope) error {
100+
return autoConvert_v1beta1_ManagedControlPlaneSubnet_To_v1alpha3_ManagedControlPlaneSubnet(in, out, s)
101+
}

exp/api/v1alpha3/azuremanagedcontrolplane_types.go renamed to api/v1alpha3/azuremanagedcontrolplane_types.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package v1alpha3
1818

1919
import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21-
infrav1alpha3 "sigs.k8s.io/cluster-api-provider-azure/api/v1alpha3"
2221
clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3"
2322
)
2423

@@ -52,7 +51,7 @@ type AzureManagedControlPlaneSpec struct {
5251
// AdditionalTags is an optional set of tags to add to Azure resources managed by the Azure provider, in addition to the
5352
// ones added by default.
5453
// +optional
55-
AdditionalTags infrav1alpha3.Tags `json:"additionalTags,omitempty"`
54+
AdditionalTags Tags `json:"additionalTags,omitempty"`
5655

5756
// NetworkPlugin used for building Kubernetes network.
5857
// +kubebuilder:validation:Enum=azure;kubenet

exp/api/v1alpha3/azuremanagedmachinepool_conversion.go renamed to api/v1alpha3/azuremanagedmachinepool_conversion.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ package v1alpha3
1818

1919
import (
2020
apiconversion "k8s.io/apimachinery/pkg/conversion"
21-
infrav1exp "sigs.k8s.io/cluster-api-provider-azure/exp/api/v1beta1"
21+
infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1"
2222
utilconversion "sigs.k8s.io/cluster-api/util/conversion"
2323
"sigs.k8s.io/controller-runtime/pkg/conversion"
2424
)
2525

2626
// ConvertTo converts this AzureManagedMachinePool to the Hub version (v1beta1).
2727
func (src *AzureManagedMachinePool) ConvertTo(dstRaw conversion.Hub) error {
28-
dst := dstRaw.(*infrav1exp.AzureManagedMachinePool)
28+
dst := dstRaw.(*infrav1.AzureManagedMachinePool)
2929
if err := Convert_v1alpha3_AzureManagedMachinePool_To_v1beta1_AzureManagedMachinePool(src, dst, nil); err != nil {
3030
return err
3131
}
3232

3333
// Manually restore data.
34-
restored := &infrav1exp.AzureManagedMachinePool{}
34+
restored := &infrav1.AzureManagedMachinePool{}
3535
if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok {
3636
return err
3737
}
@@ -62,7 +62,7 @@ func (src *AzureManagedMachinePool) ConvertTo(dstRaw conversion.Hub) error {
6262

6363
// ConvertFrom converts from the Hub version (v1beta1) to this version.
6464
func (dst *AzureManagedMachinePool) ConvertFrom(srcRaw conversion.Hub) error {
65-
src := srcRaw.(*infrav1exp.AzureManagedMachinePool)
65+
src := srcRaw.(*infrav1.AzureManagedMachinePool)
6666
if err := Convert_v1beta1_AzureManagedMachinePool_To_v1alpha3_AzureManagedMachinePool(src, dst, nil); err != nil {
6767
return err
6868
}
@@ -72,23 +72,23 @@ func (dst *AzureManagedMachinePool) ConvertFrom(srcRaw conversion.Hub) error {
7272
}
7373

7474
// Convert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha3_AzureManagedMachinePoolSpec is an autogenerated conversion function.
75-
func Convert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha3_AzureManagedMachinePoolSpec(in *infrav1exp.AzureManagedMachinePoolSpec, out *AzureManagedMachinePoolSpec, s apiconversion.Scope) error {
75+
func Convert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha3_AzureManagedMachinePoolSpec(in *infrav1.AzureManagedMachinePoolSpec, out *AzureManagedMachinePoolSpec, s apiconversion.Scope) error {
7676
return autoConvert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha3_AzureManagedMachinePoolSpec(in, out, s)
7777
}
7878

7979
// Convert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha3_AzureManagedMachinePoolStatus is an autogenerated conversion function.
80-
func Convert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha3_AzureManagedMachinePoolStatus(in *infrav1exp.AzureManagedMachinePoolStatus, out *AzureManagedMachinePoolStatus, s apiconversion.Scope) error {
80+
func Convert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha3_AzureManagedMachinePoolStatus(in *infrav1.AzureManagedMachinePoolStatus, out *AzureManagedMachinePoolStatus, s apiconversion.Scope) error {
8181
return autoConvert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha3_AzureManagedMachinePoolStatus(in, out, s)
8282
}
8383

8484
// ConvertTo converts this AzureManagedMachinePoolList to the Hub version (v1beta1).
8585
func (src *AzureManagedMachinePoolList) ConvertTo(dstRaw conversion.Hub) error {
86-
dst := dstRaw.(*infrav1exp.AzureManagedMachinePoolList)
86+
dst := dstRaw.(*infrav1.AzureManagedMachinePoolList)
8787
return Convert_v1alpha3_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(src, dst, nil)
8888
}
8989

9090
// ConvertFrom converts from the Hub version (v1beta1) to this version.
9191
func (dst *AzureManagedMachinePoolList) ConvertFrom(srcRaw conversion.Hub) error {
92-
src := srcRaw.(*infrav1exp.AzureManagedMachinePoolList)
92+
src := srcRaw.(*infrav1.AzureManagedMachinePoolList)
9393
return Convert_v1beta1_AzureManagedMachinePoolList_To_v1alpha3_AzureManagedMachinePoolList(src, dst, nil)
9494
}
File renamed without changes.

api/v1alpha3/conversion_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,24 @@ func TestFuzzyConversion(t *testing.T) {
6262
Spoke: &AzureClusterIdentity{},
6363
FuzzerFuncs: []fuzzer.FuzzerFuncs{overrideDeprecatedAndRemovedFieldsFuncs},
6464
}))
65+
66+
t.Run("for AzureManagedCluster", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{
67+
Scheme: scheme,
68+
Hub: &infrav1.AzureManagedCluster{},
69+
Spoke: &AzureManagedCluster{},
70+
}))
71+
72+
t.Run("for AzureManagedControlPlane", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{
73+
Scheme: scheme,
74+
Hub: &infrav1.AzureManagedControlPlane{},
75+
Spoke: &AzureManagedControlPlane{},
76+
}))
77+
78+
t.Run("for AzureManagedMachinePool", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{
79+
Scheme: scheme,
80+
Hub: &infrav1.AzureManagedMachinePool{},
81+
Spoke: &AzureManagedMachinePool{},
82+
}))
6583
}
6684

6785
func overrideDeprecatedAndRemovedFieldsFuncs(codecs runtimeserializer.CodecFactory) []interface{} {

0 commit comments

Comments
 (0)