Skip to content

Commit d804f63

Browse files
authored
Merge pull request #108 from leaseweb/feat/crd_migrator
fix: CRD migration use status for storage version migration
2 parents 3514753 + 6c2a913 commit d804f63

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

config/rbac/role.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ rules:
8989
- infrastructure.cluster.x-k8s.io
9090
resources:
9191
- cloudstackaffinitygroups/status
92-
- cloudstackclustertemplates/status
9392
- cloudstackisolatednetworks/status
9493
- cloudstackmachines/status
9594
- cloudstackmachinestatecheckers/status

main.go

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func initFlags(fs *pflag.FlagSet) {
201201
// +kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions,verbs=get;list;watch;update;patch
202202
// +kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions/status,verbs=get;list;watch;update;patch
203203
// +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=cloudstackclusters;cloudstackmachines;cloudstackmachinetemplates;cloudstackclustertemplates;cloudstackfailuredomains;cloudstackisolatednetworks;cloudstackaffinitygroups;cloudstackmachinestatecheckers,verbs=get;list;watch;patch;update
204-
// +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=cloudstackclusters/status;cloudstackmachines/status;cloudstackmachinetemplates/status;cloudstackclustertemplates/status;cloudstackfailuredomains/status;cloudstackisolatednetworks/status;cloudstackaffinitygroups/status;cloudstackmachinestatecheckers/status,verbs=get;patch;update
204+
// +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=cloudstackclusters/status;cloudstackmachines/status;cloudstackmachinetemplates/status;cloudstackfailuredomains/status;cloudstackisolatednetworks/status;cloudstackaffinitygroups/status;cloudstackmachinestatecheckers/status,verbs=get;patch;update
205205

206206
func main() {
207207
initFlags(pflag.CommandLine)
@@ -323,28 +323,36 @@ func setupReconcilers(ctx context.Context, mgr manager.Manager) {
323323

324324
crdMigratorConfig := map[client.Object]crdmigrator.ByObjectConfig{
325325
&infrav1.CloudStackCluster{}: {
326-
UseCache: true,
326+
UseCache: true,
327+
UseStatusForStorageVersionMigration: true,
327328
},
328329
&infrav1.CloudStackMachine{}: {
329-
UseCache: true,
330+
UseCache: true,
331+
UseStatusForStorageVersionMigration: true,
330332
},
331333
&infrav1.CloudStackMachineTemplate{}: {
332-
UseCache: true,
334+
UseCache: true,
335+
UseStatusForStorageVersionMigration: true,
333336
},
334337
&infrav1.CloudStackClusterTemplate{}: {
335-
UseCache: true,
338+
UseCache: true,
339+
UseStatusForStorageVersionMigration: false,
336340
},
337341
&infrav1.CloudStackFailureDomain{}: {
338-
UseCache: true,
342+
UseCache: true,
343+
UseStatusForStorageVersionMigration: true,
339344
},
340345
&infrav1.CloudStackIsolatedNetwork{}: {
341-
UseCache: true,
346+
UseCache: true,
347+
UseStatusForStorageVersionMigration: true,
342348
},
343349
&infrav1.CloudStackAffinityGroup{}: {
344-
UseCache: true,
350+
UseCache: true,
351+
UseStatusForStorageVersionMigration: true,
345352
},
346353
&infrav1.CloudStackMachineStateChecker{}: {
347-
UseCache: true,
354+
UseCache: true,
355+
UseStatusForStorageVersionMigration: true,
348356
},
349357
}
350358
crdMigratorSkipPhases := []crdmigrator.Phase{}

0 commit comments

Comments
 (0)