Skip to content

Commit

Permalink
Merge pull request #34 from galasa-dev/iss1893-eventstreams-token
Browse files Browse the repository at this point in the history
Provide Event Streams token to API and Engine Controller
  • Loading branch information
jadecarino authored Jun 19, 2024
2 parents 57af5c9 + dff78de commit 4a5cca7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/ecosystem/templates/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion charts/ecosystem/templates/engine-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions charts/ecosystem/templates/event-streams-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 4a5cca7

Please sign in to comment.