Skip to content

Commit f61c978

Browse files
committed
Add repeaters to static-app-with-delay
1 parent fb60276 commit f61c978

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

charts/static-app-with-delay/templates/deployment.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# static-app-with-delay/templates/deployment.yaml
1+
{{- $repeaterIDs := (or (and (hasKey .Values "global") (hasKey .Values.global "repeaterIDs") .Values.global.repeaterIDs) (list .Values.repeaterID)) }}
2+
{{- $token := (or (and (hasKey .Values "global") (hasKey .Values.global "token") .Values.global.token) .Values.token) }}
3+
{{- $cluster := (or (hasKey .Values "global") (hasKey .Values.global "cluster") .Values.global.cluster) .Values.cluster) }}
4+
{{- $timeout := (or (hasKey .Values "global") (hasKey .Values.global "timeout") .Values.global.timeout) .Values.timeout "30000") }}
5+
{{- $repeaterImageTag := (or (hasKey .Values "global") (hasKey .Values.global "repeaterImageTag") .Values.global.repeaterImageTag) .Values.repeaterImageTag "latest") }}
6+
---
27
apiVersion: apps/v1
38
kind: Deployment
49
metadata:
@@ -70,10 +75,10 @@ spec:
7075
}
7176
' > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'
7277
73-
{{- if and .Values.repeaterID .Values.token .Values.cluster }}
74-
{{- range $index, $repeaterID := .Values.repeaterID }}
78+
{{- if and $token $cluster }}
79+
{{- range $index, $repeaterID := $repeaterIDs }}
7580
- name: repeater-{{ $index }}
76-
image: brightsec/cli{{ if $.Values.repeaterImageTag }}:{{ $.Values.repeaterImageTag }}{{ else }}:latest{{ end }}
81+
image: brightsec/cli:{{ $repeaterImageTag }}
7782
command: ["bright-cli", "repeater"]
7883
args:
7984
- "--token=$(TOKEN)"
@@ -89,11 +94,11 @@ spec:
8994
- name: REPEATER_ID
9095
value: "{{ $repeaterID }}"
9196
- name: TOKEN
92-
value: "{{ $.Values.token }}"
97+
value: "{{ $token }}"
9398
- name: CLUSTER
94-
value: "{{ $.Values.cluster }}"
99+
value: "{{ $cluster }}"
95100
- name: TIMEOUT
96-
value: "{{ $.Values.timeout | default "30000" }}"
101+
value: "{{ $timeout }}"
97102
{{- end }}
98103
{{- end }}
99104

0 commit comments

Comments
 (0)