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 kubectl drain ignore daemonsets and others #87361
Fix kubectl drain ignore daemonsets and others #87361
Conversation
|
/cc @mengqiy @seans3 @apelisse |
|
/test pull-kubernetes-e2e-kind |
|
/test pull-kubernetes-e2e-gce |
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.
/approve
/priority backlog
| status: status, | ||
| }) | ||
| } | ||
| pods = append(pods, podDelete{ |
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.
Yeah, I agree with this change, especially after looking at
kubernetes/staging/src/k8s.io/kubectl/pkg/drain/filters.go
Lines 160 to 165 in 2808d71
| // Note that we return false in cases where the pod is DaemonSet managed, | |
| // regardless of flags. | |
| // | |
| // The exception is for pods that are orphaned (the referencing | |
| // management resource - including DaemonSet - is not found). | |
| // Such pods will be deleted if --force is used. |
Can you please add a comment here, why this is done so, this will prevent eventual "optimization" like that from the PR you're reverting.
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.
OK. I'll try to do this.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: soltysh, zhouya0 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/kind bug |
|
@zhouya0: you cannot LGTM your own PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
2519982
to
f124726
Compare
f124726
to
e3c8add
Compare
|
/test pull-kubernetes-integration |
|
/test pull-kubernetes-integration |
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.
/lgtm
|
/lgtm |
|
Thanks for the fix. |
…nore_daemonsets_and_ohters Fix kubectl drain ignore daemonsets and others Kubernetes-commit: a330def
What type of PR is this?
What this PR does / why we need it:
This is actually a change back of the PR which is submitted 3 months ago.
#84562
The origin PR wants stop those pods whose
status.deleteisfalseadd topodDeleteList. The thought is good but actually after this logic there is aThe function
list.errorswill check those pods who hasi.status.reason == podDeleteStatusTypeError. So thosedaemonsets, pods with volumes and others, whosestatus.deleteis actuallyfalsewill never be found in conditions after this PR. Causing error like kubernetes/kubectl#803.Which issue(s) this PR fixes:
Fixes # kubernetes/kubectl#803
Does this PR introduce a user-facing change?: