Skip to content

Commit bdf62be

Browse files
committed
handle unset datastore_crypto_key so ne can compare strings
1 parent 2d44709 commit bdf62be

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

templates/configmaps_st2-conf.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ data:
4242
{{- end }}
4343
port = {{ index .Values "mongodb" "service" "port" }}
4444
{{- end }}
45-
{{- if ne "disable" .Values.st2.datastore_crypto_key }}
45+
{{- if ne "disable" (default "" .Values.st2.datastore_crypto_key) }}
4646
[keyvalue]
4747
encryption_key_path = /etc/st2/keys/datastore_key.json
4848
{{- end }}

templates/deployments.yaml

+14-14
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ spec:
204204
name: {{ .Release.Name }}-st2-urls
205205
volumeMounts:
206206
{{- include "st2-config-volume-mounts" . | nindent 8 }}
207-
{{- if ne "disable" .Values.st2.datastore_crypto_key }}
207+
{{- if ne "disable" (default "" .Values.st2.datastore_crypto_key) }}
208208
- name: st2-encryption-key-vol
209209
mountPath: /etc/st2/keys
210210
readOnly: true
@@ -228,7 +228,7 @@ spec:
228228
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" . }}
229229
{{- end }}
230230
volumes:
231-
{{- if ne "disable" .Values.st2.datastore_crypto_key }}
231+
{{- if ne "disable" (default "" .Values.st2.datastore_crypto_key) }}
232232
- name: st2-encryption-key-vol
233233
secret:
234234
secretName: {{ .Release.Name }}-st2-datastore-crypto-key
@@ -565,7 +565,7 @@ spec:
565565
name: {{ .Release.Name }}-st2-urls
566566
volumeMounts:
567567
{{- include "st2-config-volume-mounts" . | nindent 8 }}
568-
{{- if ne "disable" .Values.st2.datastore_crypto_key }}
568+
{{- if ne "disable" (default "" .Values.st2.datastore_crypto_key) }}
569569
- name: st2-encryption-key-vol
570570
mountPath: /etc/st2/keys
571571
readOnly: true
@@ -586,7 +586,7 @@ spec:
586586
{{- end }}
587587
volumes:
588588
{{- include "st2-config-volume" . | nindent 8 }}
589-
{{- if ne "disable" .Values.st2.datastore_crypto_key }}
589+
{{- if ne "disable" (default "" .Values.st2.datastore_crypto_key) }}
590590
- name: st2-encryption-key-vol
591591
secret:
592592
secretName: {{ .Release.Name }}-st2-datastore-crypto-key
@@ -780,7 +780,7 @@ spec:
780780
name: {{ .Release.Name }}-st2-urls
781781
volumeMounts:
782782
{{- include "st2-config-volume-mounts" . | nindent 8 }}
783-
{{- if ne "disable" .Values.st2.datastore_crypto_key }}
783+
{{- if ne "disable" (default "" .Values.st2.datastore_crypto_key) }}
784784
- name: st2-encryption-key-vol
785785
mountPath: /etc/st2/keys
786786
readOnly: true
@@ -805,7 +805,7 @@ spec:
805805
{{- end }}
806806
volumes:
807807
{{- include "st2-config-volume" . | nindent 8 }}
808-
{{- if ne "disable" .Values.st2.datastore_crypto_key }}
808+
{{- if ne "disable" (default "" .Values.st2.datastore_crypto_key) }}
809809
- name: st2-encryption-key-vol
810810
secret:
811811
secretName: {{ .Release.Name }}-st2-datastore-crypto-key
@@ -901,7 +901,7 @@ spec:
901901
name: {{ .Release.Name }}-st2-urls
902902
volumeMounts:
903903
{{- include "st2-config-volume-mounts" . | nindent 8 }}
904-
{{- if ne "disable" .Values.st2.datastore_crypto_key }}
904+
{{- if ne "disable" (default "" .Values.st2.datastore_crypto_key) }}
905905
- name: st2-encryption-key-vol
906906
mountPath: /etc/st2/keys
907907
readOnly: true
@@ -921,7 +921,7 @@ spec:
921921
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" . }}
922922
{{- end }}
923923
volumes:
924-
{{- if ne "disable" .Values.st2.datastore_crypto_key }}
924+
{{- if ne "disable" (default "" .Values.st2.datastore_crypto_key) }}
925925
- name: st2-encryption-key-vol
926926
secret:
927927
secretName: {{ .Release.Name }}-st2-datastore-crypto-key
@@ -1161,7 +1161,7 @@ spec:
11611161
volumeMounts:
11621162
{{- include "st2-config-volume-mounts" $ | nindent 8 }}
11631163
{{- include "packs-volume-mounts" $ | nindent 8 }}
1164-
{{- if ne "disable" $.Values.st2.datastore_crypto_key }}
1164+
{{- if ne "disable" (default "" $.Values.st2.datastore_crypto_key) }}
11651165
- name: st2-encryption-key-vol
11661166
mountPath: /etc/st2/keys
11671167
readOnly: true
@@ -1185,7 +1185,7 @@ spec:
11851185
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" $ }}
11861186
{{- end }}
11871187
volumes:
1188-
{{- if ne "disable" $.Values.st2.datastore_crypto_key }}
1188+
{{- if ne "disable" (default "" $.Values.st2.datastore_crypto_key) }}
11891189
- name: st2-encryption-key-vol
11901190
secret:
11911191
secretName: {{ $.Release.Name }}-st2-datastore-crypto-key
@@ -1303,7 +1303,7 @@ spec:
13031303
{{- include "st2-config-volume-mounts" . | nindent 8 }}
13041304
- name: st2-ssh-key-vol
13051305
mountPath: {{ tpl .Values.st2.system_user.ssh_key_file . | dir | dir }}/.ssh-key-vol/
1306-
{{- if ne "disable" .Values.st2.datastore_crypto_key }}
1306+
{{- if ne "disable" (default "" .Values.st2.datastore_crypto_key) }}
13071307
- name: st2-encryption-key-vol
13081308
mountPath: /etc/st2/keys
13091309
readOnly: true
@@ -1329,7 +1329,7 @@ spec:
13291329
serviceAccountName: {{ template "stackstorm-ha.serviceAccountName" . }}
13301330
{{- end }}
13311331
volumes:
1332-
{{- if ne "disable" .Values.st2.datastore_crypto_key }}
1332+
{{- if ne "disable" (default "" .Values.st2.datastore_crypto_key) }}
13331333
- name: st2-encryption-key-vol
13341334
secret:
13351335
secretName: {{ .Release.Name }}-st2-datastore-crypto-key
@@ -1581,7 +1581,7 @@ spec:
15811581
mountPath: /root/.st2/
15821582
- name: st2-ssh-key-vol
15831583
mountPath: {{ tpl .Values.st2.system_user.ssh_key_file . | dir | dir }}/.ssh-key-vol/
1584-
{{- if ne "disable" .Values.st2.datastore_crypto_key }}
1584+
{{- if ne "disable" (default "" .Values.st2.datastore_crypto_key) }}
15851585
- name: st2-encryption-key-vol
15861586
mountPath: /etc/st2/keys
15871587
readOnly: true
@@ -1608,7 +1608,7 @@ spec:
16081608
memory: "5Mi"
16091609
cpu: "5m"
16101610
volumes:
1611-
{{- if ne "disable" .Values.st2.datastore_crypto_key }}
1611+
{{- if ne "disable" (default "" .Values.st2.datastore_crypto_key) }}
16121612
- name: st2-encryption-key-vol
16131613
secret:
16141614
secretName: {{ .Release.Name }}-st2-datastore-crypto-key

templates/secrets_datastore_crypto_key.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{{- $deprecated_crypto_key := (default (dict) (default (dict) .Values.secrets).st2).datastore_crypto_key }}
33
{{- if $deprecated_crypto_key }}
44
{{- fail "Please update your values! The datastore_crypto_key value moved from secrets.st2.* to st2.*" }}
5-
{{- else if ne "disable" .Values.st2.datastore_crypto_key }}
5+
{{- else if ne "disable" (default "" .Values.st2.datastore_crypto_key) }}
66
---
77
apiVersion: v1
88
kind: Secret

0 commit comments

Comments
 (0)