Skip to content

Commit 3acac53

Browse files
committed
Merge branch 'cherry_pick_524c43c203fc6deac157f51e8d949422c90a75d8' into 'release-1.11'
Cherry-pick: Only update ClusterPolicy status if changed to avoid unnecessary reconciliations See merge request nvidia/kubernetes/gpu-operator!513
2 parents ef33b30 + ad6a421 commit 3acac53

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: controllers/clusterpolicy_controller.go

+4
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ func updateCRState(r *ClusterPolicyReconciler, namespacedName types.NamespacedNa
198198
r.Log.Error(err, "Failed to get ClusterPolicy instance for status update")
199199
return err
200200
}
201+
if instance.Status.State == state {
202+
// state is unchanged
203+
return nil
204+
}
201205
// Update the CR state
202206
instance.SetStatus(state, clusterPolicyCtrl.operatorNamespace)
203207
err = r.Client.Status().Update(context.TODO(), instance)

0 commit comments

Comments
 (0)