Make server's data-dir configurable for getting node token in join command #388
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.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) [email protected]
Description
Make data-dir configurable for getting node token
Why do you need this?
Three users, none of them are sponsors requested this feature in #373
When using a different data-dir for K3s on a server, the hard-coded node-token path fails to match a valid token file.
So this change allows the join command to override the value for the path.
Closes: #373
How Has This Been Tested?
I created two multipass VMs, running
sudo mkdir -p /mnt/ssd/k3s
on both.On the server:
On the agent:
Originally, the command above failed with the error seen in the user's report.
Afterwards, it connected and worked as expected.
Types of changes
Checklist:
For future work, adding
--data-dir
as a first-class flag would mean less typing i.e. no need for--k3s-extra-args "--data-dir /mnt/ssd/k3s"
, instead it'd be--data-dir /mnt/ssd/k3s
and then translated into the k3s extra args automatically, like other flags are today.