Skip to content

Commit eb63279

Browse files
committed
Don't reconcile a failed deployment
Don't reconcile a failed deployment after the required number of retries if there are changes in the nodeset or watched resources.
1 parent 61d1832 commit eb63279

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

controllers/dataplane/openstackdataplanedeployment_controller.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,19 @@ func (r *OpenStackDataPlaneDeploymentReconciler) Reconcile(ctx context.Context,
109109
return ctrl.Result{}, nil
110110
}
111111

112+
// If the deployment has failed with backoff limit exceeded, do not reconcile
113+
// even if nodesets or other watched resources change. The deployment is in a
114+
// terminal failure state and should not be retried.
115+
if instance.Status.Conditions != nil {
116+
deploymentCondition := instance.Status.Conditions.Get(condition.DeploymentReadyCondition)
117+
if deploymentCondition != nil &&
118+
deploymentCondition.Reason == condition.JobReasonBackoffLimitExceeded {
119+
Log.Info("Deployment has failed with backoff limit exceeded, skipping reconciliation",
120+
"deployment", instance.Name)
121+
return ctrl.Result{}, nil
122+
}
123+
}
124+
112125
// initialize status if Conditions is nil, but do not reset if it already
113126
// exists
114127
isNewInstance := instance.Status.Conditions == nil

0 commit comments

Comments
 (0)