-
Notifications
You must be signed in to change notification settings - Fork 39k
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
Delete pod with uid as precondition. #25224
Conversation
LGTM. Thanks. |
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 |
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.
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"
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.
ACK.
64f439f
to
cb6fe9e
Compare
@yujuhong Addressed comments. |
LGTM. Thanks! |
Mark P1 to get rid of flakes. |
GCE e2e build/test passed for commit cb6fe9e. |
Automatic merge from submit-queue |
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