@@ -178,7 +178,11 @@ func (r *OpenStackDataPlaneNodeSetReconciler) Reconcile(ctx context.Context, req
178178 // this reconcile loop.
179179 instance .InitConditions ()
180180 // Set ObservedGeneration since we've reset conditions
181- instance .Status .ObservedGeneration = instance .Generation
181+ var generationChanged bool
182+ if instance .Generation != instance .Status .ObservedGeneration {
183+ instance .Status .ObservedGeneration = instance .Generation
184+ generationChanged = true
185+ }
182186
183187 // Always patch the instance status when exiting this function so we can persist any changes.
184188 defer func () { // update the Ready condition based on the sub conditions
@@ -381,7 +385,7 @@ func (r *OpenStackDataPlaneNodeSetReconciler) Reconcile(ctx context.Context, req
381385 }
382386
383387 isDeploymentReady , isDeploymentRunning , isDeploymentFailed , failedDeployment , err := checkDeployment (
384- ctx , helper , instance )
388+ ctx , helper , instance , generationChanged )
385389 if ! isDeploymentFailed && err != nil {
386390 instance .Status .Conditions .MarkFalse (
387391 condition .DeploymentReadyCondition ,
@@ -460,6 +464,7 @@ func (r *OpenStackDataPlaneNodeSetReconciler) Reconcile(ctx context.Context, req
460464
461465func checkDeployment (ctx context.Context , helper * helper.Helper ,
462466 instance * dataplanev1.OpenStackDataPlaneNodeSet ,
467+ generationChanged bool ,
463468) (bool , bool , bool , string , error ) {
464469 // Get all completed deployments
465470 var failedDeployment string
@@ -514,7 +519,12 @@ func checkDeployment(ctx context.Context, helper *helper.Helper,
514519 } else if deploymentConditions .IsFalse (dataplanev1 .NodeSetDeploymentReadyCondition ) {
515520 isDeploymentRunning = true
516521 } else if deploymentConditions .IsTrue (dataplanev1 .NodeSetDeploymentReadyCondition ) {
517- if deployment .Status .NodeSetHashes [instance .Name ] != instance .Status .ConfigHash {
522+ // If the nodeset configHash does not match with what's in the deployment and the
523+ // generation metadata has changed i.e generation metatdata won't change when
524+ // fields are removed from the CRD during an update that would not require a new
525+ // deployment to run).
526+ if deployment .Status .NodeSetHashes [instance .Name ] != instance .Status .ConfigHash &&
527+ generationChanged {
518528 continue
519529 }
520530 isDeploymentReady = true
0 commit comments