mirror of https://github.com/k3s-io/k3s
Merge pull request #64028 from soltysh/job_scaler
Automatic merge from submit-queue (batch tested with PRs 63770, 63776, 64001, 64028, 63984). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
Tolarate negative values when calculating job scale progress
**What this PR does / why we need it**:
It might happen that the job controller will complete a job, but the status will still contain information about active pods which during scale down operation will be giving false (non 0) value in [this calculation](1b950d1e8e/pkg/kubectl/cmd/scalejob/scalejob.go (L147)
). To prevent that situation we should tolerate non-zero values there.
/assign @liggitt
**Release note**:
```release-note
NONE
```
pull/8/head
commit
25c36876a2
|
@ -144,7 +144,7 @@ func jobHasDesiredParallelism(jobClient batchclient.JobsGetter, job *batch.Job)
|
|||
|
||||
// otherwise count successful
|
||||
progress := *job.Spec.Completions - job.Status.Active - job.Status.Succeeded
|
||||
return progress == 0, nil
|
||||
return progress <= 0, nil
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue