Merge pull request #47450 from kargakis/fix-drain

Automatic merge from submit-queue (batch tested with PRs 47523, 47438, 47550, 47450, 47612)

Ignore 404s on evict

One of our upgrades failed with 
```
error: error when evicting pod \"boo-2-deploy\": pods \"boo-2-deploy\" not found"
```

@derekwaynecarr since you already fixed half of it 

cc: @kubernetes/sig-cli-bugs 

I failed terribly at adding a unit test mostly because draining involves discovery for the eviction API and the fake client stuff for discovery are far from functional - will spawn a separate issue about it.

fyi @jupierce

related: https://github.com/kubernetes/kubectl/issues/28
pull/6/head
Kubernetes Submit Queue 2017-06-15 18:54:06 -07:00 committed by GitHub
commit a36d9df224
1 changed files with 1 additions and 1 deletions

View File

@ -496,7 +496,7 @@ func (o *DrainOptions) evictPods(pods []api.Pod, policyGroupVersion string, getP
break
} else if apierrors.IsTooManyRequests(err) {
time.Sleep(5 * time.Second)
} else {
} else if !apierrors.IsNotFound(err) {
errCh <- fmt.Errorf("error when evicting pod %q: %v", pod.Name, err)
return
}