Skip to content

RHCLOUD-20981 [MBOP] Runtime error if Keycloak not available and a token is requested#152

Open
EvanCasey13 wants to merge 3 commits intoRedHatInsights:masterfrom
EvanCasey13:keycloak_not_available_error_handling
Open

RHCLOUD-20981 [MBOP] Runtime error if Keycloak not available and a token is requested#152
EvanCasey13 wants to merge 3 commits intoRedHatInsights:masterfrom
EvanCasey13:keycloak_not_available_error_handling

Conversation

@EvanCasey13
Copy link

@EvanCasey13 EvanCasey13 commented Jan 30, 2025

https://issues.redhat.com/browse/RHCLOUD-20981

Gracefully handle errors when a token is requested from keycloak but the server cannot be reached or is down.

@EvanCasey13 EvanCasey13 marked this pull request as draft January 30, 2025 17:07
@EvanCasey13 EvanCasey13 changed the title [WIP][MBOP] Runtime error if Keycloak not available and a token is requested [MBOP] Runtime error if Keycloak not available and a token is requested Jan 31, 2025
@EvanCasey13 EvanCasey13 marked this pull request as ready for review January 31, 2025 16:09
@lpichler
Copy link

lpichler commented Feb 4, 2025

  1. Is possible to add some tests for it ? I am not sure whether mocking network services in test are available here.
  2. How this was tested in ephemeral or locally ? if you have some examples it would be great.

@EvanCasey13 EvanCasey13 changed the title [MBOP] Runtime error if Keycloak not available and a token is requested RHCLOUD-20981 [MBOP] Runtime error if Keycloak not available and a token is requested Feb 4, 2025
if resp != nil && resp.Body != nil {
defer resp.Body.Close()
} else {
fmt.Println("Recieved an empty response from the keycloak server.")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: Recieved -> Received
I found it 3x times

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants