client-go: add test to document retry conditions

Kubernetes-commit: 68c542d52246b0b750e332616884350164018695
This commit is contained in:
Abu Kashem
2022-05-27 09:13:30 -04:00
committed by Kubernetes Publisher
parent adb1f506f9
commit 79c4b4060a
2 changed files with 221 additions and 1 deletions

View File

@@ -346,8 +346,12 @@ func retryAfterResponse() *http.Response {
}
func retryAfterResponseWithDelay(delay string) *http.Response {
return retryAfterResponseWithCodeAndDelay(http.StatusInternalServerError, delay)
}
func retryAfterResponseWithCodeAndDelay(code int, delay string) *http.Response {
return &http.Response{
StatusCode: http.StatusInternalServerError,
StatusCode: code,
Header: http.Header{"Retry-After": []string{delay}},
}
}