Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: more control on the migration job hook #138

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions charts/openfga/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ spec:
{{- with .Values.migrate.annotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- if .Values.migrate.hook.enable }}
helm.sh/hook: {{ .Values.migrate.hook.hook }}
helm.sh/hook-weight: {{ .Values.migrate.hook.hookWeight }}
helm.sh/hook-delete-policy: {{ .Values.migrate.hook.hookDeletePolicy }}
{{- end}}
{{- end }}
{{- with .Values.migrate.labels }}
labels:
Expand Down
25 changes: 25 additions & 0 deletions charts/openfga/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,31 @@
"description": "add additional sidecar containers to the migration job",
"default": []
},
"hook": {
"type": "object",
"properties": {
"enable": {
"type": "boolean",
"description": "Enable/disable the hook for the migration job",
"default": true
},
"hook": {
"type": "string",
"description": "Names of hook for the migration job, separated by a comma",
"default": "post-install, post-upgrade, post-rollback, post-delete"
},
"hookWeight": {
"type": "string",
"description": "Weight of Helm hook",
"default": "-5"
},
"hookDeletePolicy": {
"type": "string",
"description": "Delete policy of the Helm hook for the migration job",
"default": "before-hook-creation"
}
}
},
"annotations": {
"type": "object",
"description": "Map of annotations to add to the migration job's manifest",
Expand Down
10 changes: 6 additions & 4 deletions charts/openfga/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,11 @@ affinity: {}
sidecars: []
migrate:
sidecars: []
annotations:
helm.sh/hook: "post-install, post-upgrade, post-rollback, post-delete"
helm.sh/hook-weight: "-5"
helm.sh/hook-delete-policy: "before-hook-creation"
hook:
enable: true
hook: "post-install, post-upgrade, post-rollback, post-delete"
hookWeight: "-5"
hookDeletePolicy: "before-hook-creation"
annotations: {}
labels: {}
timeout: