Skip to content

Commit 43a0646

Browse files
authored
fix: fetch gitea credentials from dedicated secret (#1014)
1 parent 2abe381 commit 43a0646

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export const APL_SECRETS_NAMESPACE = 'apl-secrets'
22
export const APL_USERS_NAMESPACE = 'apl-users'
33
export const PLATFORM_SECRETS_NAME = 'otomi-secrets'
4+
export const GITEA_SECRETS_NAME = 'gitea-secrets'

src/otomi-stack.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { readFile } from 'fs/promises'
77
import { generate as generatePassword } from 'generate-password'
88
import { cloneDeep, isEmpty, map, merge, omit, pick, set, unset } from 'lodash'
99
import { getAppList, getAppSchema } from 'src/app'
10-
import { APL_SECRETS_NAMESPACE, APL_USERS_NAMESPACE, PLATFORM_SECRETS_NAME } from 'src/constants'
10+
import { APL_SECRETS_NAMESPACE, APL_USERS_NAMESPACE, GITEA_SECRETS_NAME, PLATFORM_SECRETS_NAME } from 'src/constants'
1111
import { AlreadyExists, ForbiddenError, HttpError, NotExistError, OtomiError, ValidationError } from 'src/error'
1212
import { getSettingsFileMaps } from 'src/fileStore/file-map'
1313
import { FileStore } from 'src/fileStore/file-store'
@@ -1472,8 +1472,8 @@ export default class OtomiStack {
14721472
if (!gitea?.values?.enabled) return []
14731473
const { cluster } = await this.getSettings(['cluster'])
14741474
const username = (gitea.values?.adminUsername as string) || 'otomi-admin'
1475-
const platformSecrets = await getSecretValues(PLATFORM_SECRETS_NAME, APL_SECRETS_NAMESPACE)
1476-
const password = platformSecrets?.git_password
1475+
const giteaSecrets = await getSecretValues(GITEA_SECRETS_NAME, APL_SECRETS_NAMESPACE)
1476+
const password = giteaSecrets?.adminPassword
14771477
const orgName = `team-${teamId}`
14781478
const domainSuffix = cluster?.domainSuffix
14791479
const internalRepoUrls = (await getGiteaRepoUrls(username, password, orgName, domainSuffix)) || []

0 commit comments

Comments
 (0)