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

Delete pod with uid as precondition. #25224

Merged
merged 1 commit into from
May 6, 2016

Conversation

Random-Liu
Copy link
Member

Addressed #25169 (comment).

Fix #25169
Fix #24937

This PR change status manager to delete pods with uid as a precondition, so that kubelet won't delete pods with different uid but the same name and namespace accidentally.

/cc @yujuhong

@Random-Liu Random-Liu added kind/bug Categorizes issue or PR as related to a bug. area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. labels May 5, 2016
@caesarxuchao caesarxuchao added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 5, 2016
@caesarxuchao
Copy link
Member

LGTM. Thanks.

@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-label-needed and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels May 5, 2016
@Random-Liu Random-Liu added release-note-none Denotes a PR that doesn't merit a release note. lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed release-note-label-needed labels May 5, 2016
if err := m.kubeClient.Core().Pods(pod.Namespace).Delete(pod.Name, api.NewDeleteOptions(0)); err == nil {
// The delete options guaranteed that:
// 1. The pod should be deleted immediately
// 2. Only the pod with the same uid should be deleted. See #25169
Copy link
Contributor

Choose a reason for hiding this comment

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

This is obviously the right thing to do. Don't think we need to link the issue :-)
maybe change the comment to "Use the pod UID as the precondition for deletion to prevent deleting a newly created pod with the same name and namespace"

Copy link
Member Author

Choose a reason for hiding this comment

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

ACK.

@Random-Liu Random-Liu removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 5, 2016
@Random-Liu
Copy link
Member Author

@yujuhong Addressed comments.

@Random-Liu Random-Liu added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 5, 2016
@yujuhong
Copy link
Contributor

yujuhong commented May 5, 2016

LGTM. Thanks!

@Random-Liu Random-Liu added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label May 5, 2016
@Random-Liu
Copy link
Member Author

Mark P1 to get rid of flakes.

@k8s-bot
Copy link

k8s-bot commented May 6, 2016

GCE e2e build/test passed for commit cb6fe9e.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 4a00266 into kubernetes:master May 6, 2016
@Random-Liu Random-Liu deleted the delete-pod-with-uid branch May 6, 2016 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubelet kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants