Skip to content

Commit

Permalink
Merge pull request #562 from danielvegamyhre/delcheck
Browse files Browse the repository at this point in the history
Don't reconcile JobSets with deletion timestamp set
  • Loading branch information
k8s-ci-robot authored May 9, 2024
2 parents 1d1c2f3 + 96b366b commit 7752a36
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 @@ -829,6 +834,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 7752a36

Please sign in to comment.