fix: use feature-gates= (set) instead of += (append) in k3s v1.32 config#326
Merged
Conversation
The += syntax in the k3s config file has a timing race in k3s's GetArgs() function: under CI resource contention, += tries to append to the existing feature gates map before it is populated, causing InPlacePodVerticalScaling=true to silently fail to register. The pods/resize subresource never appears and the E2E run fails. Switch to = (set) which sets the feature gate directly without depending on any existing state. This is safe for K8s 1.32 because k3s's default apiserver feature gates at this version are all GA (locked on/off, not present in --feature-gates). Also improve the verify step's diagnostic output: replace the useless ps aux | grep kube-apiserver (k3s embeds the apiserver) with targeted diagnostics (config file dump, API resources check, filtered k3s logs). Closes #325 Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The E2E nightly run on 2026-06-10 (run) failed on K8s v1.32 because the
pods/resizesubresource never registered despite the k3s config file correctly containingfeature-gates+=InPlacePodVerticalScaling=true.The
+=(append) syntax in the k3s config file has a timing race in k3s'sGetArgs()function (pkg/util/args.go): under CI resource contention,+=tries to append to the existing feature gates map before k3s has populated its defaults, causing the feature gate to silently fail to register. This is the same class of bug as #296. PR #297 moved from CLI args to config file and PR #300 switched to+=to preserve k3s defaults, but the race persists because config file args go through the sameGetArgs()code path.Fix
Switch from
feature-gates+=(append) tofeature-gates=(set) in the k3s config file. The=syntax sets the feature gate directly without depending on any existing state being populated first, bypassing the race entirely.This is safe for K8s 1.32: k3s's default apiserver feature gates at this version are all GA (locked on/off, not present in
--feature-gates), so there are no alpha/beta defaults to preserve.Also improves the verify step's diagnostic output by replacing the useless
ps aux | grep kube-apiserver(k3s embeds the apiserver in its own process) with targeted diagnostics: config file dump, API resources check, and filtered k3s logs.Closes #325