Skip to content

Commit 82542dc

Browse files
authored
Merge pull request #3367 from sbueringer/pr-crd-migration
✨ Implement CRD migration & bump CAPI to c9261b079e0b
2 parents 7a6df8a + 3a86f18 commit 82542dc

File tree

14 files changed

+190
-45
lines changed

14 files changed

+190
-45
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ IMPORT_BOSS_VER := v0.28.1
190190
IMPORT_BOSS := $(abspath $(TOOLS_BIN_DIR)/$(IMPORT_BOSS_BIN))
191191
IMPORT_BOSS_PKG := k8s.io/code-generator/cmd/import-boss
192192

193-
CAPI_HACK_TOOLS_VER := 065f159469f356c029c7fdef92cce1d2e4b0ebc6 # Note: this a commit ID of from CAPI main, supposed to be in v1.10
193+
CAPI_HACK_TOOLS_VER := c9261b079e0bb619a1b23c5a034c660e5660deb7 # Note: this a commit ID of from CAPI main, supposed to be in v1.10
194194

195195
BOSKOSCTL_BIN := boskosctl
196196
BOSKOSCTL := $(abspath $(TOOLS_BIN_DIR)/$(BOSKOSCTL_BIN))

config/rbac/role.yaml

+44
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,45 @@ rules:
5555
- services/status
5656
verbs:
5757
- get
58+
- apiGroups:
59+
- apiextensions.k8s.io
60+
resources:
61+
- customresourcedefinitions
62+
verbs:
63+
- get
64+
- list
65+
- watch
66+
- apiGroups:
67+
- apiextensions.k8s.io
68+
resourceNames:
69+
- providerserviceaccounts.vmware.infrastructure.cluster.x-k8s.io
70+
- vsphereclusters.vmware.infrastructure.cluster.x-k8s.io
71+
- vsphereclustertemplates.vmware.infrastructure.cluster.x-k8s.io
72+
- vspheremachines.vmware.infrastructure.cluster.x-k8s.io
73+
- vspheremachinetemplates.vmware.infrastructure.cluster.x-k8s.io
74+
resources:
75+
- customresourcedefinitions
76+
- customresourcedefinitions/status
77+
verbs:
78+
- patch
79+
- update
80+
- apiGroups:
81+
- apiextensions.k8s.io
82+
resourceNames:
83+
- vsphereclusteridentities.infrastructure.cluster.x-k8s.io
84+
- vsphereclusters.infrastructure.cluster.x-k8s.io
85+
- vsphereclustertemplates.infrastructure.cluster.x-k8s.io
86+
- vspheredeploymentzones.infrastructure.cluster.x-k8s.io
87+
- vspherefailuredomains.infrastructure.cluster.x-k8s.io
88+
- vspheremachines.infrastructure.cluster.x-k8s.io
89+
- vspheremachinetemplates.infrastructure.cluster.x-k8s.io
90+
- vspherevms.infrastructure.cluster.x-k8s.io
91+
resources:
92+
- customresourcedefinitions
93+
- customresourcedefinitions/status
94+
verbs:
95+
- patch
96+
- update
5897
- apiGroups:
5998
- authentication.k8s.io
6099
resources:
@@ -141,10 +180,13 @@ rules:
141180
- apiGroups:
142181
- infrastructure.cluster.x-k8s.io
143182
resources:
183+
- vsphereclustertemplates
144184
- vspheremachinetemplates
145185
verbs:
146186
- get
147187
- list
188+
- patch
189+
- update
148190
- watch
149191
- apiGroups:
150192
- ipam.cluster.x-k8s.io
@@ -242,6 +284,8 @@ rules:
242284
verbs:
243285
- get
244286
- list
287+
- patch
288+
- update
245289
- watch
246290
- apiGroups:
247291
- vmware.infrastructure.cluster.x-k8s.io

controllers/vmware/serviceaccount_controller.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ import (
5252
"sigs.k8s.io/cluster-api-provider-vsphere/pkg/util"
5353
)
5454

55-
// +kubebuilder:rbac:groups=vmware.infrastructure.cluster.x-k8s.io,resources=providerserviceaccounts,verbs=get;list;watch;
55+
// +kubebuilder:rbac:groups=vmware.infrastructure.cluster.x-k8s.io,resources=providerserviceaccounts,verbs=get;list;watch;patch;update
5656
// +kubebuilder:rbac:groups=vmware.infrastructure.cluster.x-k8s.io,resources=providerserviceaccounts/status,verbs=get;update;patch
5757
// +kubebuilder:rbac:groups="",resources=serviceaccounts,verbs=get;list;watch;create;update;patch;delete
5858
// +kubebuilder:rbac:groups="",resources=secrets,verbs=get

go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module sigs.k8s.io/cluster-api-provider-vsphere
22

