Skip to content

Commit 7535190

Browse files
chore(shield): add support to rapid_response pwd also on features section (#2229)
1 parent 2f66a79 commit 7535190

4 files changed

Lines changed: 29 additions & 2 deletions

File tree

charts/shield/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ maintainers:
1313
- name: mavimo
1414
1515
type: application
16-
version: 1.3.7
16+
version: 1.3.8
1717
appVersion: "1.0.0"

charts/shield/templates/host/_helpers.tpl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,15 @@ true
230230
{{- end }}
231231
{{- end }}
232232

233+
{{- define "host.rapid_response_password" }}
234+
{{- $feature_respond := get .Values.features (include "host.respond_key" .Values.features) }}
235+
{{- if ne (dig "rapid_response" "password" "" $feature_respond) "" }}
236+
{{- $feature_respond.rapid_response.password }}
237+
{{- else }}
238+
{{- dig "rapid_response" "password" "" .Values.host.additional_settings }}
239+
{{- end }}
240+
{{- end }}
241+
233242
{{- define "host.monitor_key" }}
234243
{{- if hasKey . "monitoring" }}
235244
{{- print "monitoring" }}

charts/shield/templates/host/secrets.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ metadata:
99
{{- include "host.labels" . | nindent 4 }}
1010
type: Opaque
1111
data:
12-
password: {{ (dig "rapid_response" "password" "" .Values.host.additional_settings) | b64enc | quote }}
12+
password: {{ (include "host.rapid_response_password" .) | b64enc | quote }}
1313
{{- end }}

charts/shield/tests/host/secrets_test.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,21 @@ tests:
2727
path: data.password
2828
decodeBase64: true
2929
value: "abc123"
30+
31+
- it: Test Rapid Response secret is created with correct password
32+
set:
33+
features:
34+
respond:
35+
rapid_response:
36+
enabled: true
37+
password: abc123
38+
asserts:
39+
- containsDocument:
40+
kind: Secret
41+
apiVersion: v1
42+
name: release-name-shield-host-rapid-response
43+
namespace: shield-namespace
44+
- equal:
45+
path: data.password
46+
decodeBase64: true
47+
value: "abc123"

0 commit comments

Comments
 (0)