You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Blacklist one of the systems on which k3s should be installed in the router, so the internet access is blocked or tamper the /etc/resolv.conf file of a system so name resolution doesn't work properly.
Run the installation on this modified machine via k3sup
Context
I tried to install on a machine that had a broken internet access and no proper error was returned as the curl failed which was not detected.
Currently the code just executes a command like
curl -sfL https://get.k3s.io | K3S_URL='https://<ip>:6443' K3S_TOKEN=’<token> INSTALL_K3S_VERSION='v1.19.1+k3s1' INSTALL_K3S_EXEC='server --server https://<ip>:6443' sh -s -
in https://github.com/alexellis/k3sup/blob/master/cmd/join.go#L319. The return code is checked afterwards. The problem is that the return code of this command is always the return code of the last command in the pipe. So if
curl
fails here this will not be visible in the return code. This behaviour in bash can be changed by settingpipefail
, see https://stackoverflow.com/questions/5934108/how-to-use-the-return-code-of-the-first-program-in-a-pipe-command-line. So the getscript in https://github.com/alexellis/k3sup/blob/master/cmd/install.go#L41 should be prefixed the command withset -o pipefail;
so the return code is != 0 if one of the commands in the pipe is !=0Expected Behaviour
If curl fails e.g. due to a network error or a DNS resolution issue an error should be returned.
Current Behaviour
If curl fails no feedback is given. The tool just stops without any feedback.
Are you a GitHub Sponsor (Yes/No?)
Possible Solution
I attached a patch as patch.txt
Steps to Reproduce
Context
I tried to install on a machine that had a broken internet access and no proper error was returned as the curl failed which was not detected.
Your Environment
k3sup install/join
):Rasbian on RaspberryPi
"Be part of the solution"
Subject to approval, are you willing to work on a Pull Request for this issue or feature request?
The text was updated successfully, but these errors were encountered: