Merge pull request #94258 from deads2k/fix-drain-msg

update drain message to include namespace for pod
This commit is contained in:
Kubernetes Prow Robot 2020-08-29 15:44:36 -07:00 committed by GitHub
commit 3340bee8a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -264,7 +264,7 @@ func (d *Helper) evictPods(pods []corev1.Pod, policyGroupVersion string, getPodF
select { select {
case <-ctx.Done(): case <-ctx.Done():
// return here or we'll leak a goroutine. // return here or we'll leak a goroutine.
returnCh <- fmt.Errorf("error when evicting pod %q: global timeout reached: %v", pod.Name, globalTimeout) returnCh <- fmt.Errorf("error when evicting pods/%q -n %q: global timeout reached: %v", pod.Name, pod.Namespace, globalTimeout)
return return
default: default:
} }
@ -275,10 +275,10 @@ func (d *Helper) evictPods(pods []corev1.Pod, policyGroupVersion string, getPodF
returnCh <- nil returnCh <- nil
return return
} else if apierrors.IsTooManyRequests(err) { } else if apierrors.IsTooManyRequests(err) {
fmt.Fprintf(d.ErrOut, "error when evicting pod %q (will retry after 5s): %v\n", pod.Name, err) fmt.Fprintf(d.ErrOut, "error when evicting pods/%q -n %q (will retry after 5s): %v\n", pod.Name, pod.Namespace, err)
time.Sleep(5 * time.Second) time.Sleep(5 * time.Second)
} else { } else {
returnCh <- fmt.Errorf("error when evicting pod %q: %v", pod.Name, err) returnCh <- fmt.Errorf("error when evicting pods/%q -n %q: %v", pod.Name, pod.Namespace, err)
return return
} }
} }