Add conditional wrapper to helm hook

The pre-install hooks for several of the keystone templates
cause upgrade failures when using helm2. This change wraps them
in a conditional that can be toggled off for anyone still
using helm2.

Change-Id: I179583bd595bc8ed1e4c29eb7c2a744e3c6a5708
This commit is contained in:
Gage Hugo 2021-04-08 16:41:24 -05:00
parent 46f4343f19
commit 0f6f83dcdc
7 changed files with 14 additions and 1 deletions

View File

@ -14,7 +14,7 @@ apiVersion: v1
appVersion: v1.0.0 appVersion: v1.0.0
description: OpenStack-Helm Keystone description: OpenStack-Helm Keystone
name: keystone name: keystone
version: 0.1.11 version: 0.1.12
home: https://docs.openstack.org/keystone/latest/ home: https://docs.openstack.org/keystone/latest/
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Keystone/OpenStack_Project_Keystone_vertical.png icon: https://www.openstack.org/themes/openstack/images/project-mascots/Keystone/OpenStack_Project_Keystone_vertical.png
sources: sources:

View File

@ -54,9 +54,11 @@ kind: Job
metadata: metadata:
name: keystone-credential-setup name: keystone-credential-setup
annotations: annotations:
{{- 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"
"helm.sh/hook-delete-policy": before-hook-creation "helm.sh/hook-delete-policy": before-hook-creation
{{- end }}
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
spec: spec:
template: template:

View File

@ -54,10 +54,12 @@ apiVersion: batch/v1
kind: Job kind: Job
metadata: metadata:
name: keystone-fernet-setup name: keystone-fernet-setup
{{- if .Values.helm3_hook }}
annotations: annotations:
"helm.sh/hook": post-install,post-upgrade "helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-weight": "-5" "helm.sh/hook-weight": "-5"
"helm.sh/hook-delete-policy": before-hook-creation "helm.sh/hook-delete-policy": before-hook-creation
{{- end }}
spec: spec:
template: template:
metadata: metadata:

View File

@ -19,8 +19,10 @@ apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:
name: keystone-credential-keys name: keystone-credential-keys
{{- if .Values.helm3_hook }}
annotations: annotations:
"helm.sh/hook": pre-install "helm.sh/hook": pre-install
{{- end }}
type: Opaque type: Opaque
data: data:
{{- end }} {{- end }}

View File

@ -20,8 +20,10 @@ apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:
name: keystone-fernet-keys name: keystone-fernet-keys
{{- if .Values.helm3_hook }}
annotations: annotations:
"helm.sh/hook": pre-install "helm.sh/hook": pre-install
{{- end }}
type: Opaque type: Opaque
data: data:
{{- end }} {{- end }}

View File

@ -29,6 +29,10 @@ labels:
release_group: null release_group: null
# NOTE(gagehugo): 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

View File

@ -12,4 +12,5 @@ keystone:
- 0.1.9 Add helm.sh/hook related annotations - 0.1.9 Add helm.sh/hook related annotations
- 0.1.10 Update RBAC apiVersion from /v1beta1 to /v1 - 0.1.10 Update RBAC apiVersion from /v1beta1 to /v1
- 0.1.11 Remove congress residue - 0.1.11 Remove congress residue
- 0.1.12 Add helm hook conditional
... ...