Skip to content

Commit

Permalink
Run migrate job as pre hook with option to auto cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalsaha committed Jun 25, 2024
1 parent eed5562 commit 1fe1b66
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/openfga/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: openfga
description: A Kubernetes Helm chart for the OpenFGA project.

type: application
version: 0.2.6
version: 0.2.7
appVersion: "v1.5.4"

home: "https://openfga.github.io/helm-charts"
Expand Down
5 changes: 4 additions & 1 deletion charts/openfga/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
backoffLimit: 3
{{- if ge .Values.migrate.ttlSecondsAfterFinished 0 }}
ttlSecondsAfterFinished: {{ .Values.migrate.ttlSecondsAfterFinished }}
{{- end }}
template:
metadata:
{{- with .Values.migrate.annotations }}
Expand Down Expand Up @@ -79,5 +83,4 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
backoffLimit: 1
{{- end }}
5 changes: 4 additions & 1 deletion charts/openfga/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,12 @@ affinity: {}
sidecars: []
migrate:
sidecars: []
# https://github.com/fluxcd/flux2/discussions/1085#discussioncomment-473271
# https://github.com/helm/helm/issues/9027#issuecomment-1908032461
annotations:
helm.sh/hook: "post-install, post-upgrade, post-rollback, post-delete"
helm.sh/hook: "pre-install, pre-upgrade, pre-rollback, pre-delete"
helm.sh/hook-weight: "-5"
helm.sh/hook-delete-policy: "before-hook-creation"
labels: {}
timeout:
ttlSecondsAfterFinished: -1

0 comments on commit 1fe1b66

Please sign in to comment.