Skip to content
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

Merged
merged 1 commit into from
Oct 30, 2016

Conversation

soltysh
Copy link
Contributor

@soltysh soltysh commented Oct 24, 2016

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

Remove Job also from .status.active for Replace strategy

This change is Reviewable

@soltysh soltysh added 0 - Backlog release-note-none Denotes a PR that doesn't merit a release note. labels Oct 24, 2016
@k8s-github-robot k8s-github-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 24, 2016
@@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we glog.Errorfthis failure?

expectedEvents += 1
expectedEvents++
expectUpdates++

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant newline

@soltysh
Copy link
Contributor Author

soltysh commented Oct 25, 2016

Comments addressed, ptal.

@janetkuo janetkuo added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 27, 2016
@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 7d91141 into kubernetes:master Oct 30, 2016
@soltysh soltysh deleted the sj_replace_fix branch October 31, 2016 09:15
@soltysh soltysh added this to the v1.4 milestone Nov 2, 2016
@soltysh
Copy link
Contributor Author

soltysh commented Nov 2, 2016

I have a user (#34447) complaining about problem with Replace in 1.4, this issue is fixing. I guess it's worth cherry-picking in that case @jessfraz

@jessfraz
Copy link
Contributor

jessfraz commented Nov 9, 2016

cherry-picked in #36510

@jessfraz jessfraz added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Nov 9, 2016
jessfraz added a commit that referenced this pull request Nov 9, 2016
@k8s-cherrypick-bot
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/batch cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants