Skip to content

Commit 06901fe

Browse files
authored
Merge pull request #59 from SQLJames/bug/test-connection
Bug/test connection
2 parents 47871e0 + 1191005 commit 06901fe

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
## Changelog
22

3+
### V2.0.3
4+
5+
#### Non-Breaking Changes
6+
7+
- Updated Chart test to wait for the service to become available before testing rcon port
8+
39
### V2.0.2
410

511
#### Non-Breaking Changes

charts/factorio-server-charts/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ sources:
2020
# This is the chart version. This version number should be incremented each time you make changes
2121
# to the chart and its templates, including the app version.
2222
# Versions are expected to follow Semantic Versioning (https://semver.org/)
23-
version: 2.0.2
23+
version: 2.0.3
2424

2525
# This is the version number of the application being deployed. This version number should be
2626
# incremented each time you make changes to the application. Versions are not expected to

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,19 @@ spec:
1212
image: outdead/rcon
1313
command:
1414
- /bin/sh
15-
- -ec
15+
- -xec
1616
- |
17+
until nc -z {{ include "factorio-server-charts.fullname" . }}-rcon {{ .Values.rcon.port }}; do
18+
echo "Waiting for main service to be ready..." >&2
19+
sleep 5
20+
done
21+
echo "Main service is ready, proceeding with connection test."
1722
RCONPW="$(cat /rconpw/rconpw)"
18-
./rcon -a {{ include "factorio-server-charts.fullname" . }}-rcon:{{ .Values.rcon.port }} -p $RCONPW -t rcon -T 180s /s Test
23+
if ./rcon -a {{ include "factorio-server-charts.fullname" . }}-rcon:{{ .Values.rcon.port }} -p $RCONPW -t rcon -T 180s /s Test; then
24+
echo "RCON test command completed successfully."
25+
else
26+
echo "RCON test failed." >&2
27+
fi
1928
volumeMounts:
2029
- mountPath: /rconpw
2130
name: rconpw

0 commit comments

Comments
 (0)