From a454a7cb297ff27bd31b18d31c9060156764fd27 Mon Sep 17 00:00:00 2001 From: okozachenko Date: Thu, 3 Feb 2022 19:05:42 +1100 Subject: [PATCH] Tempest: Add helm hook for jobs Change-Id: Id2fa3fa81b50a5495003fe30e7859e1475f08843 --- releasenotes/notes/tempest.yaml | 1 + tempest/Chart.yaml | 2 +- tempest/templates/job-ks-user.yaml | 9 +++++++++ tempest/templates/job-run-tests.yaml | 1 + tempest/values.yaml | 2 ++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/releasenotes/notes/tempest.yaml b/releasenotes/notes/tempest.yaml index 719abec1eb..420d06dfd1 100644 --- a/releasenotes/notes/tempest.yaml +++ b/releasenotes/notes/tempest.yaml @@ -4,4 +4,5 @@ tempest: - 0.1.1 Change helm-toolkit dependency version to ">= 0.1.0" - 0.2.0 Remove support for releases before T - 0.2.1 Update htk requirements repo + - 0.2.2 Add helm hook for ks job ... diff --git a/tempest/Chart.yaml b/tempest/Chart.yaml index 7eb1e7e176..0dcdd016f2 100644 --- a/tempest/Chart.yaml +++ b/tempest/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Tempest name: tempest -version: 0.2.1 +version: 0.2.2 home: https://docs.openstack.org/tempest/latest/ icon: https://www.openstack.org/themes/openstack/images/project-mascots/tempest/OpenStack_Project_tempest_vertical.png sources: diff --git a/tempest/templates/job-ks-user.yaml b/tempest/templates/job-ks-user.yaml index 03b2da267a..ae8f774997 100644 --- a/tempest/templates/job-ks-user.yaml +++ b/tempest/templates/job-ks-user.yaml @@ -12,7 +12,16 @@ See the License for the specific language governing permissions and limitations under the License. */}} +{{- define "metadata.annotations.job.ks_user" }} +helm.sh/hook: post-install,post-upgrade +helm.sh/hook-weight: "-1" +{{- end }} + {{- if .Values.manifests.job_ks_user }} {{- $ksUserJob := dict "envAll" . "serviceName" "tempest" -}} + +{{- if .Values.helm3_hook }} +{{- $_ := set $ksUserJob "jobAnnotations" (include "metadata.annotations.job.ks_user" . | fromYaml) -}} +{{- end }} {{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }} {{- end }} diff --git a/tempest/templates/job-run-tests.yaml b/tempest/templates/job-run-tests.yaml index 36492ad974..abacad1325 100644 --- a/tempest/templates/job-run-tests.yaml +++ b/tempest/templates/job-run-tests.yaml @@ -25,6 +25,7 @@ metadata: name: {{ .Release.Name }}-run-tests annotations: {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} + helm.sh/hook: post-install,post-upgrade spec: backoffLimit: {{ .Values.jobs.run_tests.backoffLimit }} template: diff --git a/tempest/values.yaml b/tempest/values.yaml index 80ecb2b5f0..cc0f1b9010 100644 --- a/tempest/values.yaml +++ b/tempest/values.yaml @@ -93,6 +93,8 @@ dependencies: - endpoint: internal service: local_image_registry +helm3_hook: true + conf: script: | tempest run --config-file /etc/tempest/tempest.conf -w 4 --smoke