Skip to content

Commit

Permalink
fix(ci): fix restore job initContainer (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Bouquillon committed Feb 5, 2021
1 parent 912f483 commit a35412f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .k8s/__tests__/__snapshots__/generate-prod-restore.ts.snap
Expand Up @@ -245,7 +245,7 @@ spec:
- name: PGHOST
value: cdtnadmindevserver.postgres.database.azure.com
- name: PGDATABASE
value: autodevops_8843083e
value: some-database
- name: PGPASSWORD
value: password_8843083e
- name: PGUSER
Expand Down
9 changes: 9 additions & 0 deletions .k8s/components/jobs/restore/db.ts
Expand Up @@ -31,4 +31,13 @@ const manifests = restoreDbJob({
.toString(),
});

// override initContainer PGDATABASE because this project pipeline use the legacy `db_SHA` convention instead of `autodevops_SHA`
const job = manifests.find((m) => m.kind === "Job");
if (job) {
//@ts-expect-error
job.spec.template.spec.initContainers[0].env.find(
(e: EnvVar) => e.name === "PGDATABASE"
).value = process.env.BACKUP_DB_NAME;
}

export default manifests;

0 comments on commit a35412f

Please sign in to comment.