Skip to content

Commit 1f47719

Browse files
authored
Merge pull request #2042 from sonasingh46/verify-conversions
add verify-conversions target
2 parents 9940f37 + b03cb7b commit 1f47719

15 files changed

+1912
-8
lines changed

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ KUBETEST_WINDOWS_CONF_PATH ?= $(abspath $(E2E_DATA_DIR)/kubetest/$(KUBETEST_WIND
5353
KUBETEST_REPO_LIST_PATH ?= $(abspath $(E2E_DATA_DIR)/kubetest/)
5454
AZURE_TEMPLATES := $(E2E_DATA_DIR)/infrastructure-azure
5555
ADDONS_DIR := templates/addons
56+
CONVERSION_VERIFIER := $(TOOLS_BIN_DIR)/conversion-verifier
5657

5758
# use the project local tool binaries first
5859
export PATH := $(TOOLS_BIN_DIR):$(PATH)
@@ -238,6 +239,9 @@ manager: ## Build manager binary.
238239
## --------------------------------------
239240
## Tooling Binaries
240241
## --------------------------------------
242+
conversion-verifier: $(CONVERSION_VERIFIER) go.mod go.sum ## fetch CAPI's conversion verifier
243+
$(CONVERSION_VERIFIER): go.mod
244+
cd $(TOOLS_DIR); go build -tags=tools -o $@ sigs.k8s.io/cluster-api/hack/tools/conversion-verifier
241245

242246
$(CONTROLLER_GEN): ## Build controller-gen from tools folder.
243247
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) sigs.k8s.io/controller-tools/cmd/controller-gen $(CONTROLLER_GEN_BIN) $(CONTROLLER_GEN_VER)
@@ -661,7 +665,7 @@ clean-release: ## Remove the release folder
661665
rm -rf $(RELEASE_DIR)
662666

663667
.PHONY: verify
664-
verify: verify-boilerplate verify-modules verify-gen verify-shellcheck
668+
verify: verify-boilerplate verify-modules verify-gen verify-shellcheck verify-conversions
665669

666670
.PHONY: verify-boilerplate
667671
verify-boilerplate:
@@ -682,3 +686,7 @@ verify-gen: generate
682686
.PHONY: verify-shellcheck
683687
verify-shellcheck:
684688
./hack/verify-shellcheck.sh
689+
690+
.PHONY: verify-conversions
691+
verify-conversions: $(CONVERSION_VERIFIER) ## Verifies expected API conversion are in place
692+
$(CONVERSION_VERIFIER)

api/v1alpha3/azureclusteridentity_conversion.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,15 @@ func Convert_v1beta1_AzureClusterIdentitySpec_To_v1alpha3_AzureClusterIdentitySp
110110

111111
return nil
112112
}
113+
114+
// ConvertTo converts this AzureClusterIdentityList to the Hub version (v1beta1).
115+
func (src *AzureClusterIdentityList) ConvertTo(dstRaw conversion.Hub) error { // nolint
116+
dst := dstRaw.(*infrav1beta1.AzureClusterIdentityList)
117+
return Convert_v1alpha3_AzureClusterIdentityList_To_v1beta1_AzureClusterIdentityList(src, dst, nil)
118+
}
119+
120+
// ConvertFrom converts from the Hub version (v1beta1) to this version.
121+
func (dst *AzureClusterIdentityList) ConvertFrom(srcRaw conversion.Hub) error { // nolint
122+
src := srcRaw.(*infrav1beta1.AzureClusterIdentityList)
123+
return Convert_v1beta1_AzureClusterIdentityList_To_v1alpha3_AzureClusterIdentityList(src, dst, nil)
124+
}

api/v1alpha4/azureclusteridentity_conversion.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
// ConvertTo converts this AzureCluster to the Hub version (v1beta1).
2626
func (src *AzureClusterIdentity) ConvertTo(dstRaw conversion.Hub) error { // nolint
2727
dst := dstRaw.(*infrav1beta1.AzureClusterIdentity)
28-
2928
return Convert_v1alpha4_AzureClusterIdentity_To_v1beta1_AzureClusterIdentity(src, dst, nil)
3029
}
3130

