Conditional data to help secret overwrite (#99)

This addresses an issue where repeatedly applying the same Helm chart
will cause the existing data in the secret argocd-secret. This helps with
issue (#99) but will still impact data if any of the three webhook
configs are provided.
This commit is contained in:
seanson@users.noreply.github.com 2019-09-06 12:33:09 +10:00
parent 87c5c1a5a4
commit cd6bf14b23
No known key found for this signature in database
GPG key ID: 356A1B69190BEB01

View file

@ -2,14 +2,16 @@ apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:
name: argocd-secret name: argocd-secret
labels: labels:
app.kubernetes.io/name: {{ include "argo-cd.name" . }} app.kubernetes.io/name: {{ include "argo-cd.name" . }}
helm.sh/chart: {{ include "argo-cd.chart" . }} helm.sh/chart: {{ include "argo-cd.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: {{ include "argo-cd.name" . }} app.kubernetes.io/part-of: {{ include "argo-cd.name" . }}
type: Opaque type: Opaque
data: {{- if or .Values.config.webhook.githubSecret (or .Values.config.webhook.gitlabSecret .Values.config.webhook.bitbucketSecret) }}
Setting a blank data again will wipe admin password/key/cert
data:
{{- if .Values.config.webhook.githubSecret }} {{- if .Values.config.webhook.githubSecret }}
github.webhook.secret: {{ .Values.config.webhook.githubSecret }} github.webhook.secret: {{ .Values.config.webhook.githubSecret }}
{{- end }} {{- end }}
@ -18,4 +20,5 @@ data:
{{- end }} {{- end }}
{{- if .Values.config.webhook.bitbucketSecret }} {{- if .Values.config.webhook.bitbucketSecret }}
bitbucket.webhook.uuid: {{ .Values.config.webhook.bitbucketSecret }} bitbucket.webhook.uuid: {{ .Values.config.webhook.bitbucketSecret }}
{{- end }} {{- end }}
{{- end}}