33
go 1.23.0
44

5-
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.9.0-rc.0.0.20250214165422-065f159469f3
5+
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.9.0-rc.0.0.20250303134942-c9261b079e0b
66

77
replace github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels => github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels v0.0.0-20240404200847-de75746a9505
88

@@ -75,7 +75,7 @@ require (
7575
go.uber.org/multierr v1.11.0 // indirect
7676
go.uber.org/zap v1.27.0 // indirect
7777
golang.org/x/net v0.35.0 // indirect
78-
golang.org/x/oauth2 v0.26.0 // indirect
78+
golang.org/x/oauth2 v0.27.0 // indirect
7979
golang.org/x/sync v0.11.0 // indirect
8080
golang.org/x/sys v0.30.0 // indirect
8181
golang.org/x/term v0.29.0 // indirect
@@ -103,7 +103,7 @@ require (
103103
github.com/gogo/protobuf v1.3.2 // indirect
104104
github.com/golang/protobuf v1.5.4 // indirect
105105
github.com/google/cel-go v0.22.0 // indirect
106-
github.com/google/go-cmp v0.6.0 // indirect
106+
github.com/google/go-cmp v0.7.0 // indirect
107107
github.com/inconshreveable/mousetrap v1.1.0 // indirect
108108
github.com/josharian/intern v1.0.0 // indirect
109109
github.com/json-iterator/go v1.1.12 // indirect

go.sum

+6-6
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvR
112112
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
113113
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
114114
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
115-
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
116-
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
115+
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
116+
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
117117
github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
118118
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
119119
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
@@ -315,8 +315,8 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL
315315
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
316316
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
317317
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
318-
golang.org/x/oauth2 v0.26.0 h1:afQXWNNaeC4nvZ0Ed9XvCCzXM6UHJG7iCg0W4fPqSBE=
319-
golang.org/x/oauth2 v0.26.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
318+
golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M=
319+
golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
320320
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
321321
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
322322
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -417,8 +417,8 @@ k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6J
417417
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
418418
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 h1:CPT0ExVicCzcpeN4baWEV2ko2Z/AsiZgEdwgcfwLgMo=
419419
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
420-
sigs.k8s.io/cluster-api v1.9.0-rc.0.0.20250214165422-065f159469f3 h1:oZh7dhqQxRnFLl4ayS8WsRAfpTNCfDWY6d9sbfe/dL0=
421-
sigs.k8s.io/cluster-api v1.9.0-rc.0.0.20250214165422-065f159469f3/go.mod h1:9UtSb2Ni0j/H5tHZxXGr3/mHPkkIPc95OkShJ2iwmnw=
420+
sigs.k8s.io/cluster-api v1.9.0-rc.0.0.20250303134942-c9261b079e0b h1:+rhO9yCAZLulzGOr9x3ij5XfqQj+sllwsoHptvrmwZU=
421+
sigs.k8s.io/cluster-api v1.9.0-rc.0.0.20250303134942-c9261b079e0b/go.mod h1:a7W/Y3PsWAoiCnL+P4+ClErZA/TIfSCHw7RNV60Dob8=
422422
sigs.k8s.io/controller-runtime v0.20.2 h1:/439OZVxoEc02psi1h4QO3bHzTgu49bb347Xp4gW1pc=
423423
sigs.k8s.io/controller-runtime v0.20.2/go.mod h1:xg2XB0K5ShQzAgsoujxuKN4LNXR2LfwwHsPj7Iaw+XY=
424424
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8=

main.go

+50
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import (
4242
"k8s.io/utils/ptr"
4343
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
4444
"sigs.k8s.io/cluster-api/controllers/clustercache"
45+
"sigs.k8s.io/cluster-api/controllers/crdmigrator"
4546
"sigs.k8s.io/cluster-api/controllers/remote"
4647
"sigs.k8s.io/cluster-api/util/apiwarnings"
4748
capiflags "sigs.k8s.io/cluster-api/util/flags"
@@ -93,6 +94,7 @@ var (
9394
vSphereVMConcurrency int
9495
vSphereClusterIdentityConcurrency int
9596
vSphereDeploymentZoneConcurrency int
97+
skipCRDMigrationPhases []string
9698

9799
managerOptions = capiflags.ManagerOptions{}
98100

@@ -187,6 +189,9 @@ func InitFlags(fs *pflag.FlagSet) {
187189
fs.BoolVar(&enableContentionProfiling, "contention-profiling", false,
188190
"Enable block profiling.")
189191

192+
fs.StringArrayVar(&skipCRDMigrationPhases, "skip-crd-migration-phases", []string{},
193+
"List of CRD migration phases to skip. Valid values are: StorageVersionMigration, CleanupManagedFields.")
194+
190195
fs.DurationVar(&syncPeriod, "sync-period", defaultSyncPeriod,
191196
"The minimum interval at which watched resources are reconciled (e.g. 15m)")
192197

@@ -225,6 +230,14 @@ func InitFlags(fs *pflag.FlagSet) {
225230
// Add RBAC for the authorized diagnostics endpoint.
226231
// +kubebuilder:rbac:groups=authentication.k8s.io,resources=tokenreviews,verbs=create
227232
// +kubebuilder:rbac:groups=authorization.k8s.io,resources=subjectaccessreviews,verbs=create
233+
// ADD CRD RBAC for CRD Migrator.
234+
// +kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions,verbs=get;list;watch
235+
// govmomi
236+
// +kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions;customresourcedefinitions/status,verbs=update;patch,resourceNames=vsphereclusters.infrastructure.cluster.x-k8s.io;vsphereclustertemplates.infrastructure.cluster.x-k8s.io;vspheremachines.infrastructure.cluster.x-k8s.io;vspheremachinetemplates.infrastructure.cluster.x-k8s.io;vspherevms.infrastructure.cluster.x-k8s.io;vsphereclusteridentities.infrastructure.cluster.x-k8s.io;vspheredeploymentzones.infrastructure.cluster.x-k8s.io;vspherefailuredomains.infrastructure.cluster.x-k8s.io
237+
// supervisor
238+
// +kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions;customresourcedefinitions/status,verbs=update;patch,resourceNames=vsphereclusters.vmware.infrastructure.cluster.x-k8s.io;vsphereclustertemplates.vmware.infrastructure.cluster.x-k8s.io;vspheremachines.vmware.infrastructure.cluster.x-k8s.io;vspheremachinetemplates.vmware.infrastructure.cluster.x-k8s.io;providerserviceaccounts.vmware.infrastructure.cluster.x-k8s.io
239+
// govmomi CRs
240+
// +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=vspheremachinetemplates;vsphereclustertemplates,verbs=get;list;watch;patch;update
228241

229242
func main() {
230243
InitFlags(pflag.CommandLine)
@@ -317,6 +330,43 @@ func main() {
317330
setupLog.Info(fmt.Sprintf("CRD for %s not loaded, skipping.", supervisorGVR.String()))
318331
}
319332

333+
// Note: The kubebuilder RBAC markers above has to be kept in sync
334+
// with the CRDs that should be migrated by this provider.
335+
crdMigratorConfig := map[client.Object]crdmigrator.ByObjectConfig{}
336+
if isGovmomiCRDLoaded {
337+
crdMigratorConfig[&infrav1.VSphereCluster{}] = crdmigrator.ByObjectConfig{UseCache: true}
338+
crdMigratorConfig[&infrav1.VSphereClusterTemplate{}] = crdmigrator.ByObjectConfig{UseCache: false}
339+
crdMigratorConfig[&infrav1.VSphereMachine{}] = crdmigrator.ByObjectConfig{UseCache: true}
340+
crdMigratorConfig[&infrav1.VSphereMachineTemplate{}] = crdmigrator.ByObjectConfig{UseCache: true}
341+
crdMigratorConfig[&infrav1.VSphereVM{}] = crdmigrator.ByObjectConfig{UseCache: true}
342+
crdMigratorConfig[&infrav1.VSphereClusterIdentity{}] = crdmigrator.ByObjectConfig{UseCache: true}
343+
crdMigratorConfig[&infrav1.VSphereDeploymentZone{}] = crdmigrator.ByObjectConfig{UseCache: true}
344+
crdMigratorConfig[&infrav1.VSphereFailureDomain{}] = crdmigrator.ByObjectConfig{UseCache: true}
345+
}
346+
if isSupervisorCRDLoaded {
347+
crdMigratorConfig[&vmwarev1.VSphereCluster{}] = crdmigrator.ByObjectConfig{UseCache: true}
348+
crdMigratorConfig[&vmwarev1.VSphereClusterTemplate{}] = crdmigrator.ByObjectConfig{UseCache: false}
349+
crdMigratorConfig[&vmwarev1.VSphereMachine{}] = crdmigrator.ByObjectConfig{UseCache: true}
350+
crdMigratorConfig[&vmwarev1.VSphereMachineTemplate{}] = crdmigrator.ByObjectConfig{UseCache: true}
351+
crdMigratorConfig[&vmwarev1.ProviderServiceAccount{}] = crdmigrator.ByObjectConfig{UseCache: true}
352+
}
353+
354+
crdMigratorSkipPhases := []crdmigrator.Phase{}
355+
for _, p := range skipCRDMigrationPhases {
356+
crdMigratorSkipPhases = append(crdMigratorSkipPhases, crdmigrator.Phase(p))
357+
}
358+
if err := (&crdmigrator.CRDMigrator{
359+
Client: mgr.GetClient(),
360+
APIReader: mgr.GetAPIReader(),
361+
SkipCRDMigrationPhases: crdMigratorSkipPhases,
362+
Config: crdMigratorConfig,
363+
// The CRDMigrator is run with only concurrency 1 to ensure we don't overwhelm the apiserver by patching a
364+
// lot of CRs concurrently.
365+
}).SetupWithManager(ctx, mgr, concurrency(1)); err != nil {
366+
setupLog.Error(err, "Unable to create controller", "controller", "CRDMigrator")
367+
os.Exit(1)
368+
}
369+
320370
return nil
321371
}
322372

packaging/go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module sigs.k8s.io/cluster-api-provider-vsphere/packaging
22

33
go 1.23.0
44

5-
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.9.0-rc.0.0.20250214165422-065f159469f3
5+
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.9.0-rc.0.0.20250303134942-c9261b079e0b
66

77
replace sigs.k8s.io/cluster-api-provider-vsphere => ../
88

@@ -42,7 +42,7 @@ require (
4242
github.com/golang/protobuf v1.5.4 // indirect
4343
github.com/google/btree v1.1.3 // indirect
4444
github.com/google/gnostic-models v0.6.8 // indirect
45-
github.com/google/go-cmp v0.6.0 // indirect
45+
github.com/google/go-cmp v0.7.0 // indirect
4646
github.com/google/gofuzz v1.2.0 // indirect
4747
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
4848
github.com/google/uuid v1.6.0 // indirect
@@ -64,7 +64,7 @@ require (
6464
go.opentelemetry.io/otel v1.28.0 // indirect
6565
go.opentelemetry.io/otel/trace v1.28.0 // indirect
6666
golang.org/x/net v0.35.0 // indirect
67-
golang.org/x/oauth2 v0.26.0 // indirect
67+
golang.org/x/oauth2 v0.27.0 // indirect
6868
golang.org/x/sync v0.11.0 // indirect
6969
golang.org/x/sys v0.30.0 // indirect
7070
golang.org/x/term v0.29.0 // indirect

packaging/go.sum

+6-6
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl76
5151
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
5252
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
5353
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
54-
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
55-
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
54+
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
55+
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
5656
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
5757
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
5858
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
@@ -163,8 +163,8 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL
163163
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
164164
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
165165
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
166-
golang.org/x/oauth2 v0.26.0 h1:afQXWNNaeC4nvZ0Ed9XvCCzXM6UHJG7iCg0W4fPqSBE=
167-
golang.org/x/oauth2 v0.26.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
166+
golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M=
167+
golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
168168
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
169169
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
170170
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -231,8 +231,8 @@ k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJ
231231
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4=
232232
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro=
233233
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
234-
sigs.k8s.io/cluster-api v1.9.0-rc.0.0.20250214165422-065f159469f3 h1:oZh7dhqQxRnFLl4ayS8WsRAfpTNCfDWY6d9sbfe/dL0=
235-
sigs.k8s.io/cluster-api v1.9.0-rc.0.0.20250214165422-065f159469f3/go.mod h1:9UtSb2Ni0j/H5tHZxXGr3/mHPkkIPc95OkShJ2iwmnw=
234+
sigs.k8s.io/cluster-api v1.9.0-rc.0.0.20250303134942-c9261b079e0b h1:+rhO9yCAZLulzGOr9x3ij5XfqQj+sllwsoHptvrmwZU=
235+
sigs.k8s.io/cluster-api v1.9.0-rc.0.0.20250303134942-c9261b079e0b/go.mod h1:a7W/Y3PsWAoiCnL+P4+ClErZA/TIfSCHw7RNV60Dob8=
236236
sigs.k8s.io/controller-runtime v0.20.2 h1:/439OZVxoEc02psi1h4QO3bHzTgu49bb347Xp4gW1pc=
237237
sigs.k8s.io/controller-runtime v0.20.2/go.mod h1:xg2XB0K5ShQzAgsoujxuKN4LNXR2LfwwHsPj7Iaw+XY=
238238
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8=

pkg/manager/manager.go

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
vmoprv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha2"
2727
ncpv1 "github.com/vmware-tanzu/vm-operator/external/ncp/api/v1alpha1"
2828
"gopkg.in/fsnotify.v1"
29+
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
2930
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
3031
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
3132
bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1"
@@ -54,6 +55,7 @@ func New(ctx context.Context, opts Options) (Manager, error) {
5455
// Ensure the default options are set.
5556
opts.defaults()
5657

58+
_ = apiextensionsv1.AddToScheme(opts.Scheme)
5759
_ = clientgoscheme.AddToScheme(opts.Scheme)
5860
_ = clusterv1.AddToScheme(opts.Scheme)
5961
_ = infrav1alpha3.AddToScheme(opts.Scheme)

0 commit comments

Comments
 (0)