Skip to content

Commit

Permalink
Merge pull request #2397 from feiskyer/1.1
Browse files Browse the repository at this point in the history
[release-1.1] chore: add debug logs for http response ContentLength, StatusCode and responseBody length
  • Loading branch information
k8s-ci-robot committed Sep 26, 2022
2 parents 574043e + a297fc0 commit f21f354
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/azureclients/armclient/azure_armclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ func DoHackRegionalRetryForGET(c *Client) autorest.SendDecorator {

bodyString := string(bodyBytes)
trimmed := strings.TrimSpace(bodyString)
klog.V(5).Infof("Send.sendRequest got response with ContentLength %d, StatusCode %d and responseBody length %d", response.ContentLength, response.StatusCode, len(trimmed))

// Hack: retry the regional ARM endpoint in case of ARM traffic split and arm resource group replication is too slow
// Empty content and 2xx http status code are returned in this case.
// Issue: https://github.com/kubernetes-sigs/cloud-provider-azure/issues/1296
Expand All @@ -157,7 +159,6 @@ func DoHackRegionalRetryForGET(c *Client) autorest.SendDecorator {
klog.Errorf("Send.sendRequest: error in parsing response body string %q: %s, Skip retrying regional host", bodyBytes, e.Error())
return response, rerr
}
klog.V(5).Infof("Send.sendRequest original response: %s", bodyString)

err, ok := body["error"].(map[string]interface{})
if !ok || err["code"] == nil || !strings.EqualFold(err["code"].(string), "ResourceGroupNotFound") {
Expand Down

0 comments on commit f21f354

Please sign in to comment.