Unverified Commit c46a667f authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #63698 from rajatjindal/fix-eviction-errormsg

Automatic merge from submit-queue (batch tested with PRs 65230, 57355, 59174, 63698, 63659). 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>. add msg when getting toomanyrequest error from evict pod **What this PR does / why we need it**: When Pod Disruption Budget prevents eviction of pods, the error msg is not exposed to the user **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 # Fixes https://github.com/kubernetes/kops/issues/5066 **Special notes for your reviewer**: Multiple people reported hung cluster update due to this issue, its confusing for them as the error msg is not exposed. **Release note**: ```release-note NONE ```
parents c399c306 08b92fff
......@@ -586,6 +586,7 @@ func (o *DrainOptions) evictPods(pods []corev1.Pod, policyGroupVersion string, g
doneCh <- true
return
} else if apierrors.IsTooManyRequests(err) {
fmt.Fprintf(o.ErrOut, "error when evicting pod %q (will retry after 5s): %v\n", pod.Name, err)
time.Sleep(5 * time.Second)
} else {
errCh <- fmt.Errorf("error when evicting pod %q: %v", pod.Name, err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment