k3s/pkg
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
..
api Merge pull request #64654 from atlassian/missing-error-handling 2018-07-02 07:14:34 -07:00
apis Update generated files 2018-06-29 20:36:17 +02:00
auth Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
capabilities
client Autogenerated stuff 2018-06-27 13:31:10 +02:00
cloudprovider Merge pull request #65412 from yastij/az-ignore-failed-nic 2018-07-01 20:25:04 -07:00
controller Merge pull request #65677 from MorrisLaw/node-controller-logging 2018-07-03 16:35:05 -07:00
credentialprovider Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
features Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
fieldpath Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
generated Autogenerated stuff 2018-06-27 13:31:10 +02:00
kubeapiserver Build file generated 2018-07-02 22:25:45 -04:00
kubectl Merge pull request #64896 from rphillips/fixes/kubectl_eviction 2018-07-03 18:06:10 -07:00
kubelet Speed up cluster startup in GCE 2018-07-02 10:22:32 +02:00
kubemark Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
master Merge pull request #64246 from wojtek-t/lease_object_type 2018-06-27 08:17:10 -07:00
printers make template printers a recommended printer 2018-07-03 07:47:17 -04:00
probe Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
proxy Merge pull request #64654 from atlassian/missing-error-handling 2018-07-02 07:14:34 -07:00
quota Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
registry Merge pull request #65154 from jennybuckley/add-update-options-3 2018-07-02 11:06:15 -07:00
routes
scheduler Merge pull request #64363 from idealhack/sub-benchmarks/scheduler/schedulercache 2018-07-01 19:04:19 -07:00
security Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
securitycontext Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
serviceaccount fix a nit error in log 2018-06-27 14:21:27 +08:00
ssh Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
util fix smb mount security issue 2018-07-03 08:03:31 +00:00
version Set gazelle:importmap_prefix for everything under staging/src 2018-06-22 16:22:57 -07:00
volume Merge pull request #65691 from jsafrane/azure-managed-error 2018-07-02 16:52:18 -07:00
watch/json Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
windows/service Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
.import-restrictions
BUILD Autogenerated stuff 2018-06-27 13:31:10 +02:00
OWNERS