From dff78de5841e415e7a91b618600655aad9bd25b3 Mon Sep 17 00:00:00 2001 From: Jade Carino Date: Wed, 19 Jun 2024 10:32:20 +0100 Subject: [PATCH] Must be called event-streams-token as if statements not supported in the context Signed-off-by: Jade Carino --- charts/ecosystem/templates/api.yaml | 2 +- charts/ecosystem/templates/engine-controller.yaml | 2 +- charts/ecosystem/templates/event-streams-secret.yaml | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/charts/ecosystem/templates/api.yaml b/charts/ecosystem/templates/api.yaml index be98391..1ef7aee 100644 --- a/charts/ecosystem/templates/api.yaml +++ b/charts/ecosystem/templates/api.yaml @@ -132,7 +132,7 @@ spec: - name: GALASA_EVENT_STREAMS_TOKEN valueFrom: secretKeyRef: - name: {{- if .Values.eventStreamsSecretName }}{{ .Values.eventStreamsSecretName }}{{- else }}{{ .Release.Name }}-event-streams-token{{- end }} + name: event-streams-token key: GALASA_EVENT_STREAMS_TOKEN ports: - containerPort: 9010 diff --git a/charts/ecosystem/templates/engine-controller.yaml b/charts/ecosystem/templates/engine-controller.yaml index b18cbcb..f2aa7f0 100644 --- a/charts/ecosystem/templates/engine-controller.yaml +++ b/charts/ecosystem/templates/engine-controller.yaml @@ -81,7 +81,7 @@ spec: - name: GALASA_EVENT_STREAMS_TOKEN valueFrom: secretKeyRef: - name: {{- if .Values.eventStreamsSecretName }}{{ .Values.eventStreamsSecretName }}{{- else }}{{ .Release.Name }}-event-streams-token{{- end }} + name: event-streams-token key: GALASA_EVENT_STREAMS_TOKEN ports: - containerPort: 9010 diff --git a/charts/ecosystem/templates/event-streams-secret.yaml b/charts/ecosystem/templates/event-streams-secret.yaml index 7020069..5cd217d 100644 --- a/charts/ecosystem/templates/event-streams-secret.yaml +++ b/charts/ecosystem/templates/event-streams-secret.yaml @@ -3,9 +3,11 @@ {{- $existingSecret := (lookup "v1" "Secret" .Release.Namespace .Values.eventStreamsSecretName) }} +# The Secret name was set in values but the Secret does not exist {{- if not $existingSecret }} -{{- $eventStreamsSecretName := (printf "%s-%s" .Release.Name "event-streams-token") }} +# The Secret must be called this to match the API/Engine Controller deployment spec +{{- $eventStreamsSecretName := "event-streams-token" }} {{- $token := randAlphaNum 44 }} apiVersion: v1 @@ -21,7 +23,8 @@ stringData: # eventStreamsSecretName not set in values.yaml so generate a name and a Secret {{- else }} -{{- $eventStreamsSecretName := (printf "%s-%s" .Release.Name "event-streams-token") }} +# The Secret must be called this to match the API/Engine Controller deployment spec +{{- $eventStreamsSecretName := "event-streams-token" }} {{- $token := randAlphaNum 44 }} apiVersion: v1