Making stx_admin (osh) helm v3 compatible

The patch added by this change will make the stx_admin job
syntax compatible with FluxCD (helmv3). It is necessary to add
a hook-weight annotation to the resource to guarantee that all
required resources will be up and running by the time of the
job creation.

Test Plan:
PASS - build-helm-charts.sh builds a basic FluxCD and a complete Armada
       app tarball
PASS - application upload and overrides generated
PASS - application apply and check if the new hooks takes place
PASS - application remove/delete

Closes-Bug: 1990188

Signed-off-by: Rafael Falcao <rafael.vieirafalcao@windriver.com>
Change-Id: I83137f54eb18ba01b880e093a77b987283e5d907
This commit is contained in:
Rafael Falcão 2022-09-19 16:27:41 -03:00
parent 5cc0eb415a
commit f13d94693f
2 changed files with 28 additions and 14 deletions

View File

@ -5,23 +5,25 @@ Subject: [PATCH] Add stx_admin account for host to communicate with openstack
app
lcavalca: changed content to support tls keystone
rvieiraf: added helm.sh/hook* annotations
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
Signed-off-by: Lucas Cavalcante <lucasmedeiros.cavalcante@windriver.com>
Signed-off-by: Rafael Falcao <rafael.vieirafalcao@windriver.com>
Change-Id: Iedcd131578f4e33efd3c3d7c47cbef83331b143a
---
keystone/templates/job-ks-user.yaml | 21 +++++++++++++++++++++
keystone/templates/job-ks-user.yaml | 29 +++++++++++++++++++++++++
keystone/templates/secret-keystone.yaml | 2 +-
keystone/values.yaml | 17 +++++++++++++++++
3 files changed, 39 insertions(+), 1 deletion(-)
keystone/values.yaml | 17 +++++++++++++++
3 files changed, 47 insertions(+), 1 deletion(-)
create mode 100644 keystone/templates/job-ks-user.yaml
diff --git a/keystone/templates/job-ks-user.yaml b/keystone/templates/job-ks-user.yaml
new file mode 100644
index 00000000..91f990f3
index 00000000..63d6cbb5
--- /dev/null
+++ b/keystone/templates/job-ks-user.yaml
@@ -0,0 +1,24 @@
@@ -0,0 +1,29 @@
+{{/*
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
@ -36,8 +38,13 @@ index 00000000..91f990f3
+limitations under the License.
+*/}}
+
+{{- define "metadata.annotations.job.ks_user" }}
+helm.sh/hook: post-install,post-upgrade
+helm.sh/hook-weight: "5"
+{{- end }}
+
+{{- if .Values.manifests.job_ks_user }}
+{{- $ksUserJob := dict "envAll" . "serviceName" "keystone" "serviceUser" "stx_admin" -}}
+{{- $ksUserJob := dict "envAll" . "serviceName" "keystone" "serviceUser" "stx_admin" "jobAnnotations" (include "metadata.annotations.job.ks_user" . | fromYaml) -}}
+{{- if .Values.manifests.certificates -}}
+{{- $_ := set $ksUserJob "tlsSecret" .Values.secrets.tls.identity.api.internal -}}
+{{- end -}}
@ -109,5 +116,5 @@ index 5f0e7aa1..ff4493f3 100644
pdb_api: true
pod_rally_test: true
--
2.17.1
2.25.1

View File

@ -5,23 +5,25 @@ Subject: [PATCH] Add stx_admin account for host to communicate with openstack
app
lcavalca: changed content to support tls keystone
rvieiraf: added helm.sh/hook* annotations
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
Signed-off-by: Lucas Cavalcante <lucasmedeiros.cavalcante@windriver.com>
Signed-off-by: Rafael Falcao <rafael.vieirafalcao@windriver.com>
Change-Id: Iedcd131578f4e33efd3c3d7c47cbef83331b143a
---
keystone/templates/job-ks-user.yaml | 21 +++++++++++++++++++++
keystone/templates/job-ks-user.yaml | 29 +++++++++++++++++++++++++
keystone/templates/secret-keystone.yaml | 2 +-
keystone/values.yaml | 17 +++++++++++++++++
3 files changed, 39 insertions(+), 1 deletion(-)
keystone/values.yaml | 17 +++++++++++++++
3 files changed, 47 insertions(+), 1 deletion(-)
create mode 100644 keystone/templates/job-ks-user.yaml
diff --git a/keystone/templates/job-ks-user.yaml b/keystone/templates/job-ks-user.yaml
new file mode 100644
index 00000000..91f990f3
index 00000000..63d6cbb5
--- /dev/null
+++ b/keystone/templates/job-ks-user.yaml
@@ -0,0 +1,24 @@
@@ -0,0 +1,29 @@
+{{/*
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
@ -36,8 +38,13 @@ index 00000000..91f990f3
+limitations under the License.
+*/}}
+
+{{- define "metadata.annotations.job.ks_user" }}
+helm.sh/hook: post-install,post-upgrade
+helm.sh/hook-weight: "5"
+{{- end }}
+
+{{- if .Values.manifests.job_ks_user }}
+{{- $ksUserJob := dict "envAll" . "serviceName" "keystone" "serviceUser" "stx_admin" -}}
+{{- $ksUserJob := dict "envAll" . "serviceName" "keystone" "serviceUser" "stx_admin" "jobAnnotations" (include "metadata.annotations.job.ks_user" . | fromYaml) -}}
+{{- if .Values.manifests.certificates -}}
+{{- $_ := set $ksUserJob "tlsSecret" .Values.secrets.tls.identity.api.public -}}
+{{- end -}}
@ -109,5 +116,5 @@ index 5f0e7aa1..ff4493f3 100644
pdb_api: true
pod_rally_test: true
--
2.17.1
2.25.1