Skip to content

Commit

Permalink
don't reconcile jobsets with deletion timestamp set
Browse files Browse the repository at this point in the history
  • Loading branch information
danielvegamyhre committed May 9, 2024
1 parent 3a2ae4d commit 88eff9c
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 88eff9c

Please sign in to comment.