mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Make error message and service message more clear
This commit is contained in:
parent
f029700630
commit
96084a5198
@ -747,13 +747,15 @@ func (az *Cloud) processHTTPRetryResponse(service *v1.Service, reason string, re
|
|||||||
}
|
}
|
||||||
|
|
||||||
if shouldRetryHTTPRequest(resp, err) {
|
if shouldRetryHTTPRequest(resp, err) {
|
||||||
if err != nil {
|
message := "processHTTPRetryResponse: backoff failure, will retry"
|
||||||
az.Event(service, v1.EventTypeWarning, reason, err.Error())
|
if resp != nil {
|
||||||
klog.Errorf("processHTTPRetryResponse: backoff failure, will retry, err=%v", err)
|
message = fmt.Sprintf("%s, HTTP response: %d", message, resp.StatusCode)
|
||||||
} else {
|
|
||||||
az.Event(service, v1.EventTypeWarning, reason, fmt.Sprintf("Azure HTTP response %d", resp.StatusCode))
|
|
||||||
klog.Errorf("processHTTPRetryResponse: backoff failure, will retry, HTTP response=%d", resp.StatusCode)
|
|
||||||
}
|
}
|
||||||
|
if err != nil {
|
||||||
|
message = fmt.Sprintf("%s, error: %v", message, err)
|
||||||
|
}
|
||||||
|
az.Event(service, v1.EventTypeWarning, reason, message)
|
||||||
|
klog.Error(message)
|
||||||
|
|
||||||
// suppress the error object so that backoff process continues
|
// suppress the error object so that backoff process continues
|
||||||
return false, nil
|
return false, nil
|
||||||
@ -769,15 +771,17 @@ func (az *Cloud) processHTTPResponse(service *v1.Service, reason string, resp *h
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
message := "processHTTPResponse failed"
|
||||||
az.Event(service, v1.EventTypeWarning, reason, err.Error())
|
if resp != nil {
|
||||||
klog.Errorf("processHTTPRetryResponse failure with err: %v", err)
|
message = fmt.Sprintf("%s, HTTP response: %d", message, resp.StatusCode)
|
||||||
} else if resp != nil {
|
|
||||||
az.Event(service, v1.EventTypeWarning, reason, fmt.Sprintf("Azure HTTP response %d", resp.StatusCode))
|
|
||||||
klog.Errorf("processHTTPRetryResponse failure with HTTP response %q", resp.Status)
|
|
||||||
}
|
}
|
||||||
|
if err != nil {
|
||||||
|
message = fmt.Sprintf("%s, error: %v", message, err)
|
||||||
|
}
|
||||||
|
az.Event(service, v1.EventTypeWarning, reason, message)
|
||||||
|
klog.Error(message)
|
||||||
|
|
||||||
return err
|
return fmt.Errorf(message)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cfg *Config) shouldOmitCloudProviderBackoff() bool {
|
func (cfg *Config) shouldOmitCloudProviderBackoff() bool {
|
||||||
|
Loading…
Reference in New Issue
Block a user