Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debug logs to KubernetesPersonalAccessTokenManager class #656

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading