Distinguish service unavailable errors in client-go

This commit is contained in:
Jordan Liggitt 2018-01-24 00:14:21 -05:00
parent 35ed5338b1
commit ca2eba7040
No known key found for this signature in database
GPG Key ID: 39928704103C7229

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"