Skip to content

Commit e7420a4

Browse files
authored
Merge pull request kubernetes#94078 from DataDog/armclient-errors-handling
ARM client: survive empty response and error
2 parents 164e9fe + d16eee0 commit e7420a4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

staging/src/k8s.io/legacy-cloud-providers/azure/clients/armclient/azure_armclient.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ func (c *Client) sendRequest(ctx context.Context, request *http.Request) (*http.
110110
request,
111111
retry.DoExponentialBackoffRetry(&sendBackoff),
112112
)
113+
114+
if response == nil && err == nil {
115+
return response, retry.NewError(false, fmt.Errorf("Empty response and no HTTP code"))
116+
}
117+
113118
return response, retry.GetError(response, err)
114119
}
115120

0 commit comments

Comments
 (0)