Skip to content

Commit d234fe8

Browse files
Merge pull request #9488 from rna-afk/fix_panic_on_crashing_proxy
OCPBUGS-45805: Check for nil in case of proxy crash/deleted
2 parents 3a55840 + c80756f commit d234fe8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/destroy/azure/azure.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,11 @@ func isAuthError(err error) bool {
733733
// https://github.com/Azure/azure-sdk-for-go/blob/sdk/azidentity/v1.1.0/sdk/azidentity/errors.go#L36
734734
var authErr *azidentity.AuthenticationFailedError
735735
if errors.As(err, &authErr) {
736-
if authErr.RawResponse.StatusCode >= 400 && authErr.RawResponse.StatusCode <= 403 {
736+
if authErr.RawResponse == nil {
737+
// Unable to get a proper response, probably due to some proxy error. Fixing this piece of code
738+
// so it doesn't throw a panic.
739+
return true
740+
} else if authErr.RawResponse.StatusCode >= 400 && authErr.RawResponse.StatusCode <= 403 {
737741
return true
738742
}
739743
}

0 commit comments

Comments
 (0)