Skip to content

Commit 3f48724

Browse files
committed
Urgent Fix - Account not Working
- Bumped Chart version to 1.1.0 - Added `ndots: 1` to dnsConfig to allow Pod to resolve mods.factorio.com and github.com - Fixed mod-downloader-configmap, removing obsolete check and adding check for username and token presence based on secret
1 parent 520b2b8 commit 3f48724

File tree

3 files changed

+29
-18
lines changed

3 files changed

+29
-18
lines changed

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: 1.1.0
23+
version: 1.1.1
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/deployment.yaml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ spec:
1919
labels:
2020
app: {{ template "factorio-server-charts.fullname" . }}
2121
spec:
22+
dnsConfig:
23+
options:
24+
- name: ndots
25+
value: '1'
2226
{{- if eq .Values.service.type "NodePort" }}
2327
hostNetwork: true
2428
{{- else }}
@@ -65,8 +69,8 @@ spec:
6569
- name: rcon
6670
mountPath: /rcon-pw
6771
{{- end }}
68-
{{- if or (.Values.server_settings.accountSecret) (.Values.server_settings.username) }}
69-
- name: accountData
72+
{{- if or (.Values.account.accountSecret) (.Values.account.username) }}
73+
- name: account-data
7074
mountPath: /account
7175
{{- end }}
7276
{{- if or (.Values.serverPassword.game_password) (.Values.serverPassword.passwordSecret) }}
@@ -90,6 +94,10 @@ spec:
9094
mountPath: /factorio
9195
- name: {{ template "factorio-server-charts.fullname" . }}-mod-downloader-configmap
9296
mountPath: /scripts
97+
{{- if or (.Values.account.accountSecret) (.Values.account.username) }}
98+
- name: account-data
99+
mountPath: /account
100+
{{- end }}
93101
{{- end }}
94102
containers:
95103
- name: {{ template "factorio-server-charts.fullname" . }}
@@ -100,7 +108,7 @@ spec:
100108
livenessProbe:
101109
exec:
102110
command:
103-
- 'ps aux | grep factorio'
111+
- '/bin/ps aux | /bin/grep factorio'
104112
periodSeconds: 10
105113
initialDelaySeconds: 5
106114
failureThreshold: 3
@@ -113,8 +121,8 @@ spec:
113121
resources:
114122
{{ toYaml .Values.resources | indent 10 }}
115123
volumeMounts:
116-
{{- if or (.Values.server_settings.accountSecret) (.Values.server_settings.username) }}
117-
- name: accountData
124+
{{- if or (.Values.account.accountSecret) (.Values.account.username) }}
125+
- name: account-data
118126
mountPath: /account
119127
{{- end }}
120128
- name: datadir
@@ -139,11 +147,11 @@ spec:
139147
{{ toYaml .Values.nodeSelector | indent 8 }}
140148
{{- end }}
141149
volumes:
142-
{{- if or (.Values.server_settings.accountSecret) (.Values.server_settings.username) }}
143-
- name: accountData
150+
{{- if or (.Values.account.accountSecret) (.Values.account.username) }}
151+
- name: account-data
144152
secret:
145-
{{- if .Values.server_settings.accountSecret }}
146-
secretName: {{ .Values.server_settings.accountSecret }}
153+
{{- if .Values.account.accountSecret }}
154+
secretName: {{ .Values.account.accountSecret }}
147155
{{- else}}
148156
secretName: {{ template "factorio-server-charts.fullname" . }}-account
149157
{{- end }}

charts/factorio-server-charts/templates/mod-downloader-configmap.yaml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ metadata:
88
release: "{{ .Release.Name }}"
99
heritage: "{{ .Release.Service }}"
1010
data:
11-
#credit to the factoriotools/factorio-docker team, most of this logic came from them
11+
# credit to the factoriotools/factorio-docker team, most of this logic came from them
1212
# https://github.com/factoriotools/factorio-docker/blob/master/docker/files/update-mods.sh
1313
mod-downloader.sh: |
1414
modDir=/factorio/mods
@@ -56,7 +56,7 @@ data:
5656
fi
5757
MOD_INFO_URL="$MOD_BASE_URL/api/mods/$1"
5858
MOD_INFO_JSON=$(curl --silent "$MOD_INFO_URL")
59-
#echo "$MOD_INFO_URL $MOD_INFO_JSON"
59+
# echo "$MOD_INFO_URL $MOD_INFO_JSON"
6060
if ! echo "$MOD_INFO_JSON" | jq -e .name >/dev/null; then
6161
print_success " Custom mod not on $MOD_BASE_URL, skipped."
6262
return 0
@@ -98,12 +98,15 @@ data:
9898
for key in "${!unofficialMods[@]}"; do
9999
downloadUnofficial "${unofficialMods[$key]}" $key
100100
done
101-
{{- if and .Values.server_settings.username .Values.server_settings.token }}
102-
echo "server is running version $VERSION"
103-
for officialMod in ${officialMods[*]}; do
104-
downloadofficial $officialMod $USERNAME $TOKEN
105-
done
106-
{{- end }}
101+
102+
if [ -f "/account/username" ]; then
103+
if [ -f "/account/token" ]; then
104+
echo "server is running version $VERSION"
105+
for officialMod in ${officialMods[*]}; do
106+
downloadofficial $officialMod $USERNAME $TOKEN
107+
done
108+
fi
109+
fi
107110
108111
109112

0 commit comments

Comments
 (0)