openstack-armada-app/openstack-helm/debian/deb_folder/patches/0020-Fixing-nova-helm-release-hooks-and-weights.patch
Thales Elero Cervi e60e80155a OSH Patch: Fixing nova helm release hooks
The relation of dependency for nova resources is not working
with helmv3 since several jobs have post-install hooks and are
dependencies of other jobs that have no hooks.

The jobs without hooks are deployed during an installation phase
that is never complete since the dependency jobs are hooked to be
deployed on post-install phase.

This change includes helm-hooks for the boostrap and cell-setup jobs.
The weights will define the order each one will be deployed.

Test Plan:
PASS - build-helm-charts.sh builds a basic FluxCD app tarball
PASS - application upload and overrides generated
PASS - application apply/remove/delete

Closes-Bug: 1990536

Signed-off-by: Thales Elero Cervi <thaleselero.cervi@windriver.com>
Change-Id: Ic3833d2f87d9a1502b1a3de2780ba76774d2fa8e
2022-09-26 19:51:23 -03:00

58 lines
2.0 KiB
Diff

From 63ffa8ad9c1e212383190aa4a21bd5999a233b12 Mon Sep 17 00:00:00 2001
From: Thales Elero Cervi <thaleselero.cervi@windriver.com>
Date: Wed, 21 Sep 2022 16:43:01 -0300
Subject: [PATCH] Fixing nova helm release hooks and weights
The relation of dependency for nova resources is not working
with helmv3 since several jobs have post-install hooks and are
dependencies of other jobs that have no hooks.
The jobs without hooks are deployed during an installation phase
that is never complete since the dependency jobs are hooked to be
deployed on post-install phase.
This change includes helm-hooks for the boostrap and cell-setup jobs.
The weights will define the order each one will be deployed.
Signed-off-by: Thales Elero Cervi <thaleselero.cervi@windriver.com>
Change-Id: I924302b6fd41d4fe6fe7bae5577de7d6d590abb2
---
nova/templates/job-bootstrap.yaml | 5 +++++
nova/templates/job-cell-setup.yaml | 4 ++++
2 files changed, 9 insertions(+)
diff --git a/nova/templates/job-bootstrap.yaml b/nova/templates/job-bootstrap.yaml
index 1229acec..f719cb5c 100644
--- a/nova/templates/job-bootstrap.yaml
+++ b/nova/templates/job-bootstrap.yaml
@@ -30,6 +30,11 @@ metadata:
name: {{ $serviceAccountName | quote }}
labels:
application: {{ $serviceAccountName | quote }}
+ annotations:
+{{- if .Values.helm3_hook }}
+ helm.sh/hook: post-install,post-upgrade
+ helm.sh/hook-weight: "2"
+{{- end }}
spec:
template:
metadata:
diff --git a/nova/templates/job-cell-setup.yaml b/nova/templates/job-cell-setup.yaml
index 6fd8bca4..0fe686b6 100644
--- a/nova/templates/job-cell-setup.yaml
+++ b/nova/templates/job-cell-setup.yaml
@@ -25,6 +25,10 @@ metadata:
labels:
{{ tuple $envAll "nova" "cell-setup" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
annotations:
+{{- if .Values.helm3_hook }}
+ helm.sh/hook: post-install,post-upgrade
+ helm.sh/hook-weight: "1"
+{{- end }}
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
spec:
template:
--
2.25.1