diff --git a/mistral/Chart.yaml b/mistral/Chart.yaml index 75f4e47b4b..44f6cee9f8 100644 --- a/mistral/Chart.yaml +++ b/mistral/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Mistral name: mistral -version: 0.1.1 +version: 0.1.2 home: https://docs.openstack.org/mistral/latest/ icon: https://www.openstack.org/themes/openstack/images/project-mascots/Mistral/OpenStack_Project_Mistral_vertical.png sources: diff --git a/mistral/templates/job-bootstrap.yaml b/mistral/templates/job-bootstrap.yaml index d43071f1c3..faa89501a4 100644 --- a/mistral/templates/job-bootstrap.yaml +++ b/mistral/templates/job-bootstrap.yaml @@ -12,7 +12,12 @@ See the License for the specific language governing permissions and limitations under the License. */}} +{{- define "metadata.annotations.job.bootstrap" }} +helm.sh/hook: post-install,post-upgrade +helm.sh/hook-weight: "5" +{{- end }} + {{- if and .Values.manifests.job_bootstrap .Values.bootstrap.enabled }} -{{- $bootstrapJob := dict "envAll" . "serviceName" "mistral" "keystoneUser" .Values.bootstrap.ks_user "logConfigFile" .Values.conf.mistral.DEFAULT.log_config_append -}} +{{- $bootstrapJob := dict "envAll" . "serviceName" "mistral" "keystoneUser" .Values.bootstrap.ks_user "logConfigFile" .Values.conf.mistral.DEFAULT.log_config_append "jobAnnotations" (include "metadata.annotations.job.bootstrap" . | fromYaml) -}} {{ $bootstrapJob | include "helm-toolkit.manifests.job_bootstrap" }} {{- end }} diff --git a/mistral/templates/job-db-init.yaml b/mistral/templates/job-db-init.yaml index e0652bec49..e8524953b4 100644 --- a/mistral/templates/job-db-init.yaml +++ b/mistral/templates/job-db-init.yaml @@ -12,7 +12,12 @@ See the License for the specific language governing permissions and limitations under the License. */}} +{{- define "metadata.annotations.job.db_init" }} +helm.sh/hook: post-install,post-upgrade +helm.sh/hook-weight: "-5" +{{- end }} + {{- if .Values.manifests.job_db_init }} -{{- $dbInitJob := dict "envAll" . "serviceName" "mistral" -}} +{{- $dbInitJob := dict "envAll" . "serviceName" "mistral" "jobAnnotations" (include "metadata.annotations.job.db_init" . | fromYaml) -}} {{ $dbInitJob | include "helm-toolkit.manifests.job_db_init_mysql" }} {{- end }} diff --git a/mistral/templates/job-db-sync.yaml b/mistral/templates/job-db-sync.yaml index 8346624b10..d233b989ad 100644 --- a/mistral/templates/job-db-sync.yaml +++ b/mistral/templates/job-db-sync.yaml @@ -13,7 +13,12 @@ See the License for the specific language governing permissions and limitations under the License. */}} +{{- define "metadata.annotations.job.db_sync" }} +helm.sh/hook: post-install,post-upgrade +helm.sh/hook-weight: "-4" +{{- end }} + {{- if .Values.manifests.job_db_sync }} -{{- $dbSyncJob := dict "envAll" . "serviceName" "mistral" "podVolMounts" .Values.pod.mounts.mistral_db_sync.mistral_db_sync.volumeMounts "podVols" .Values.pod.mounts.mistral_db_sync.mistral_db_sync.volumes -}} +{{- $dbSyncJob := dict "envAll" . "serviceName" "mistral" "podVolMounts" .Values.pod.mounts.mistral_db_sync.mistral_db_sync.volumeMounts "podVols" .Values.pod.mounts.mistral_db_sync.mistral_db_sync.volumes "jobAnnotations" (include "metadata.annotations.job.db_sync" . | fromYaml) -}} {{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }} {{- end }} diff --git a/mistral/templates/job-image-repo-sync.yaml b/mistral/templates/job-image-repo-sync.yaml index 009a249ddf..686bbb4a19 100644 --- a/mistral/templates/job-image-repo-sync.yaml +++ b/mistral/templates/job-image-repo-sync.yaml @@ -12,7 +12,11 @@ See the License for the specific language governing permissions and limitations under the License. */}} +{{- define "metadata.annotations.job.repo_sync" }} +helm.sh/hook: post-install,post-upgrade +{{- end }} + {{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }} -{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "mistral" -}} +{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "mistral" "jobAnnotations" (include "metadata.annotations.job.repo_sync" . | fromYaml) -}} {{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }} {{- end }} diff --git a/mistral/templates/job-ks-endpoints.yaml b/mistral/templates/job-ks-endpoints.yaml index 7956c36464..27b0fa9298 100644 --- a/mistral/templates/job-ks-endpoints.yaml +++ b/mistral/templates/job-ks-endpoints.yaml @@ -12,7 +12,12 @@ See the License for the specific language governing permissions and limitations under the License. */}} +{{- define "metadata.annotations.job.ks_endpoints" }} +helm.sh/hook: post-install,post-upgrade +helm.sh/hook-weight: "-2" +{{- end }} + {{- if .Values.manifests.job_ks_endpoints }} -{{- $ksServiceJob := dict "envAll" . "serviceName" "mistral" "serviceTypes" ( tuple "workflowv2" ) -}} +{{- $ksServiceJob := dict "envAll" . "serviceName" "mistral" "serviceTypes" ( tuple "workflowv2" ) "jobAnnotations" (include "metadata.annotations.job.ks_endpoints" . | fromYaml) -}} {{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_endpoints" }} {{- end }} diff --git a/mistral/templates/job-ks-service.yaml b/mistral/templates/job-ks-service.yaml index ad7f54d812..11d6c8807d 100644 --- a/mistral/templates/job-ks-service.yaml +++ b/mistral/templates/job-ks-service.yaml @@ -12,7 +12,12 @@ See the License for the specific language governing permissions and limitations under the License. */}} +{{- define "metadata.annotations.job.ks_service" }} +helm.sh/hook: post-install,post-upgrade +helm.sh/hook-weight: "-3" +{{- end }} + {{- if .Values.manifests.job_ks_service }} -{{- $ksServiceJob := dict "envAll" . "serviceName" "mistral" "serviceTypes" ( tuple "workflowv2" ) -}} +{{- $ksServiceJob := dict "envAll" . "serviceName" "mistral" "serviceTypes" ( tuple "workflowv2" ) "jobAnnotations" (include "metadata.annotations.job.ks_service" . | fromYaml) -}} {{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_service" }} {{- end }} diff --git a/mistral/templates/job-ks-user.yaml b/mistral/templates/job-ks-user.yaml index ba616a72bc..ad21a46371 100644 --- a/mistral/templates/job-ks-user.yaml +++ b/mistral/templates/job-ks-user.yaml @@ -12,7 +12,12 @@ See the License for the specific language governing permissions and limitations under the License. */}} +{{- define "metadata.annotations.job.ks_user" }} +helm.sh/hook: post-install,post-upgrade +helm.sh/hook-weight: "-1" +{{- end }} + {{- if .Values.manifests.job_ks_user }} -{{- $ksUserJob := dict "envAll" . "serviceName" "mistral" -}} +{{- $ksUserJob := dict "envAll" . "serviceName" "mistral" "jobAnnotations" (include "metadata.annotations.job.ks_user" . | fromYaml) -}} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{- end }} diff --git a/mistral/templates/job-rabbit-init.yaml b/mistral/templates/job-rabbit-init.yaml index 4ce7c62855..b39188dfc8 100644 --- a/mistral/templates/job-rabbit-init.yaml +++ b/mistral/templates/job-rabbit-init.yaml @@ -12,7 +12,12 @@ See the License for the specific language governing permissions and limitations under the License. */}} +{{- define "metadata.annotations.job.rabbit_init" }} +helm.sh/hook: post-install,post-upgrade +helm.sh/hook-weight: "-4" +{{- end }} + {{- if .Values.manifests.job_rabbit_init }} -{{- $rmqUserJob := dict "envAll" . "serviceName" "mistral" -}} +{{- $rmqUserJob := dict "envAll" . "serviceName" "mistral" "jobAnnotations" (include "metadata.annotations.job.rabbit_init" . | fromYaml) -}} {{ $rmqUserJob | include "helm-toolkit.manifests.job_rabbit_init" }} {{- end }} diff --git a/releasenotes/notes/mistral.yaml b/releasenotes/notes/mistral.yaml index 8e2d4ba860..4579f8f6bd 100644 --- a/releasenotes/notes/mistral.yaml +++ b/releasenotes/notes/mistral.yaml @@ -2,3 +2,4 @@ mistral: - 0.1.0 Initial Chart - 0.1.1 Change helm-toolkit dependency version to ">= 0.1.0" + - 0.1.2 Added post-install and post-upgrade hook for Jobs