-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(PL-2554): separate secrets from envvars in chart
- Loading branch information
Showing
12 changed files
with
128 additions
and
93 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
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,55 +1,56 @@ | ||
{{- and (required ".Values.env.PLUGIN_TOKEN is required" .Values.env.PLUGIN_TOKEN) "" -}} | ||
{{- and (required ".Values.secretEnv.values.PLUGIN_TOKEN is required" .Values.secretEnv.values.PLUGIN_TOKEN) "" -}} | ||
{{- and (required ".Values.env.CATALOG_URL is required" .Values.env.CATALOG_URL) "" -}} | ||
{{- if eq .Values.secretType "secret" }} | ||
apiVersion: v1 | ||
kind: Secret | ||
{{- else if eq .Values.secretType "sealedSecret" }} | ||
|
||
{{- $sealedSecret := (eq .Values.secretEnv.type "sealedSecret") -}} | ||
|
||
{{- if $sealedSecret }} | ||
apiVersion: bitnami.com/v1alpha1 | ||
kind: SealedSecret | ||
{{- else }} | ||
apiVersion: v1 | ||
kind: Secret | ||
{{- end }} | ||
metadata: | ||
name: {{ include "joy-generator.fullname" . }}-config | ||
{{- if eq .Values.secretType "sealedSecret" }} | ||
{{- with .Values.sealedSecretAnnotations }} | ||
{{- if $sealedSecret }} | ||
annotations: | ||
{{ toYaml . | indent 4 }} | ||
{{- end }} | ||
{{ toYaml .Values.sealedSecretAnnotations | indent 4 }} | ||
{{- end }} | ||
{{- if eq .Values.secretType "secret" }} | ||
stringData: | ||
{{ toYaml .Values.env | indent 2 }} | ||
{{- else if eq .Values.secretType "sealedSecret" }} | ||
{{- if $sealedSecret }} | ||
spec: | ||
encryptedData: | ||
{{ toYaml .Values.env | indent 4 }} | ||
{{ toYaml .Values.secretEnv.values | indent 4 }} | ||
{{- else }} | ||
stringData: | ||
{{ toYaml .Values.secretEnv.values | indent 2 }} | ||
{{- end }} | ||
|
||
--- | ||
|
||
{{- if .Values.env.GH_APP_ID }} | ||
{{- and (required ".Values.env.GH_APP_INSTALLATION_ID is required" .Values.env.GH_APP_INSTALLATION_ID) "" | -}} | ||
{{- if eq .Values.secretType "secret" }} | ||
apiVersion: v1 | ||
kind: Secret | ||
{{- else if eq .Values.secretType "sealedSecret" }} | ||
{{- and (required ".Values.githubAppPrivateKey is required" .Values.githubAppPrivateKey) "" -}} | ||
{{- if $sealedSecret }} | ||
apiVersion: bitnami.com/v1alpha1 | ||
kind: SealedSecret | ||
{{- else }} | ||
apiVersion: v1 | ||
kind: Secret | ||
{{- end }} | ||
metadata: | ||
name: {{ include "joy-generator.fullname" . }}-github-app-key | ||
{{- if eq .Values.secretType "sealedSecret" }} | ||
{{- with .Values.sealedSecretAnnotations }} | ||
{{- if $sealedSecret }} | ||
annotations: | ||
{{ toYaml . | indent 4 }} | ||
{{- end }} | ||
{{ toYaml .Values.sealedSecretAnnotations | indent 4 }} | ||
{{- end }} | ||
{{- if eq .Values.secretType "secret" }} | ||
stringData: | ||
githubApp.pem: | | ||
{{ required ".Values.githubApp.privateKey key is required" .Values.githubApp.privateKey | indent 4 }} | ||
{{- else if eq .Values.secretType "sealedSecret" }} | ||
{{- if $sealedSecret }} | ||
spec: | ||
encryptedData: | ||
githubApp.pem: | | ||
{{ required " .Values.githubApp.privateKey key is required" .Values.githubApp.privateKey | indent 6 }} | ||
{{ .Values.githubAppPrivateKey | indent 6 }} | ||
{{- else }} | ||
stringData: | ||
githubApp.pem: | | ||
{{ .Values.githubAppPrivateKey | indent 4 }} | ||
{{- end }} | ||
{{- end }} |
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
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
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
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,19 +1,20 @@ | ||
# Configuration settings for the joy-generator instance | ||
env: | ||
PLUGIN_TOKEN: "@very!l0ngands3curet0ken" | ||
|
||
GH_APP_ID: "123" | ||
GH_APP_INSTALLATION_ID: "666" | ||
|
||
# The HTTPS Git URL of your joy catalog | ||
CATALOG_URL: "https://github.com/example/foobar.git" | ||
|
||
secretEnv: | ||
values: | ||
PLUGIN_TOKEN: "@very!l0ngands3curet0ken" | ||
|
||
# The GitHub app configuration. | ||
# Required if githubToken is not set. | ||
githubApp: | ||
# The GitHub application private key (PEM format) | ||
privateKey: | | ||
FOOBARLOREMISPUM | ||
# The GitHub application private key (PEM format) | ||
githubAppPrivateKey: | | ||
FOOBARLOREMISPUM | ||
image: | ||
tag: 0.1.2 |
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
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
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
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
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
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,27 @@ | ||
set -eux | ||
|
||
kind delete cluster | ||
kind create cluster | ||
|
||
kubectl config set-context kind-kind | ||
|
||
docker build -t local-generator-test:latest . | ||
|
||
kind load docker-image local-generator-test:latest | ||
|
||
helm install generator ./chart --values - <<EOF | ||
env: | ||
CATALOG_URL: $CATALOG_URL | ||
CATALOG_REVISION: $CATALOG_REVISION | ||
GH_USER: $GH_USER | ||
secretEnv: | ||
type: secret | ||
values: | ||
PLUGIN_TOKEN: token | ||
GH_TOKEN: $GH_TOKEN | ||
image: | ||
repository: local-generator-test | ||
tag: latest | ||
EOF |