openstack-helm/keystone/templates/job-db-init.yaml
Gage Hugo a3d26068ad Update helm hook conditionals
Updated the db job annotation hooks to be wrapped with
conditionals for helm v2 support.

Change-Id: I069fe3572b837714e263252646e56471c81745d5
2021-04-28 21:36:03 +00:00

29 lines
1.1 KiB
YAML

{{/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- define "metadata.annotations.job.db_init" }}
{{- if .Values.helm3_hook -}}
helm.sh/hook: post-install,post-upgrade
helm.sh/hook-weight: "-5"
{{- end -}}
{{- end }}
{{- if .Values.manifests.job_db_init }}
{{- $dbInitJob := dict "envAll" . "serviceName" "keystone" "jobAnnotations" (include "metadata.annotations.job.db_init" . | fromYaml) -}}
{{- if .Values.manifests.certificates -}}
{{- $_ := set $dbInitJob "dbAdminTlsSecret" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}}
{{- end -}}
{{ $dbInitJob | include "helm-toolkit.manifests.job_db_init_mysql" }}
{{- end }}