Skip to content

Commit

Permalink
Merge pull request #47450 from kargakis/fix-drain
Browse files Browse the repository at this point in the history
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: kubernetes/kubectl#28
  • Loading branch information
Kubernetes Submit Queue committed Jun 16, 2017
2 parents e4a4b8e + 26d3ead commit a36d9df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/kubectl/cmd/drain.go
Expand Up @@ -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
}
Expand Down

0 comments on commit a36d9df

Please sign in to comment.