@@ -34,3 +33,15 @@ func (dst *AzureClusterIdentity) ConvertFrom(srcRaw conversion.Hub) error { // n
3433
src := srcRaw.(*infrav1beta1.AzureClusterIdentity)
3534
return Convert_v1beta1_AzureClusterIdentity_To_v1alpha4_AzureClusterIdentity(src, dst, nil)
3635
}
36+
37+
// ConvertTo converts this AzureCluster to the Hub version (v1beta1).
38+
func (src *AzureClusterIdentityList) ConvertTo(dstRaw conversion.Hub) error { // nolint
39+
dst := dstRaw.(*infrav1beta1.AzureClusterIdentityList)
40+
return Convert_v1alpha4_AzureClusterIdentityList_To_v1beta1_AzureClusterIdentityList(src, dst, nil)
41+
}
42+
43+
// ConvertFrom converts from the Hub version (v1beta1) to this version.
44+
func (dst *AzureClusterIdentityList) ConvertFrom(srcRaw conversion.Hub) error { // nolint
45+
src := srcRaw.(*infrav1beta1.AzureClusterIdentityList)
46+
return Convert_v1beta1_AzureClusterIdentityList_To_v1alpha4_AzureClusterIdentityList(src, dst, nil)
47+
}

exp/api/v1alpha3/azuremachinepool_conversion.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,15 @@ func Convert_v1alpha3_AzureMachinePoolStatus_To_v1beta1_AzureMachinePoolStatus(i
132132
}
133133
return autoConvert_v1alpha3_AzureMachinePoolStatus_To_v1beta1_AzureMachinePoolStatus(in, out, s)
134134
}
135+
136+
// ConvertTo converts this AzureMachinePoolList to the Hub version (v1beta1).
137+
func (src *AzureMachinePoolList) ConvertTo(dstRaw conversion.Hub) error { // nolint
138+
dst := dstRaw.(*expv1beta1.AzureMachinePoolList)
139+
return Convert_v1alpha3_AzureMachinePoolList_To_v1beta1_AzureMachinePoolList(src, dst, nil)
140+
}
141+
142+
// ConvertFrom converts from the Hub version (v1beta1) to this version.
143+
func (dst *AzureMachinePoolList) ConvertFrom(srcRaw conversion.Hub) error { // nolint
144+
src := srcRaw.(*expv1beta1.AzureMachinePoolList)
145+
return Convert_v1beta1_AzureMachinePoolList_To_v1alpha3_AzureMachinePoolList(src, dst, nil)
146+
}

exp/api/v1alpha3/azuremanagedcluster_conversion.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,15 @@ func (dst *AzureManagedCluster) ConvertFrom(srcRaw conversion.Hub) error { // no
5454

5555
return nil
5656
}
57+
58+
// ConvertTo converts this AzureManagedClusterList to the Hub version (v1beta1).
59+
func (src *AzureManagedClusterList) ConvertTo(dstRaw conversion.Hub) error { // nolint
60+
dst := dstRaw.(*expv1beta1.AzureManagedClusterList)
61+
return Convert_v1alpha3_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(src, dst, nil)
62+
}
63+
64+
// ConvertFrom converts from the Hub version (v1beta1) to this version.
65+
func (dst *AzureManagedClusterList) ConvertFrom(srcRaw conversion.Hub) error { // nolint
66+
src := srcRaw.(*expv1beta1.AzureManagedClusterList)
67+
return Convert_v1beta1_AzureManagedClusterList_To_v1alpha3_AzureManagedClusterList(src, dst, nil)
68+
}

