-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ad03bd
commit 6e93ff5
Showing
1 changed file
with
26 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 |
---|---|---|
@@ -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]; | ||
}; |