Barbican: Add conditional wrapper to helm hook
The pre-install hooks for several of the barbican templates [0] cause upgrade failures when using helm2. Similar to what was done for keystone [1], this change wraps them in a conditional that can be toggled off for anyone still using helm2. 0: https://review.opendev.org/c/openstack/openstack-helm/+/782710 1: https://review.opendev.org/c/openstack/openstack-helm/+/785517 Change-Id: I6a160916ec65d73eef1aaffb510c85ee7fb0d501
This commit is contained in:
parent
87011eb8d7
commit
43f24adf57
@ -14,7 +14,7 @@ apiVersion: v1
|
|||||||
appVersion: v1.0.0
|
appVersion: v1.0.0
|
||||||
description: OpenStack-Helm Barbican
|
description: OpenStack-Helm Barbican
|
||||||
name: barbican
|
name: barbican
|
||||||
version: 0.2.1
|
version: 0.2.2
|
||||||
home: https://docs.openstack.org/barbican/latest/
|
home: https://docs.openstack.org/barbican/latest/
|
||||||
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Barbican/OpenStack_Project_Barbican_vertical.png
|
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Barbican/OpenStack_Project_Barbican_vertical.png
|
||||||
sources:
|
sources:
|
||||||
|
@ -13,9 +13,11 @@ limitations under the License.
|
|||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
{{- define "metadata.annotations.job.bootstrap" }}
|
{{- define "metadata.annotations.job.bootstrap" }}
|
||||||
|
{{- if .Values.helm3_hook }}
|
||||||
helm.sh/hook: post-install,post-upgrade
|
helm.sh/hook: post-install,post-upgrade
|
||||||
helm.sh/hook-weight: "5"
|
helm.sh/hook-weight: "5"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if and .Values.manifests.job_bootstrap .Values.bootstrap.enabled }}
|
{{- if and .Values.manifests.job_bootstrap .Values.bootstrap.enabled }}
|
||||||
{{- $bootstrapJob := dict "envAll" . "serviceName" "barbican" "keystoneUser" .Values.bootstrap.ks_user "logConfigFile" .Values.conf.barbican.DEFAULT.log_config_append "jobAnnotations" (include "metadata.annotations.job.bootstrap" . | fromYaml) -}}
|
{{- $bootstrapJob := dict "envAll" . "serviceName" "barbican" "keystoneUser" .Values.bootstrap.ks_user "logConfigFile" .Values.conf.barbican.DEFAULT.log_config_append "jobAnnotations" (include "metadata.annotations.job.bootstrap" . | fromYaml) -}}
|
||||||
|
@ -13,9 +13,11 @@ limitations under the License.
|
|||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
{{- define "metadata.annotations.job.db_init" }}
|
{{- define "metadata.annotations.job.db_init" }}
|
||||||
|
{{- if .Values.helm3_hook }}
|
||||||
helm.sh/hook: post-install,post-upgrade
|
helm.sh/hook: post-install,post-upgrade
|
||||||
helm.sh/hook-weight: "-5"
|
helm.sh/hook-weight: "-5"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if .Values.manifests.job_db_init }}
|
{{- if .Values.manifests.job_db_init }}
|
||||||
{{- $serviceName := "barbican" -}}
|
{{- $serviceName := "barbican" -}}
|
||||||
|
@ -13,9 +13,11 @@ limitations under the License.
|
|||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
{{- define "metadata.annotations.job.db_sync" }}
|
{{- define "metadata.annotations.job.db_sync" }}
|
||||||
|
{{- if .Values.helm3_hook }}
|
||||||
helm.sh/hook: post-install,post-upgrade
|
helm.sh/hook: post-install,post-upgrade
|
||||||
helm.sh/hook-weight: "-4"
|
helm.sh/hook-weight: "-4"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if .Values.manifests.job_db_sync }}
|
{{- if .Values.manifests.job_db_sync }}
|
||||||
{{- $dbSyncJob := dict "envAll" . "serviceName" "barbican" "podVolMounts" .Values.pod.mounts.barbican_db_sync.barbican_db_sync.volumeMounts "podVols" .Values.pod.mounts.barbican_db_sync.barbican_db_sync.volumes "jobAnnotations" (include "metadata.annotations.job.db_sync" . | fromYaml) -}}
|
{{- $dbSyncJob := dict "envAll" . "serviceName" "barbican" "podVolMounts" .Values.pod.mounts.barbican_db_sync.barbican_db_sync.volumeMounts "podVols" .Values.pod.mounts.barbican_db_sync.barbican_db_sync.volumes "jobAnnotations" (include "metadata.annotations.job.db_sync" . | fromYaml) -}}
|
||||||
|
@ -13,8 +13,10 @@ limitations under the License.
|
|||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
{{- define "metadata.annotations.job.repo_sync" }}
|
{{- define "metadata.annotations.job.repo_sync" }}
|
||||||
|
{{- if .Values.helm3_hook }}
|
||||||
helm.sh/hook: post-install,post-upgrade
|
helm.sh/hook: post-install,post-upgrade
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }}
|
{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }}
|
||||||
{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "barbican" "jobAnnotations" (include "metadata.annotations.job.repo_sync" . | fromYaml) -}}
|
{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "barbican" "jobAnnotations" (include "metadata.annotations.job.repo_sync" . | fromYaml) -}}
|
||||||
|
@ -13,9 +13,11 @@ limitations under the License.
|
|||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
{{- define "metadata.annotations.job.ks_endpoints" }}
|
{{- define "metadata.annotations.job.ks_endpoints" }}
|
||||||
|
{{- if .Values.helm3_hook }}
|
||||||
helm.sh/hook: post-install,post-upgrade
|
helm.sh/hook: post-install,post-upgrade
|
||||||
helm.sh/hook-weight: "-2"
|
helm.sh/hook-weight: "-2"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if .Values.manifests.job_ks_endpoints }}
|
{{- if .Values.manifests.job_ks_endpoints }}
|
||||||
{{- $ksServiceJob := dict "envAll" . "serviceName" "barbican" "serviceTypes" ( tuple "key-manager" ) "jobAnnotations" (include "metadata.annotations.job.ks_endpoints" . | fromYaml) -}}
|
{{- $ksServiceJob := dict "envAll" . "serviceName" "barbican" "serviceTypes" ( tuple "key-manager" ) "jobAnnotations" (include "metadata.annotations.job.ks_endpoints" . | fromYaml) -}}
|
||||||
|
@ -13,9 +13,11 @@ limitations under the License.
|
|||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
{{- define "metadata.annotations.job.ks_service" }}
|
{{- define "metadata.annotations.job.ks_service" }}
|
||||||
|
{{- if .Values.helm3_hook }}
|
||||||
helm.sh/hook: post-install,post-upgrade
|
helm.sh/hook: post-install,post-upgrade
|
||||||
helm.sh/hook-weight: "-3"
|
helm.sh/hook-weight: "-3"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if .Values.manifests.job_ks_service }}
|
{{- if .Values.manifests.job_ks_service }}
|
||||||
{{- $ksServiceJob := dict "envAll" . "serviceName" "barbican" "serviceTypes" ( tuple "key-manager" ) "jobAnnotations" (include "metadata.annotations.job.ks_service" . | fromYaml) -}}
|
{{- $ksServiceJob := dict "envAll" . "serviceName" "barbican" "serviceTypes" ( tuple "key-manager" ) "jobAnnotations" (include "metadata.annotations.job.ks_service" . | fromYaml) -}}
|
||||||
|
@ -13,9 +13,11 @@ limitations under the License.
|
|||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
{{- define "metadata.annotations.job.ks_user" }}
|
{{- define "metadata.annotations.job.ks_user" }}
|
||||||
|
{{- if .Values.helm3_hook }}
|
||||||
helm.sh/hook: post-install,post-upgrade
|
helm.sh/hook: post-install,post-upgrade
|
||||||
helm.sh/hook-weight: "-1"
|
helm.sh/hook-weight: "-1"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if .Values.manifests.job_ks_user }}
|
{{- if .Values.manifests.job_ks_user }}
|
||||||
{{- $ksUserJob := dict "envAll" . "serviceName" "barbican" "jobAnnotations" (include "metadata.annotations.job.ks_user" . | fromYaml) -}}
|
{{- $ksUserJob := dict "envAll" . "serviceName" "barbican" "jobAnnotations" (include "metadata.annotations.job.ks_user" . | fromYaml) -}}
|
||||||
|
@ -13,9 +13,11 @@ limitations under the License.
|
|||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
{{- define "metadata.annotations.job.rabbit_init" }}
|
{{- define "metadata.annotations.job.rabbit_init" }}
|
||||||
|
{{- if .Values.helm3_hook }}
|
||||||
helm.sh/hook: post-install,post-upgrade
|
helm.sh/hook: post-install,post-upgrade
|
||||||
helm.sh/hook-weight: "-4"
|
helm.sh/hook-weight: "-4"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{- if .Values.manifests.job_rabbit_init }}
|
{{- if .Values.manifests.job_rabbit_init }}
|
||||||
{{- $rmqUserJob := dict "envAll" . "serviceName" "barbican" "jobAnnotations" (include "metadata.annotations.job.rabbit_init" . | fromYaml) -}}
|
{{- $rmqUserJob := dict "envAll" . "serviceName" "barbican" "jobAnnotations" (include "metadata.annotations.job.rabbit_init" . | fromYaml) -}}
|
||||||
|
@ -29,6 +29,10 @@ labels:
|
|||||||
|
|
||||||
release_group: null
|
release_group: null
|
||||||
|
|
||||||
|
# NOTE(philsphicas): the pre-install hook breaks upgrade for helm2
|
||||||
|
# Set to false to upgrade using helm2
|
||||||
|
helm3_hook: true
|
||||||
|
|
||||||
images:
|
images:
|
||||||
tags:
|
tags:
|
||||||
bootstrap: docker.io/openstackhelm/heat:stein-ubuntu_bionic
|
bootstrap: docker.io/openstackhelm/heat:stein-ubuntu_bionic
|
||||||
|
@ -5,3 +5,4 @@ barbican:
|
|||||||
- 0.1.2 Added post-install and post-upgrade helm hook for Jobs
|
- 0.1.2 Added post-install and post-upgrade helm hook for Jobs
|
||||||
- 0.2.0 Remove support for releases before T
|
- 0.2.0 Remove support for releases before T
|
||||||
- 0.2.1 Use policies in yaml format
|
- 0.2.1 Use policies in yaml format
|
||||||
|
- 0.2.2 Add helm hook conditional
|
||||||
|
Loading…
Reference in New Issue
Block a user