Support K0S_JOIN_TOKEN and deprecate CLI token args#7929
Open
didiberman wants to merge 1 commit into
Open
Conversation
This commit adds the K0S_JOIN_TOKEN environment variable as the preferred env source for join tokens, falling back to K0S_TOKEN for backwards compatibility. It also logs a deprecation warning if the join token is passed as a positional CLI argument to k0s controller or k0s worker, to give users time to transition to safer alternatives. Fixes: k0sproject#5253 Signed-off-by: Didi Berman <didi@didibe.dev>
didiberman
force-pushed
the
support-join-token-env-var
branch
from
July 5, 2026 07:54
d3ebe06 to
36a2085
Compare
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.
Description
This PR resolves #5253 by:
K0S_JOIN_TOKENenvironment variable as the preferred source for join tokens.K0S_TOKENenvironment variable for backwards compatibility.k0s controllerandk0s workersubcommands when a join token is passed as a positional command-line argument.This ensures credentials are passed securely and gives users a clear deprecation warning timeline to transition off positional arguments.
Testing
Ran unit tests for validation and retrieval:
go test -v ./cmd/internal/...go test -v ./cmd/worker/...All tests passed successfully.
AI Assistance Note
This PR was written with AI assistance.