Skip to content

Commit

Permalink
merge(#1328): [Cadence] allow existingSecret to be used in schema setup
Browse files Browse the repository at this point in the history
  • Loading branch information
akijakya authored Dec 7, 2022
2 parents 76b8f20 + df38b5e commit 7b40c6a
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cadence/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cadence
version: 0.24.0
version: 0.24.1
appVersion: 0.24.0
description: Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way.
icon: https://raw.githubusercontent.com/uber/cadence-web/master/client/assets/logo.svg
Expand Down
42 changes: 42 additions & 0 deletions cadence/templates/server-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,14 @@ spec:
{{- end }}
{{- if $storeConfig.cassandra.password }}
- name: CASSANDRA_PASSWORD
{{- if $storeConfig.cassandra.existingSecret }}
valueFrom:
secretKeyRef:
name: {{ include "cadence.persistence.secretName" (list $ $store) }}
key: {{ include "cadence.persistence.secretKey" (list $ $store) }}
{{- else }}
value: {{ $storeConfig.cassandra.password }}
{{- end }}
{{- end }}
{{- end }}
{{- if eq (include "cadence.persistence.driver" (list $ $store)) "sql" }}
Expand All @@ -114,7 +121,14 @@ spec:
- name: SQL_USER
value: {{ include "cadence.persistence.sql.user" (list $ $store) }}
- name: SQL_PASSWORD
{{- if $storeConfig.sql.existingSecret }}
valueFrom:
secretKeyRef:
name: {{ include "cadence.persistence.secretName" (list $ $store) }}
key: {{ include "cadence.persistence.secretKey" (list $ $store) }}
{{- else }}
value: {{ include "cadence.persistence.sql.password" (list $ $store) }}
{{- end }}
{{- with $storeConfig.sql.connectAttributes }}
- name: SQL_CONNECT_ATTRIBUTES
value: {{ include "to-query" . }}
Expand Down Expand Up @@ -147,7 +161,14 @@ spec:
{{- end }}
{{- if $storeConfig.cassandra.password }}
- name: CASSANDRA_PASSWORD
{{- if $storeConfig.cassandra.existingSecret }}
valueFrom:
secretKeyRef:
name: {{ include "cadence.persistence.secretName" (list $ $store) }}
key: {{ include "cadence.persistence.secretKey" (list $ $store) }}
{{- else }}
value: {{ $storeConfig.cassandra.password }}
{{- end }}
{{- end }}
{{- end }}
{{- if eq (include "cadence.persistence.driver" (list $ $store)) "sql" }}
Expand All @@ -162,7 +183,14 @@ spec:
- name: SQL_USER
value: {{ include "cadence.persistence.sql.user" (list $ $store) }}
- name: SQL_PASSWORD
{{- if $storeConfig.sql.existingSecret }}
valueFrom:
secretKeyRef:
name: {{ include "cadence.persistence.secretName" (list $ $store) }}
key: {{ include "cadence.persistence.secretKey" (list $ $store) }}
{{- else }}
value: {{ include "cadence.persistence.sql.password" (list $ $store) }}
{{- end }}
{{- with $storeConfig.sql.connectAttributes }}
- name: SQL_CONNECT_ATTRIBUTES
value: {{ include "to-query" . }}
Expand Down Expand Up @@ -271,7 +299,14 @@ spec:
{{- end }}
{{- if $storeConfig.cassandra.password }}
- name: CASSANDRA_PASSWORD
{{- if $storeConfig.cassandra.existingSecret }}
valueFrom:
secretKeyRef:
name: {{ include "cadence.persistence.secretName" (list $ $store) }}
key: {{ include "cadence.persistence.secretKey" (list $ $store) }}
{{- else }}
value: {{ $storeConfig.cassandra.password }}
{{- end }}
{{- end }}
{{- end }}
{{- if eq (include "cadence.persistence.driver" (list $ $store)) "sql" }}
Expand All @@ -286,7 +321,14 @@ spec:
- name: SQL_USER
value: {{ include "cadence.persistence.sql.user" (list $ $store) }}
- name: SQL_PASSWORD
{{- if $storeConfig.sql.existingSecret }}
valueFrom:
secretKeyRef:
name: {{ include "cadence.persistence.secretName" (list $ $store) }}
key: {{ include "cadence.persistence.secretKey" (list $ $store) }}
{{- else }}
value: {{ include "cadence.persistence.sql.password" (list $ $store) }}
{{- end }}
{{- with $storeConfig.sql.connectAttributes }}
- name: SQL_CONNECT_ATTRIBUTES
value: {{ include "to-query" . }}
Expand Down

0 comments on commit 7b40c6a

Please sign in to comment.