Skip to content

Commit

Permalink
Add debug logs to KubernetesPersonalAccessTokenManager class (#656)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinokurig authored Feb 21, 2024
1 parent a691074 commit aebdc3a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,20 @@ private Optional<PersonalAccessToken> doGetPersonalAccessToken(

private boolean deleteSecretIfMisconfigured(Secret secret) throws InfrastructureException {
Map<String, String> secretAnnotations = secret.getMetadata().getAnnotations();

LOG.debug("Secret annotations: {}", secretAnnotations);
String configuredScmServerUrl = secretAnnotations.get(ANNOTATION_SCM_URL);
LOG.debug("SCM server URL: {}", configuredScmServerUrl);
String configuredCheUserId = secretAnnotations.get(ANNOTATION_CHE_USERID);
LOG.debug("Che user ID: {}", configuredCheUserId);
String configuredOAuthProviderName =
secretAnnotations.get(ANNOTATION_SCM_PERSONAL_ACCESS_TOKEN_NAME);
LOG.debug("OAuth provider name: {}", configuredOAuthProviderName);

// if any of the required annotations is missing, the secret is not valid
if (isNullOrEmpty(configuredScmServerUrl)
|| isNullOrEmpty(configuredCheUserId)
|| isNullOrEmpty(configuredOAuthProviderName)) {
LOG.debug("deleting secret {}", secret.getMetadata().getName());
cheServerKubernetesClientFactory
.create()
.secrets()
Expand Down

0 comments on commit aebdc3a

Please sign in to comment.