Skip to content

Commit

Permalink
fix(stacks.api/addons): use exact alias match for determining secret …
Browse files Browse the repository at this point in the history
…lookup source, remove numeric port alias

Signed-off-by: Braden Mars <[email protected]>
  • Loading branch information
BradenM committed Aug 5, 2023
1 parent 9ce8dcc commit f58b507
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/stacks/api/src/addons/crisiscleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export class CrisisCleanupAddOn implements blueprints.ClusterAddOn {
{ path: 'username', objectAlias: 'POSTGRES_USER' },
{ path: 'password', objectAlias: 'POSTGRES_PASSWORD' },
{ path: 'host', objectAlias: 'POSTGRES_HOST' },
{ path: 'port', objectAlias: 'POSTGRES_PORT' },
]

const csiProvider = new blueprints.SecretProviderClass(
Expand Down Expand Up @@ -157,11 +156,12 @@ export class CrisisCleanupAddOn implements blueprints.ClusterAddOn {
'crisiscleanup-db-secrets',
'crisiscleanup-db-secrets',
)
const dbAliases = dbSecretPaths.map(({ objectAlias }) => objectAlias)
const secretEnvsValues = Object.values(secretKeys).map((key) => [
key,
kplus.EnvValue.fromSecretValue({
key: key,
secret: key.startsWith('POSTGRES') ? dbSecretLookup : secretLookup,
secret: dbAliases.includes(key) ? dbSecretLookup : secretLookup,
}),
])

Expand Down

0 comments on commit f58b507

Please sign in to comment.