Skip to content

Commit

Permalink
Restore storage.
Browse files Browse the repository at this point in the history
  • Loading branch information
gary-van-woerkens committed Jun 30, 2021
1 parent 2ad03bd commit 6e93ff5
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .k8s/components/storage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import env from "@kosko/env";
import type { SealedSecret } from "@kubernetes-models/sealed-secrets/bitnami.com/v1alpha1/SealedSecret";
import environments from "@socialgouv/kosko-charts/environments";
import { loadYaml } from "@socialgouv/kosko-charts/utils/getEnvironmentComponent";
import { updateMetadata } from "@socialgouv/kosko-charts/utils/updateMetadata";

export default async (): Promise<{ kind: string }[]> => {
const secret = await loadYaml<SealedSecret>(
env,
`azure-storage.sealed-secret.yaml`
);
if (!secret) {
return [];
}

const ciEnv = environments(process.env);

// add gitlab annotations
updateMetadata(secret, {
annotations: ciEnv.metadata.annotations ?? {},
labels: ciEnv.metadata.labels ?? {},
namespace: ciEnv.metadata.namespace,
});

return [secret];
};

0 comments on commit 6e93ff5

Please sign in to comment.