This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(hasura): force load pg-user fixed secret in preprod/prod
- Loading branch information
Julien Bouquillon
committed
Jul 29, 2020
1 parent
584e4f8
commit 8be2489
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,29 @@ | ||
import env from "@kosko/env"; | ||
import { SealedSecret } from "@kubernetes-models/sealed-secrets/bitnami.com/v1alpha1/SealedSecret"; | ||
|
||
import { create } from "@socialgouv/kosko-charts/components/hasura"; | ||
import { loadYaml } from "@socialgouv/kosko-charts/utils/getEnvironmentComponent"; | ||
import { updateMetadata } from "@socialgouv/kosko-charts/utils/updateMetadata"; | ||
import gitlab from "@socialgouv/kosko-charts/environments/gitlab"; | ||
|
||
const manifests = create({ | ||
env, | ||
}); | ||
|
||
if (env.env?.includes("prod") || env.env?.includes("preprod")) { | ||
/* SEALED-SECRET */ | ||
// try to import environment sealed-secret | ||
const secret = loadYaml<SealedSecret>(env, `pg-user.sealed-secret.yaml`); | ||
if (secret) { | ||
const envParams = gitlab(process.env); | ||
// add gitlab annotations | ||
updateMetadata(secret, { | ||
annotations: envParams.annotations || {}, | ||
labels: envParams.labels || {}, | ||
namespace: envParams.namespace, | ||
}); | ||
manifests.unshift(secret); | ||
} | ||
} | ||
|
||
export default manifests; |