Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export class Git {
secretJsonPaths.forEach((objectPath) => {
const val = get(config, objectPath)
if (val) {
set(secretData, objectPath, val)
set(secretData, fileMap.v2 ? objectPath.replace('.spec', '') : objectPath, val)
unset(plainData, objectPath)
}
})
Expand Down
21 changes: 20 additions & 1 deletion src/otomi-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,13 @@ export default class OtomiStack {
cleanSecretPaths.push(p)
} else {
teams.forEach((teamId: string) => {
if (p.indexOf(teamProp) === 0) cleanSecretPaths.push(p.replace(teamProp, `teamConfig.${teamId}`))
if (p.indexOf(teamProp) === 0)
cleanSecretPaths.push(
p
.replace(teamProp, `teamConfig.${teamId}`)
// add spec to the path for v2 endpoints
.replace(`teamConfig.${teamId}.settings`, `teamConfig.${teamId}.settings.spec`),
)
})
}
})
Expand Down Expand Up @@ -680,6 +686,19 @@ export default class OtomiStack {
async createAplTeam(data: AplTeamSettingsRequest, deploy = true): Promise<AplTeamSettingsResponse> {
const teamName = data.metadata.name

if (isEmpty(data.spec.password)) {
debug(`creating password for team '${teamName}'`)
// eslint-disable-next-line no-param-reassign
data.spec.password = generatePassword({
length: 16,
numbers: true,
symbols: false,
lowercase: true,
uppercase: true,
strict: true,
})
}

const teamConfig = this.repoService.createTeamConfig(data)
const team = teamConfig.settings
const apps = getAppList()
Expand Down
Loading