exp/api/v1alpha3/azuremanagedcontrolplane_conversion.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,15 @@ func Convert_v1beta1_AzureManagedControlPlaneSpec_To_v1alpha3_AzureManagedContro
7373
func Convert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha3_AzureManagedControlPlaneStatus(in *expv1beta1.AzureManagedControlPlaneStatus, out *AzureManagedControlPlaneStatus, s apiconversion.Scope) error {
7474
return autoConvert_v1beta1_AzureManagedControlPlaneStatus_To_v1alpha3_AzureManagedControlPlaneStatus(in, out, s)
7575
}
76+
77+
// ConvertTo converts this AzureManagedControlPlane to the Hub version (v1beta1).
78+
func (src *AzureManagedControlPlaneList) ConvertTo(dstRaw conversion.Hub) error { // nolint
79+
dst := dstRaw.(*expv1beta1.AzureManagedControlPlaneList)
80+
return Convert_v1alpha3_AzureManagedControlPlaneList_To_v1beta1_AzureManagedControlPlaneList(src, dst, nil)
81+
}
82+
83+
// ConvertFrom converts from the Hub version (v1beta1) to this version.
84+
func (dst *AzureManagedControlPlaneList) ConvertFrom(srcRaw conversion.Hub) error { // nolint
85+
src := srcRaw.(*expv1beta1.AzureManagedControlPlaneList)
86+
return Convert_v1beta1_AzureManagedControlPlaneList_To_v1alpha3_AzureManagedControlPlaneList(src, dst, nil)
87+
}

exp/api/v1alpha3/azuremanagedmachinepool_conversion.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,15 @@ func Convert_v1beta1_AzureManagedMachinePoolSpec_To_v1alpha3_AzureManagedMachine
7575
func Convert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha3_AzureManagedMachinePoolStatus(in *expv1beta1.AzureManagedMachinePoolStatus, out *AzureManagedMachinePoolStatus, s apiconversion.Scope) error {
7676
return autoConvert_v1beta1_AzureManagedMachinePoolStatus_To_v1alpha3_AzureManagedMachinePoolStatus(in, out, s)
7777
}
78+
79+
// ConvertTo converts this AzureManagedMachinePoolList to the Hub version (v1beta1).
80+
func (src *AzureManagedMachinePoolList) ConvertTo(dstRaw conversion.Hub) error { // nolint
81+
dst := dstRaw.(*expv1beta1.AzureManagedMachinePoolList)
82+
return Convert_v1alpha3_AzureManagedMachinePoolList_To_v1beta1_AzureManagedMachinePoolList(src, dst, nil)
83+
}
84+
85+
// ConvertFrom converts from the Hub version (v1beta1) to this version.
86+
func (dst *AzureManagedMachinePoolList) ConvertFrom(srcRaw conversion.Hub) error { // nolint
87+
src := srcRaw.(*expv1beta1.AzureManagedMachinePoolList)
88+
return Convert_v1beta1_AzureManagedMachinePoolList_To_v1alpha3_AzureManagedMachinePoolList(src, dst, nil)
89+
}

