Skip to content

Commit

Permalink
Fix EphemeralJob event handler for deleting object (#1401)
Browse files Browse the repository at this point in the history
Signed-off-by: FillZpp <FillZpp.pub@gmail.com>
  • Loading branch information
FillZpp authored Sep 6, 2023
1 parent a477df8 commit ebcee23
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/controller/ephemeraljob/ephemeraljob_event_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ func (e *ejobHandler) Update(evt event.UpdateEvent, q workqueue.RateLimitingInte
return
}

if curEJob.DeletionTimestamp != nil {
klog.V(3).Infof("Observed deleting ephemeral job: %s/%s", curEJob.Namespace, curEJob.Name)
q.Add(reconcile.Request{NamespacedName: types.NamespacedName{Namespace: curEJob.Namespace, Name: curEJob.Name}})
return
}

// only update these fields
if oldEJob.Spec.TTLSecondsAfterFinished != curEJob.Spec.TTLSecondsAfterFinished ||
oldEJob.Spec.Paused != curEJob.Spec.Paused || oldEJob.Spec.Parallelism != curEJob.Spec.Parallelism ||
Expand Down

0 comments on commit ebcee23

Please sign in to comment.