@@ -747,13 +747,15 @@ func (az *Cloud) processHTTPRetryResponse(service *v1.Service, reason string, re
747
747
}
748
748
749
749
if shouldRetryHTTPRequest (resp , err ) {
750
+ message := "processHTTPRetryResponse: backoff failure, will retry"
751
+ if resp != nil {
752
+ message = fmt .Sprintf ("%s, HTTP response: %d" , message , resp .StatusCode )
753
+ }
750
754
if err != nil {
751
- az .Event (service , v1 .EventTypeWarning , reason , err .Error ())
752
- klog .Errorf ("processHTTPRetryResponse: backoff failure, will retry, err=%v" , err )
753
- } else {
754
- az .Event (service , v1 .EventTypeWarning , reason , fmt .Sprintf ("Azure HTTP response %d" , resp .StatusCode ))
755
- klog .Errorf ("processHTTPRetryResponse: backoff failure, will retry, HTTP response=%d" , resp .StatusCode )
755
+ message = fmt .Sprintf ("%s, error: %v" , message , err )
756
756
}
757
+ az .Event (service , v1 .EventTypeWarning , reason , message )
758
+ klog .Error (message )
757
759
758
760
// suppress the error object so that backoff process continues
759
761
return false , nil
@@ -769,15 +771,17 @@ func (az *Cloud) processHTTPResponse(service *v1.Service, reason string, resp *h
769
771
return nil
770
772
}
771
773
774
+ message := "processHTTPResponse failed"
775
+ if resp != nil {
776
+ message = fmt .Sprintf ("%s, HTTP response: %d" , message , resp .StatusCode )
777
+ }
772
778
if err != nil {
773
- az .Event (service , v1 .EventTypeWarning , reason , err .Error ())
774
- klog .Errorf ("processHTTPRetryResponse failure with err: %v" , err )
775
- } else if resp != nil {
776
- az .Event (service , v1 .EventTypeWarning , reason , fmt .Sprintf ("Azure HTTP response %d" , resp .StatusCode ))
777
- klog .Errorf ("processHTTPRetryResponse failure with HTTP response %q" , resp .Status )
779
+ message = fmt .Sprintf ("%s, error: %v" , message , err )
778
780
}
781
+ az .Event (service , v1 .EventTypeWarning , reason , message )
782
+ klog .Error (message )
779
783
780
- return err
784
+ return fmt . Errorf ( message )
781
785
}
782
786
783
787
func (cfg * Config ) shouldOmitCloudProviderBackoff () bool {
0 commit comments