Skip to content

Commit 43f8137

Browse files
authored
Merge pull request #564 from danielvegamyhre/automated-cherry-pick-of-#562-upstream-release-0.5
Automated cherry pick of #562: don't reconcile jobsets with deletion timestamp set
2 parents 3a2ae4d + 88eff9c commit 43f8137

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/controllers/jobset_controller.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ func (r *JobSetReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
103103
return ctrl.Result{}, client.IgnoreNotFound(err)
104104
}
105105

106+
// Don't reconcile JobSets marked for deletion.
107+
if jobSetMarkedForDeletion(&js) {
108+
return ctrl.Result{}, nil
109+
}
110+
106111
// Track JobSet status updates that should be performed at the end of the reconciliation attempt.
107112
updateStatusOpts := statusUpdateOpts{}
108113

@@ -816,6 +821,10 @@ func jobSetFinished(js *jobset.JobSet) bool {
816821
return false
817822
}
818823

824+
func jobSetMarkedForDeletion(js *jobset.JobSet) bool {
825+
return js.DeletionTimestamp != nil
826+
}
827+
819828
func dnsHostnamesEnabled(js *jobset.JobSet) bool {
820829
return js.Spec.Network.EnableDNSHostnames != nil && *js.Spec.Network.EnableDNSHostnames
821830
}

0 commit comments

Comments
 (0)