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

Fix Namespace Termination #6246

Merged
merged 1 commit into from
Apr 1, 2015

Conversation

derekwaynecarr
Copy link
Member

There was a regression as part of the PrepareForUpdate changes that prevented deletion of a namespace because the list of finalizers was never being reduced because we were always taking the input from the client and overriding it with the old value from the server.

This change fixes the following:

  1. Fixes issue where we copied old objectMeta to new object which made client specified resource versions ignored for idempotent calls. This caused race conditions between multiple finalizers.
  2. Add prepare for update strategy for namespace finalize strategy to do the right thing

/cc @smarterclayton

@googlebot
Copy link

Thanks for your pull request.

It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA) at https://cla.developers.google.com/.

If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check the information on your CLA or see this help article on setting the email on your git commits.

Once you've done that, please reply here to let us know. If you signed the CLA as a corporation, please let us know the company's name.

@vmarmol
Copy link
Contributor

vmarmol commented Mar 31, 2015

Assigning @smarterclayton, feel free to reassign.

@derekwaynecarr
Copy link
Member Author

@smarterclayton - i will ping to review this PR, want to add a little more testing.

@smarterclayton
Copy link
Contributor

K, was about to ask for that

@derekwaynecarr
Copy link
Member Author

@smarterclayton - this should be good to go now functionally, i added an extra validation test with mutiple finalizers... if we want to unblock the bug, we can merge this now, and i will follow-up tomorrow with more testing to ensure no future regression.

oldNamespace.Spec.Finalizers = namespace.Spec.Finalizers

oldNamespace.Labels = namespace.Labels
oldNamespace.Annotations = namespace.Annotations
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

this is what happens when you are rushing to fix something before leaving work ;-)

cleaning this up more this morning and getting more tests for various strategies.

@derekwaynecarr
Copy link
Member Author

@smarterclayton - added tests for each of the strategies that they are doing the right thing, and fixed where we had flipped old and new on validateNamespaceUpdate call.

@smarterclayton
Copy link
Contributor

LGTM

smarterclayton added a commit that referenced this pull request Apr 1, 2015
@smarterclayton smarterclayton merged commit dec3209 into kubernetes:master Apr 1, 2015
@derekwaynecarr derekwaynecarr deleted the finalize_fix branch April 17, 2015 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants