build: helm template to set init job annotations (#23941)
Co-authored-by: Yitzchak Weiser <yweiser@redseal.net>
diff --git a/helm/superset/Chart.yaml b/helm/superset/Chart.yaml
index 61bac4e..c82802a 100644
--- a/helm/superset/Chart.yaml
+++ b/helm/superset/Chart.yaml
@@ -29,7 +29,7 @@
- name: craig-rueda
email: craig@craigrueda.com
url: https://github.com/craig-rueda
-version: 0.9.4
+version: 0.10.0
dependencies:
- name: postgresql
version: 12.1.6
diff --git a/helm/superset/README.md b/helm/superset/README.md
index 1df7023..a80ea62 100644
--- a/helm/superset/README.md
+++ b/helm/superset/README.md
@@ -23,7 +23,7 @@
# superset
-![Version: 0.9.4](https://img.shields.io/badge/Version-0.9.4-informational?style=flat-square)
+![Version: 0.10.0](https://img.shields.io/badge/Version-0.10.0-informational?style=flat-square)
Apache Superset is a modern, enterprise-ready business intelligence web application
@@ -91,9 +91,10 @@
| init.containerSecurityContext | object | `{}` | |
| init.createAdmin | bool | `true` | |
| init.enabled | bool | `true` | |
-| init.helmHook | bool | `true` | |
| init.initContainers | list | a container waiting for postgres | List of initContainers |
| init.initscript | string | a script to create admin user and initailize roles | A Superset init script |
+| init.jobAnnotations."helm.sh/hook" | string | `"post-install,post-upgrade"` | |
+| init.jobAnnotations."helm.sh/hook-delete-policy" | string | `"before-hook-creation"` | |
| init.loadExamples | bool | `false` | |
| init.podAnnotations | object | `{}` | |
| init.podSecurityContext | object | `{}` | |
diff --git a/helm/superset/templates/init-job.yaml b/helm/superset/templates/init-job.yaml
index 16d452f..0a8c4533 100644
--- a/helm/superset/templates/init-job.yaml
+++ b/helm/superset/templates/init-job.yaml
@@ -23,10 +23,8 @@
metadata:
name: {{ template "superset.name" . }}-init-db
namespace: {{ .Release.Namespace }}
- {{- if .Values.init.helmHook }}
- annotations:
- "helm.sh/hook": post-install,post-upgrade
- "helm.sh/hook-delete-policy": "before-hook-creation"
+ {{- if .Values.init.jobAnnotations }}
+ annotations: {{- toYaml .Values.init.jobAnnotations | nindent 4 }}
{{- end }}
spec:
template:
diff --git a/helm/superset/values.yaml b/helm/superset/values.yaml
index de8bc93..d7ff323 100644
--- a/helm/superset/values.yaml
+++ b/helm/superset/values.yaml
@@ -632,7 +632,9 @@
- "-c"
- ". {{ .Values.configMountPath }}/superset_bootstrap.sh; . {{ .Values.configMountPath }}/superset_init.sh"
enabled: true
- helmHook: true
+ jobAnnotations:
+ "helm.sh/hook": post-install,post-upgrade
+ "helm.sh/hook-delete-policy": "before-hook-creation"
loadExamples: false
createAdmin: true
adminUser: