-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Job also from .status.active for Replace strategy #35420
Conversation
@@ -242,11 +243,13 @@ func SyncOne(sj batch.ScheduledJob, js []batch.Job, now time.Time, jc jobControl | |||
recorder.Eventf(&sj, api.EventTypeWarning, "FailedDelete", "Deleted job-pods: %v", utilerrors.NewAggregate(errList)) | |||
return | |||
} | |||
// ... and the job itself | |||
// ... the job itself... | |||
if err := jc.DeleteJob(job.Namespace, job.Name); err != nil { | |||
recorder.Eventf(&sj, api.EventTypeWarning, "FailedDelete", "Deleted job: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we glog.Errorf
this failure?
expectedEvents += 1 | ||
expectedEvents++ | ||
expectUpdates++ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant newline
6ae20d1
to
dc364b8
Compare
Comments addressed, ptal. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue |
cherry-picked in #36510 |
Commit found in the "release-1.4" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked. |
…ck-of-#34375-kubernetes#35285-kubernetes#35420-kubernetes#35608-kubernetes#35919-kubernetes#36161-origin-release-1.4 Automated cherry pick of kubernetes#34375 kubernetes#35285 kubernetes#35420 kubernetes#35608 kubernetes#35919 kubernetes#36161
When iterating over list of Jobs we're removing each of them when strategy is replace. Unfortunately, the job reference was not removed from
.status.active
which cause the controller trying to remove it once again during next run and failed removing what was already removed during previous run. This was cause by not removing the reference previously. This PR fixes that and cleans logs a bit, in that controller.@erictune fyi
@janetkuo ptal
This change is