mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
Fix kubectl drain for statefulset and use eviciton for drain if possible
This commit is contained in:
@@ -413,6 +413,17 @@ func IsInternalError(err error) bool {
|
||||
return reasonForError(err) == unversioned.StatusReasonInternalError
|
||||
}
|
||||
|
||||
// IsTooManyRequests determines if err is an error which indicates that there are too many requests
|
||||
// that the server cannot handle.
|
||||
// TODO: update IsTooManyRequests() when the TooManyRequests(429) error returned from the API server has a non-empty Reason field
|
||||
func IsTooManyRequests(err error) bool {
|
||||
switch t := err.(type) {
|
||||
case APIStatus:
|
||||
return t.Status().Code == StatusTooManyRequests
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// IsUnexpectedServerError returns true if the server response was not in the expected API format,
|
||||
// and may be the result of another HTTP actor.
|
||||
func IsUnexpectedServerError(err error) bool {
|
||||
|
||||
Reference in New Issue
Block a user