mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-30 23:57:46 +00:00
Merge pull request #31763 from fraenkel/drain_finished
Automatic merge from submit-queue Finished pods can be drained fixes #26080 ```release-note Kubectl drain will now drain finished Pods ```
This commit is contained in:
@@ -267,6 +267,11 @@ func (o *DrainOptions) getPodCreator(pod api.Pod) (*api.SerializedReference, err
|
||||
}
|
||||
|
||||
func (o *DrainOptions) unreplicatedFilter(pod api.Pod) (bool, *warning, *fatal) {
|
||||
// any finished pod can be removed
|
||||
if pod.Status.Phase == api.PodSucceeded || pod.Status.Phase == api.PodFailed {
|
||||
return true, nil, nil
|
||||
}
|
||||
|
||||
sr, err := o.getPodCreator(pod)
|
||||
if err != nil {
|
||||
return false, nil, &fatal{err.Error()}
|
||||
|
Reference in New Issue
Block a user