exp/api/v1alpha4/azuremachinepool_conversion.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,23 @@ import (
2424
// ConvertTo converts this AzureMachinePool to the Hub version (v1beta1).
2525
func (src *AzureMachinePool) ConvertTo(dstRaw conversion.Hub) error { // nolint
2626
dst := dstRaw.(*expv1beta1.AzureMachinePool)
27-
2827
return Convert_v1alpha4_AzureMachinePool_To_v1beta1_AzureMachinePool(src, dst, nil)
2928
}
3029

3130
// ConvertFrom converts from the Hub version (v1beta1) to this version.
3231
func (dst *AzureMachinePool) ConvertFrom(srcRaw conversion.Hub) error { // nolint
3332
src := srcRaw.(*expv1beta1.AzureMachinePool)
34-
3533
return Convert_v1beta1_AzureMachinePool_To_v1alpha4_AzureMachinePool(src, dst, nil)
3634
}
35+
36+
// ConvertTo converts this AzureMachinePool to the Hub version (v1beta1).
37+
func (src *AzureMachinePoolList) ConvertTo(dstRaw conversion.Hub) error { // nolint
38+
dst := dstRaw.(*expv1beta1.AzureMachinePoolList)
39+
return Convert_v1alpha4_AzureMachinePoolList_To_v1beta1_AzureMachinePoolList(src, dst, nil)
40+
}
41+
42+
// ConvertFrom converts from the Hub version (v1beta1) to this version.
43+
func (dst *AzureMachinePoolList) ConvertFrom(srcRaw conversion.Hub) error { // nolint
44+
src := srcRaw.(*expv1beta1.AzureMachinePoolList)
45+
return Convert_v1beta1_AzureMachinePoolList_To_v1alpha4_AzureMachinePoolList(src, dst, nil)
46+
}

exp/api/v1alpha4/azuremachinepoolmachine_conversion.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,23 @@ import (
2424
// ConvertTo converts this AzureMachinePoolMachine to the Hub version (v1beta1).
2525
func (src *AzureMachinePoolMachine) ConvertTo(dstRaw conversion.Hub) error { // nolint
2626
dst := dstRaw.(*expv1beta1.AzureMachinePoolMachine)
27-
2827
return Convert_v1alpha4_AzureMachinePoolMachine_To_v1beta1_AzureMachinePoolMachine(src, dst, nil)
2928
}
3029

3130
// ConvertFrom converts from the Hub version (v1beta1) to this version.
3231
func (dst *AzureMachinePoolMachine) ConvertFrom(srcRaw conversion.Hub) error { // nolint
3332
src := srcRaw.(*expv1beta1.AzureMachinePoolMachine)
34-
3533
return Convert_v1beta1_AzureMachinePoolMachine_To_v1alpha4_AzureMachinePoolMachine(src, dst, nil)
3634
}
35+
36+
// ConvertTo converts this AzureMachinePoolMachineList to the Hub version (v1beta1).
37+
func (src *AzureMachinePoolMachineList) ConvertTo(dstRaw conversion.Hub) error { // nolint
38+
dst := dstRaw.(*expv1beta1.AzureMachinePoolMachineList)
39+
return Convert_v1alpha4_AzureMachinePoolMachineList_To_v1beta1_AzureMachinePoolMachineList(src, dst, nil)
40+
}
41+
42+
// ConvertFrom converts from the Hub version (v1beta1) to this version.
43+
func (dst *AzureMachinePoolMachineList) ConvertFrom(srcRaw conversion.Hub) error { // nolint
44+
src := srcRaw.(*expv1beta1.AzureMachinePoolMachineList)
45+
return Convert_v1beta1_AzureMachinePoolMachineList_To_v1alpha4_AzureMachinePoolMachineList(src, dst, nil)
46+
}

exp/api/v1alpha4/azuremanagedcluster_conversion.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,23 @@ import (
2424
// ConvertTo converts this AzureManagedCluster to the Hub version (v1beta1).
2525
func (src *AzureManagedCluster) ConvertTo(dstRaw conversion.Hub) error { // nolint
2626
dst := dstRaw.(*expv1beta1.AzureManagedCluster)
27-
2827
return Convert_v1alpha4_AzureManagedCluster_To_v1beta1_AzureManagedCluster(src, dst, nil)
2928
}
3029

3130
// ConvertFrom converts from the Hub version (v1beta1) to this version.
3231
func (dst *AzureManagedCluster) ConvertFrom(srcRaw conversion.Hub) error { // nolint
3332
src := srcRaw.(*expv1beta1.AzureManagedCluster)
34-
3533
return Convert_v1beta1_AzureManagedCluster_To_v1alpha4_AzureManagedCluster(src, dst, nil)
3634
}
35+
36+
// ConvertTo converts this AzureManagedClusterList to the Hub version (v1beta1).
37+
func (src *AzureManagedClusterList) ConvertTo(dstRaw conversion.Hub) error { // nolint
38+
dst := dstRaw.(*expv1beta1.AzureManagedClusterList)
39+
return Convert_v1alpha4_AzureManagedClusterList_To_v1beta1_AzureManagedClusterList(src, dst, nil)
40+
}
41+
42+
// ConvertFrom converts from the Hub version (v1beta1) to this version.
43+
func (dst *AzureManagedClusterList) ConvertFrom(srcRaw conversion.Hub) error { // nolint
44+
src := srcRaw.(*expv1beta1.AzureManagedClusterList)
45+
return Convert_v1beta1_AzureManagedClusterList_To_v1alpha4_AzureManagedClusterList(src, dst, nil)
46+
}

0 commit comments

Comments
 (0)