diff --git a/staging/src/k8s.io/legacy-cloud-providers/azure/retry/azure_error.go b/staging/src/k8s.io/legacy-cloud-providers/azure/retry/azure_error.go index 03d043cb9d9..4bf262897dc 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/azure/retry/azure_error.go +++ b/staging/src/k8s.io/legacy-cloud-providers/azure/retry/azure_error.go @@ -125,8 +125,9 @@ func getHTTPStatusCode(resp *http.Response) int { // shouldRetryHTTPRequest determines if the request is retriable. func shouldRetryHTTPRequest(resp *http.Response, err error) bool { if resp != nil { - // HTTP 412 (StatusPreconditionFailed) means etag mismatch, hence we shouldn't retry. - if resp.StatusCode == http.StatusPreconditionFailed { + // HTTP 412 (StatusPreconditionFailed) means etag mismatch + // HTTP 400 (BadRequest) means the request cannot be accepted, hence we shouldn't retry. + if resp.StatusCode == http.StatusPreconditionFailed || resp.StatusCode == http.StatusBadRequest { return false }