Skip to content

Commit

Permalink
Merge pull request #564 from danielvegamyhre/automated-cherry-pick-of…
Browse files Browse the repository at this point in the history
…-#562-upstream-release-0.5

Automated cherry pick of #562: don't reconcile jobsets with deletion timestamp set
  • Loading branch information
k8s-ci-robot authored May 9, 2024
2 parents 3a2ae4d + 88eff9c commit 43f8137
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/controllers/jobset_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ func (r *JobSetReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
return ctrl.Result{}, client.IgnoreNotFound(err)
}

// Don't reconcile JobSets marked for deletion.
if jobSetMarkedForDeletion(&js) {
return ctrl.Result{}, nil
}

// Track JobSet status updates that should be performed at the end of the reconciliation attempt.
updateStatusOpts := statusUpdateOpts{}

Expand Down Expand Up @@ -816,6 +821,10 @@ func jobSetFinished(js *jobset.JobSet) bool {
return false
}

func jobSetMarkedForDeletion(js *jobset.JobSet) bool {
return js.DeletionTimestamp != nil
}

func dnsHostnamesEnabled(js *jobset.JobSet) bool {
return js.Spec.Network.EnableDNSHostnames != nil && *js.Spec.Network.EnableDNSHostnames
}
Expand Down

0 comments on commit 43f8137

Please sign in to comment.