Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
fix(hasura): force load pg-user fixed secret in preprod/prod
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Bouquillon committed Jul 29, 2020
1 parent 584e4f8 commit 8be2489
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .k8s/components/hasura.ts
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;

0 comments on commit 8be2489

Please sign in to comment.