Skip to content

Commit 2e200c1

Browse files
authored
Merge pull request #1095 from srm09/remove-deprecated-items
Removes fields marked as deprecated
2 parents 267f4e0 + e3a9315 commit 2e200c1

Some content is hidden

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

49 files changed

+372
-5620
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ manifests: $(STAGE)-version-check $(STAGE)-flavors $(MANIFEST_DIR) $(BUILD_DIR)
279279

280280
.PHONY: flavors
281281
flavors: $(FLAVOR_DIR)
282-
go run ./packaging/flavorgen -f multi-host > $(FLAVOR_DIR)/cluster-template-haproxy.yaml
283282
go run ./packaging/flavorgen -f vip > $(FLAVOR_DIR)/cluster-template.yaml
284283
go run ./packaging/flavorgen -f external-loadbalancer > $(FLAVOR_DIR)/cluster-template-external-loadbalancer.yaml
285284

api/v1alpha3/conversion_test.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ import (
2121

2222
. "github.com/onsi/gomega"
2323

24+
fuzz "github.com/google/gofuzz"
25+
"k8s.io/apimachinery/pkg/api/apitesting/fuzzer"
2426
"k8s.io/apimachinery/pkg/runtime"
27+
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
2528
utilconversion "sigs.k8s.io/cluster-api/util/conversion"
2629

2730
nextver "sigs.k8s.io/cluster-api-provider-vsphere/api/v1alpha4"
@@ -34,9 +37,10 @@ func TestFuzzyConversion(t *testing.T) {
3437
g.Expect(nextver.AddToScheme(scheme)).To(Succeed())
3538

3639
t.Run("for VSphereCluster", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{
37-
Scheme: scheme,
38-
Hub: &nextver.VSphereCluster{},
39-
Spoke: &VSphereCluster{},
40+
Scheme: scheme,
41+
Hub: &nextver.VSphereCluster{},
42+
Spoke: &VSphereCluster{},
43+
FuzzerFuncs: []fuzzer.FuzzerFuncs{overrideDeprecatedFieldsFuncs},
4044
}))
4145
t.Run("for VSphereMachine", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{
4246
Scheme: scheme,
@@ -54,3 +58,11 @@ func TestFuzzyConversion(t *testing.T) {
5458
Spoke: &VSphereVM{},
5559
}))
5660
}
61+
62+
func overrideDeprecatedFieldsFuncs(codecs runtimeserializer.CodecFactory) []interface{} {
63+
return []interface{}{
64+
func(vsphereClusterSpec *VSphereClusterSpec, c fuzz.Continue) {
65+
vsphereClusterSpec.CloudProviderConfiguration = CPIConfig{}
66+
},
67+
}
68+
}

api/v1alpha3/haproxyloadbalancer_conversion.go

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,8 @@ limitations under the License.
1616

1717
package v1alpha3
1818

19-
import (
20-
infrav1alpha4 "sigs.k8s.io/cluster-api-provider-vsphere/api/v1alpha4"
21-
"sigs.k8s.io/controller-runtime/pkg/conversion"
22-
)
19+
// Hub marks HAProxyLoadBalancer as a conversion hub.
20+
func (*HAProxyLoadBalancer) Hub() {}
2321

24-
// ConvertTo converts this HAProxyLoadBalancer to the Hub version (v1alpha4).
25-
func (src *HAProxyLoadBalancer) ConvertTo(dstRaw conversion.Hub) error { // nolint
26-
dst := dstRaw.(*infrav1alpha4.HAProxyLoadBalancer)
27-
return Convert_v1alpha3_HAProxyLoadBalancer_To_v1alpha4_HAProxyLoadBalancer(src, dst, nil)
28-
}
29-
30-
// ConvertFrom converts from the Hub version (v1alpha4) to this HAProxyLoadBalancer.
31-
func (dst *HAProxyLoadBalancer) ConvertFrom(srcRaw conversion.Hub) error { // nolint
32-
src := srcRaw.(*infrav1alpha4.HAProxyLoadBalancer)
33-
return Convert_v1alpha4_HAProxyLoadBalancer_To_v1alpha3_HAProxyLoadBalancer(src, dst, nil)
34-
}
35-
36-
// ConvertTo converts this HAProxyLoadBalancerList to the Hub version (v1alpha4).
37-
func (src *HAProxyLoadBalancerList) ConvertTo(dstRaw conversion.Hub) error { // nolint
38-
dst := dstRaw.(*infrav1alpha4.HAProxyLoadBalancerList)
39-
return Convert_v1alpha3_HAProxyLoadBalancerList_To_v1alpha4_HAProxyLoadBalancerList(src, dst, nil)
40-
}
41-
42-
// ConvertFrom converts this VSphereVM to the Hub version (v1alpha4).
43-
func (dst *HAProxyLoadBalancerList) ConvertFrom(srcRaw conversion.Hub) error { // nolint
44-
src := srcRaw.(*infrav1alpha4.HAProxyLoadBalancerList)
45-
return Convert_v1alpha4_HAProxyLoadBalancerList_To_v1alpha3_HAProxyLoadBalancerList(src, dst, nil)
46-
}
22+
// Hub marks HAProxyLoadBalancerList as a conversion hub.
23+
func (*HAProxyLoadBalancerList) Hub() {}

api/v1alpha3/vspherecluster_conversion.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,7 @@ func (dst *VSphereClusterList) ConvertFrom(srcRaw conversion.Hub) error { // nol
7070
func Convert_v1alpha4_VSphereClusterSpec_To_v1alpha3_VSphereClusterSpec(in *infrav1alpha4.VSphereClusterSpec, out *VSphereClusterSpec, s apiconversion.Scope) error { // nolint
7171
return autoConvert_v1alpha4_VSphereClusterSpec_To_v1alpha3_VSphereClusterSpec(in, out, s)
7272
}
73+
74+
func Convert_v1alpha3_VSphereClusterSpec_To_v1alpha4_VSphereClusterSpec(in *VSphereClusterSpec, out *infrav1alpha4.VSphereClusterSpec, s apiconversion.Scope) error { //nolint
75+
return autoConvert_v1alpha3_VSphereClusterSpec_To_v1alpha4_VSphereClusterSpec(in, out, s)
76+
}

api/v1alpha3/zz_generated.conversion.go

Lines changed: 8 additions & 592 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)