Merge pull request #58735 from liggitt/server-unavailable-errors

Automatic merge from submit-queue. 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>.

Distinguish service unavailable errors in client-go

related to https://github.com/kubernetes/kubernetes/issues/58642

the server is returning correct errors, but the client was not distinguishing service unavailable errors from general 5xx errors

```release-note
NONE
```
pull/6/head
Kubernetes Submit Queue 2018-01-25 06:14:21 -08:00 committed by GitHub
commit 068e1642f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -366,6 +366,9 @@ func NewGenericServerResponse(code int, verb string, qualifiedResource schema.Gr
case http.StatusUnprocessableEntity:
reason = metav1.StatusReasonInvalid
message = "the server rejected our request due to an error in our request"
case http.StatusServiceUnavailable:
reason = metav1.StatusReasonServiceUnavailable
message = "the server is currently unable to handle the request"
case http.StatusGatewayTimeout:
reason = metav1.StatusReasonTimeout
message = "the server was unable to return a response in the time allotted, but may still be processing the request"