From 442d59457070b8d51f58f8b65fb874687cf8db0a Mon Sep 17 00:00:00 2001 From: Cenk Alti Date: Thu, 12 Jan 2023 21:03:45 -0500 Subject: [PATCH] Check status code before retrying request Signed-off-by: Cenk Alti --- pkg/cli/roundtripper.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/cli/roundtripper.go b/pkg/cli/roundtripper.go index ab90ed2e1..9cd4eacba 100644 --- a/pkg/cli/roundtripper.go +++ b/pkg/cli/roundtripper.go @@ -40,6 +40,9 @@ func (rt *retryingRoundTripper) roundTrip(req *http.Request, retry int, prevResp if rtErr != nil { return resp, rtErr } + if resp.StatusCode < 500 { + return resp, rtErr + } if resp.Header.Get("content-type") != "application/json" { return resp, rtErr }