Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-1.26] Ignore token-file argument when value not needed #4301

Merged
merged 3 commits into from
Apr 18, 2024

Conversation

k0s-bot
Copy link

@k0s-bot k0s-bot commented Apr 17, 2024

Automated backport to release-1.26, triggered by a label in #4295.
See #4293 #4277.

kke added 3 commits April 17, 2024 06:41
Both "k0s controller" and "k0s worker" take either [TOKEN] as an
argument or a path to a file containing the join token via --token-file.

Before this PR, when --token-file was given, the file was read upon
spin-up, even when the node has joined already and won't utilize the
token. As the token is not needed after join, you would expect that you
can or even should remove the file, but that makes k0s refuse to start
unless the --token-file argument is removed from the systemd unit or
other startup scripts.

This PR makes the controller and worker read the contents of the file
only right before the value is getting used. This allows --token-file
argument to be ignored when it is not needed and the file not existing
will not generate an error.

Signed-off-by: Kimmo Lehto <[email protected]>
(cherry picked from commit 42d94e4)
(cherry picked from commit 75c65eb)
(cherry picked from commit 00e610c)
(cherry picked from commit 8aa40a9)
Signed-off-by: Kimmo Lehto <[email protected]>
(cherry picked from commit 1391728)
(cherry picked from commit f152262)
(cherry picked from commit 26f57a8)
(cherry picked from commit 5edd77e)
Signed-off-by: Kimmo Lehto <[email protected]>
(cherry picked from commit df17744)
(cherry picked from commit d86cad2)
(cherry picked from commit 9c9fa82)
(cherry picked from commit ca66a64)
@k0s-bot k0s-bot requested a review from a team as a code owner April 17, 2024 06:41
@k0s-bot k0s-bot requested review from makhov and twz123 April 17, 2024 06:41
@twz123 twz123 changed the title [Backport release-1.26] [Backport release-1.27] Ignore token-file argument when value not needed [Backport release-1.26] Ignore token-file argument when value not needed Apr 17, 2024
@twz123 twz123 added bug Something isn't working area/cli labels Apr 17, 2024
@twz123 twz123 merged commit c3c1114 into release-1.26 Apr 18, 2024
68 checks passed
@twz123 twz123 deleted the backport-4295-to-release-1.26 branch April 18, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants