Skip to content

Commit ec53a4d

Browse files
committed
Testing pod now gets rcon password from secret
1 parent 7eba6d6 commit ec53a4d

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

charts/factorio-server-charts/templates/tests/test-connection.yaml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@ spec:
1010
containers:
1111
- name: rcon
1212
image: outdead/rcon
13-
command: ['./rcon']
14-
args: ['-a','{{ include "factorio-server-charts.fullname" . }}-rcon:{{ .Values.rcon.port }}','-p','{{ .Values.rcon.password }}','-t','rcon','-T','180s','/s','Test']
13+
command:
14+
- /bin/sh
15+
- -ec
16+
- |
17+
RCONPW="$(cat /rconpw/rconpw)"
18+
./rcon -a {{ include "factorio-server-charts.fullname" . }}-rcon:{{ .Values.rcon.port }} -p $RCONPW -t rcon -T 180s /s Test
19+
volumeMounts:
20+
- mountPath: /rconpw
21+
name: rconpw
1522
restartPolicy: Never
23+
volumes:
24+
- name: rconpw
25+
secret:
26+
{{- if .Values.rcon.passwordSecret }}
27+
secretName: {{ .Values.rcon.passwordSecret }}
28+
{{- else }}
29+
secretName: {{ template "factorio-server-charts.fullname" . }}-rcon
30+
{{- end }}

0 commit comments

Comments
 (0)