Files
kubernetes/pkg/kubectl/cmd
Kubernetes Submit Queue e3fa9133af Merge pull request #64896 from rphillips/fixes/kubectl_eviction
Automatic merge from submit-queue (batch tested with PRs 65776, 64896). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubectl: wait for all errors and successes on podEviction

**What this PR does / why we need it**: This fixes `kubectl drain` to wait until all errors and successes are processed, instead of returning the first error. It also tweaks the behavior of the cleanup to check to see if the pod is already terminating, and if it is to not reissue the pod terminate which leads to an error getting thrown. This fix will allow `kubectl drain` to complete successfully when a node is draining.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:
/cc @sjenning 

**Release note**:
```release-note
NONE
```
#### Reproduction steps
### sleep.yml
```yaml
apiVersion: v1
kind: Pod
metadata:
  name: bash
spec: 
  containers:
  - name: bash
    image: bash
    resources:
      limits:
        cpu: 500m
        memory: 500Mi
    command:
    - bash
    - -c
    - "nothing() { sleep 1; } ; trap nothing 15 ; while true; do echo \"hello\"; sleep 10; done"
  terminationGracePeriodSeconds: 3000
  restartPolicy: Never
```

```
$ kubectl create ns testing
$ kubectl create -f sleep.yml
$ kubectl delete ns testing
$ kubectl drain 127.0.0.1 --force
```
2018-07-03 18:06:10 -07:00
..
2018-06-22 16:22:57 -07:00
2018-07-03 13:53:06 -04:00
2018-06-22 16:22:57 -07:00
2018-06-22 16:22:57 -07:00
2018-06-22 16:22:57 -07:00
2018-06-27 15:46:35 +08:00
2018-06-22 16:22:57 -07:00
2018-05-08 09:02:34 -04:00
2018-03-13 16:21:30 -04:00
2018-05-08 09:02:34 -04:00
2017-12-25 16:23:38 +08:00
2017-08-16 12:27:36 -07:00
2018-05-08 09:02:34 -04:00
2018-04-27 21:41:03 +02:00
2018-05-08 18:33:50 -04:00
2018-05-08 09:02:34 -04:00
2018-05-08 09:02:34 -04:00