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:
Kubernetes Submit Queue
2016-09-27 20:30:54 -07:00
committed by GitHub

View File

@@ -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()}