Add debug logs to KubernetesPersonalAccessTokenManager class (#656)

pull/658/head^2
Igor Vinokur 2024-02-21 20:24:27 +02:00 committed by GitHub
parent a691074548
commit aebdc3a04d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -241,16 +241,20 @@ public class KubernetesPersonalAccessTokenManager implements PersonalAccessToken
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()