Skip to content

Commit

Permalink
feat: update harbor operator name and namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
ferruhcihan committed Jul 9, 2024
1 parent a99bde5 commit 8ab0058
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/operator/harbor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ const secretsAndConfigmapsCallback = async (e: any) => {
const { object } = e
const { metadata, data } = object

if (object.kind === 'Secret' && metadata.name === 'harbor-app-operator-secret') {
if (object.kind === 'Secret' && metadata.name === 'apl-harbor-operator-secret') {
env.harborPassword = Buffer.from(data.harborPassword, 'base64').toString()
env.harborUser = Buffer.from(data.harborUser, 'base64').toString()
env.oidcEndpoint = Buffer.from(data.oidcEndpoint, 'base64').toString()
env.oidcClientId = Buffer.from(data.oidcClientId, 'base64').toString()
env.oidcClientSecret = Buffer.from(data.oidcClientSecret, 'base64').toString()
} else if (object.kind === 'ConfigMap' && metadata.name === 'harbor-app-operator-cm') {
} else if (object.kind === 'ConfigMap' && metadata.name === 'apl-harbor-operator-cm') {
env.harborBaseRepoUrl = data.harborBaseRepoUrl
env.oidcAutoOnboard = data.oidcAutoOnboard === 'true'
env.oidcUserClaim = data.oidcUserClaim
Expand Down Expand Up @@ -165,13 +165,13 @@ const secretsAndConfigmapsCallback = async (e: any) => {
export default class MyOperator extends Operator {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
protected async init() {
// Watch harbor-app-operator-secret
// Watch apl-harbor-operator-secret
try {
await this.watchResource('', 'v1', 'secrets', secretsAndConfigmapsCallback, harborOperatorNamespace)
} catch (error) {
console.debug(error)
}
// Watch harbor-app-operator-cm
// Watch apl-harbor-operator-cm
try {
await this.watchResource('', 'v1', 'configmaps', secretsAndConfigmapsCallback, harborOperatorNamespace)
} catch (error) {
Expand Down

0 comments on commit 8ab0058

Please sign in to comment.