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
description: OpenStack-Helm Keystone
name: keystone
version: 0.1.11
version: 0.1.12
home: https://docs.openstack.org/keystone/latest/
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Keystone/OpenStack_Project_Keystone_vertical.png
sources:

View File

@ -54,9 +54,11 @@ kind: Job
metadata:
name: keystone-credential-setup
annotations:
{{- if .Values.helm3_hook }}
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-weight": "-5"
"helm.sh/hook-delete-policy": before-hook-creation
{{- end }}
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
spec:
template:

View File

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

View File

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

View File

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

View File

@ -29,6 +29,10 @@ labels:
release_group: null
# NOTE(gagehugo): the pre-install hook breaks upgrade for helm2
# Set to false to upgrade using helm2
helm3_hook: true
images:
tags:
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.10 Update RBAC apiVersion from /v1beta1 to /v1
- 0.1.11 Remove congress residue
- 0.1.12 Add helm hook conditional
...