Open lucasfcnunes opened 1 year ago
Would setting the uuids as chart values fix the issue?
Related discussion bits here: https://stackoverflow.com/questions/66143201/reuse-uuid-in-helm-charts
Would setting the uuids as chart values fix the issue?
Related discussion bits here: https://stackoverflow.com/questions/66143201/reuse-uuid-in-helm-charts
Yes. It would. At the first apply the uuid would be generated. At the second time it would be regenerated if you didn't set a uuid on your values.
Is helm capable of doing this process automatically (without setting it at values level)?
@banzo
This pattern could work!
{{/* Define the secrets */}}
{{- define "kutt.secrets" -}}
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: kutt-secrets
{{- $kuttprevious := lookup "v1" "Secret" .Release.Namespace "kutt-secrets" }}
{{- $jwt_secret := "" }}
data:
{{- if $kuttprevious}}
JWT_SECRET: {{ index $kuttprevious.data "JWT_SECRET" }}
{{- else }}
{{- $jwt_secret := randAlphaNum 32 }}
JWT_SECRET: {{ $jwt_secret | b64enc }}
{{- end }}
{{- end -}}
I expected a stable apply/sync of the chart. The down side is that it creates lots of unnecessary revisions.
Diff (helmfile diff): Template (it's caused by
{{ default uuidv4 }}
not having a stable result):Thanks! https://github.com/cetic/helm-charts/issues/6