From f6ed763a6a05b73a6bbc063f5ceeb40e9e1f7e8a Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Fri, 22 Mar 2019 12:34:38 -0500 Subject: [PATCH] RabbitMQ: fix dependency checks for tests and wait job This PS fixes the dependency checks tor the tests and wait job. Change-Id: I09301083bfc2d0218298a8c5e0dd4957bef11c42 Signed-off-by: Pete Birley --- rabbitmq/templates/job-cluster-wait.yaml | 2 +- rabbitmq/templates/pod-test.yaml | 6 ++++++ rabbitmq/values.yaml | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/rabbitmq/templates/job-cluster-wait.yaml b/rabbitmq/templates/job-cluster-wait.yaml index a29bde26e..fe91b2d68 100644 --- a/rabbitmq/templates/job-cluster-wait.yaml +++ b/rabbitmq/templates/job-cluster-wait.yaml @@ -39,7 +39,7 @@ spec: nodeSelector: {{ $envAll.Values.labels.jobs.node_selector_key }}: {{ $envAll.Values.labels.test.node_selector_value | quote }} initContainers: -{{ tuple $envAll "tests" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} +{{ tuple $envAll "cluster_wait" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} containers: - name: {{.Release.Name}}-rabbitmq-cluster-wait {{ tuple $envAll "scripted_test" | include "helm-toolkit.snippets.image" | indent 10 }} diff --git a/rabbitmq/templates/pod-test.yaml b/rabbitmq/templates/pod-test.yaml index cc4bddcbb..ff45368fd 100644 --- a/rabbitmq/templates/pod-test.yaml +++ b/rabbitmq/templates/pod-test.yaml @@ -17,6 +17,12 @@ limitations under the License. {{- if .Values.manifests.pod_test }} {{- $envAll := . }} +{{ if kindIs "string" $envAll.Values.dependencies.static.tests.jobs }} +{{ if eq $envAll.Values.dependencies.static.tests.jobs "cluster_wait" }} +{{ $_ := set $envAll.Values.dependencies.static.tests "jobs" ( list ( print $envAll.Release.Name "-cluster-wait" ) ) }} +{{ end }} +{{ end }} + {{- $serviceAccountName := print .Release.Name "-test" }} {{ tuple $envAll "tests" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} --- diff --git a/rabbitmq/values.yaml b/rabbitmq/values.yaml index 83be120ed..bdc730ab0 100644 --- a/rabbitmq/values.yaml +++ b/rabbitmq/values.yaml @@ -155,6 +155,10 @@ dependencies: services: - endpoint: internal service: oslo_messaging + # NOTE (portdirect): this key is somewhat special, if set to the string + # `cluster_wait` then the job dep will be populated with a single value + # containing the generated name for the `cluster_wait` job name. + jobs: cluster_wait cluster_wait: services: - endpoint: internal