satisfactory: game.enableSeasonalEvents says what it does (7.0.0+upv1.9.10)
game.seasonalEvents was handed to the container unchanged, into the image's DISABLESEASONALEVENTS. Its default true therefore wrote DISABLESEASONALEVENTS=true: the seasonal events were OFF in every install this chart has ever produced, while values.schema.json described the very same key as "true means events are enabled" (#215). Of the two ways out, this is the loud one. Inverting the template under the old key would have flipped the behaviour of every existing release in silence - the same class of mistake that created the issue. Renaming the key cannot be missed: game.seasonalEvents no longer exists, additionalProperties is false on the game block, and a values file that still carries it fails schema validation on upgrade instead of quietly meaning the opposite. The new key is positive (enableSeasonalEvents) to avoid a double negative, so the chart negates it on the way into the env var. Go's "not" cannot do that: it reads every non-empty string as true, and the schema deliberately accepts the string form of booleans, so "false" would have flipped the wrong way. The helper compares explicitly and fails on anything that is neither true nor false rather than filing it under "off". The default is enableSeasonalEvents: false, which renders the DISABLESEASONALEVENTS this chart has always rendered. At chart defaults the 6.1.0 and 7.0.0 manifests are identical, so upgrading alone moves no server; switching the events on is now a deliberate act with a key that means it. Separate finding from the same issue, fixed here because it lives in the block being touched: "--set game=null" - or a leftover "game:" whose sub-keys were deleted - aborted the render with a nil pointer at .Values.game.maxPlayers. The game block never got the null-safe treatment of #99 that probes, security contexts and resources have. It now falls back to the documented defaults, and the schema accepts the null accordingly. The same gap remains in the dev and server blocks; it is reported, not fixed here. Major bump: a values key is removed, and the schema rejects it.
This commit is contained in:
8 files changed
+114
-22
No files matched your search
@@ -288,6 +288,52 @@ Probe specifics that a rebuilt default must not lose:
|
||||
{{- include "satisfactory.defaultedDict" (dict "defaults" $defaults "given" . "path" "startupProbe") -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
The effective game block (issue #99, found alongside #215).
|
||||
|
||||
"--set game=null" — or a leftover "game:" with all sub-keys deleted — used to
|
||||
abort the render with a nil-pointer error at .Values.game.maxPlayers, because
|
||||
this block never got the null-safe treatment the probes, security contexts and
|
||||
resources have. It now falls back to the same defaults values.yaml documents.
|
||||
|
||||
The defaults below MUST stay in sync with the game block in values.yaml.
|
||||
Note that enableSeasonalEvents defaults to FALSE: that is what keeps
|
||||
DISABLESEASONALEVENTS at "true", the value this chart has always rendered.
|
||||
*/}}
|
||||
{{- define "satisfactory.game" -}}
|
||||
{{- $defaults := dict
|
||||
"experimental" false
|
||||
"maxPlayers" 4
|
||||
"enableSeasonalEvents" false -}}
|
||||
{{- include "satisfactory.defaultedDict" (dict "defaults" $defaults "given" . "path" "game") -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Render the DISABLESEASONALEVENTS env value from game.enableSeasonalEvents
|
||||
(issue #215).
|
||||
|
||||
The image only offers the negative switch, so the chart negates the positive
|
||||
value here — that is the whole point of the rename: the key says what it does
|
||||
and the env var keeps the name the image expects.
|
||||
|
||||
Go's "not" cannot do this: it treats every non-empty string as true, so the
|
||||
string form "false" (which fleet bundles habitually write for booleans, and
|
||||
which the schema therefore accepts) would flip the wrong way. Hence the
|
||||
explicit comparison — and an explicit fail for anything that is neither, so a
|
||||
typo like "yes" cannot be silently read as "events off". Null never reaches
|
||||
here; satisfactory.game has already replaced it with the default.
|
||||
*/}}
|
||||
{{- define "satisfactory.disableSeasonalEvents" -}}
|
||||
{{- $raw := printf "%v" . -}}
|
||||
{{- if eq (lower $raw) "true" -}}
|
||||
false
|
||||
{{- else if eq (lower $raw) "false" -}}
|
||||
true
|
||||
{{- else -}}
|
||||
{{- fail (printf "game.enableSeasonalEvents must be true or false (boolean or string), got %q" $raw) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
The effective resources block, fed into the resources helper above so that an
|
||||
erased "resources:" still yields the chart's requests and computed limits.
|
||||
|
||||
Reference in new issue
Block a user