Skip to content

Commit

Permalink
Handle empty response for registration call
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Hundley <[email protected]>
  • Loading branch information
rwhundley committed Jan 29, 2025
1 parent 942872a commit 7eecd99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions controllers/oidc.security/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func NewOIDCClientRegistrationError(clientID, requestMethod, origErrMsg string,
return
}
if response == nil || response.Body == nil {
oidcErr.Description = "no response received"
return
}
defer response.Body.Close()
Expand Down
2 changes: 1 addition & 1 deletion controllers/oidc.security/zen_registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (r *ClientReconciler) getZenInstanceRegistration(ctx context.Context, clien
switch v := err.(type) {
case *OIDCClientRegistrationError:
// Return no response or error if the OIDC client isn't found given a token couldn't be retrieved
if v.response.StatusCode == 404 {
if v.response != nil && v.response.StatusCode == 404 {
return nil, nil
}
return
Expand Down

0 comments on commit 7eecd99

Please sign in to comment.