Skip to content

Commit

Permalink
Merge pull request #39 from adrianchiris/fix-race-cond-scheduler-cont…
Browse files Browse the repository at this point in the history
…roller

fix minor race issue when waiting for condition
  • Loading branch information
adrianchiris authored Oct 28, 2024
2 parents da5fe7f + ca8f23a commit f57a4de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/controller/nodemaintenancescheduler_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ func (r *NodeMaintenanceSchedulerReconciler) Reconcile(ctx context.Context, req
r.Log.Error(innerErr, "failed to get NodeMaintenance object while waiting for condition update. retrying", "name", nm.Name, "namespace", nm.Namespace)
return false, nil
}
if k8sutils.GetReadyConditionReason(updatedNm) == maintenancev1.ConditionReasonScheduled {
if k8sutils.IsUnderMaintenance(updatedNm) {
// nodemaintenance transitioned from pending to one of the under maintenance states.
return true, nil
}
return false, nil
Expand Down

0 comments on commit f57a4de

Please sign in to comment.