mirror of https://github.com/k3s-io/k3s
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 ```pull/8/head
commit
c46a667fac
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue