Skip to content

Commit

Permalink
bugfix: stop doing ttl when endtime is nil (#300)
Browse files Browse the repository at this point in the history
stop doing ttl when endtime is nil
  • Loading branch information
ColdsteelRail authored Nov 7, 2024
1 parent b4cce9e commit 9a7b43e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controllers/operationjob/operationjob_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func (r *ReconcileOperationJob) ensureActiveDeadlineAndTTL(ctx context.Context,
}

if operationJob.Spec.TTLSecondsAfterFinished != nil {
if ojutils.IsJobFinished(operationJob) {
if ojutils.IsJobFinished(operationJob) && operationJob.Status.EndTime != nil {
leftTime := time.Duration(*operationJob.Spec.TTLSecondsAfterFinished)*time.Second - time.Since(operationJob.Status.EndTime.Time)
if leftTime > 0 {
return false, &leftTime, nil
Expand Down

0 comments on commit 9a7b43e

Please sign in to comment.