Skip to content

Commit

Permalink
feat: more logging two
Browse files Browse the repository at this point in the history
  • Loading branch information
ElderMatt committed Jun 20, 2024
1 parent 5ff6ef3 commit 6941b30
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/operator/keycloak.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ export default class MyOperator extends Operator {
if (data!.IDP_CLIENT_ID) env.IDP_CLIENT_ID = Buffer.from(data!.IDP_CLIENT_ID, 'base64').toString()
if (data!.IDP_CLIENT_SECRET)
env.IDP_CLIENT_SECRET = Buffer.from(data!.IDP_CLIENT_SECRET, 'base64').toString()
await runKeycloakUpdater('updateConfig')
await runKeycloakUpdater('updateConfig').then(() => {
console.log('Updated Config')
})
} catch (error) {
console.debug(error)
}
Expand Down Expand Up @@ -246,7 +248,9 @@ export default class MyOperator extends Operator {
env.IDP_SUB_CLAIM_MAPPER = data!.IDP_SUB_CLAIM_MAPPER
env.IDP_USERNAME_CLAIM_MAPPER = data!.IDP_USERNAME_CLAIM_MAPPER
}
await runKeycloakUpdater('updateConfig')
await runKeycloakUpdater('updateConfig').then(() => {
console.log('Updated Config')
})
} catch (error) {
console.debug(error)
}
Expand Down Expand Up @@ -305,12 +309,24 @@ async function keycloakConfigMapChanges() {

async function keycloakTeamAdded() {
const connection = await createKeycloakConnection()
await manageGroups(connection)
try {
await manageGroups(connection).then(() => {
console.log('Completed adding team:')
})
} catch (error) {
console.log('Error adding team: ', error)
}
}

async function keycloakTeamDeleted() {
const connection = await createKeycloakConnection()
await manageGroups(connection)
try {
await manageGroups(connection).then(() => {
console.log('Completed deleting team:')
})
} catch (error) {
console.log('Error deleting team: ', error)
}
}

async function createKeycloakConnection(): Promise<KeycloakConnection> {
Expand Down

0 comments on commit 6941b30

Please sign in to comment.