Skip to content

Commit

Permalink
Add conditional support for annotation and optional existing keystore…
Browse files Browse the repository at this point in the history
… secret reference
  • Loading branch information
Angelo Sleebos committed Sep 17, 2024
1 parent 0da38ed commit 19d4c2d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion charts/gxf/templates/certificate-keystore-secret.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{{- if .Values.generateSecret -}}
apiVersion: v1
kind: Secret
kind: Secret
metadata:
name: {{ .Release.Name }}-keystore-password
annotations:
{{- if .Values.sealedSecretsManaged }}
sealedsecrets.bitnami.com/managed: "true"
{{- end }}
type: Opaque
data:
keystore-password: {{ $secret := lookup "v1" "Secret" .Release.Namespace (printf "%s-keystore-password" .Release.Name) }}
Expand All @@ -12,3 +15,4 @@ data:
{{- else -}}
{{- randAlphaNum 32 | b64enc | quote -}}
{{- end -}}
{{- end }}
2 changes: 1 addition & 1 deletion charts/gxf/templates/certificate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
pkcs12:
create: true
passwordSecretRef:
name: {{ $.Release.Name }}-keystore-password
name: {{ $.Values.keystoreSecretName | default (printf "%s-keystore-password" $.Release.Name) }}
key: keystore-password
---
{{- end }}
3 changes: 3 additions & 0 deletions charts/gxf/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,6 @@ certificates: []
# commonName: example.com
# dnsNames:
# - example.com
generateSecret: true # Set to true if you want to generate a new secret

Check failure on line 117 in charts/gxf/values.yaml

View workflow job for this annotation

GitHub Actions / lint-chart

[comments] too few spaces before comment

Check failure on line 117 in charts/gxf/values.yaml

View workflow job for this annotation

GitHub Actions / lint-chart

[trailing-spaces] trailing spaces
sealedSecretsManaged: false # Set to false if the annotation should not be added

Check failure on line 118 in charts/gxf/values.yaml

View workflow job for this annotation

GitHub Actions / lint-chart

[comments] too few spaces before comment

Check failure on line 118 in charts/gxf/values.yaml

View workflow job for this annotation

GitHub Actions / lint-chart

[trailing-spaces] trailing spaces
keystoreSecretName: ""

0 comments on commit 19d4c2d

Please sign in to comment.