-
Notifications
You must be signed in to change notification settings - Fork 206
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
hack/install.sh doesn't exit if a command fails #215
Comments
I had a better look at it, did a bit of testing, and can confirm the above behavior. It seems that we can add set to the beginning of the script like so:
The script exits successfully if I mess up with the containerd url.
Why each set option was used:
@alexellis let me know if this seems good and I'll go ahead and submit a PR with extensive testing. sources: |
That looks promising. Let's get a PR up for it? Out of interest, does arkade's get.sh script also do this? |
Nope, arkade does not use set. I tried to fail that as well but seems to fail successfully with or without set. |
Seems i've run into some problems with set. This is the output when running the script in its current form
This is the output with set added and no breakpoint
Is this the intended behavior? set catches this error from curl: Relevant answer on SO: Why does cURL return error "(23) Failed writing body"? |
Now the shell script exits if it encounters an error, instead of continuing. Signed-off-by: Haris Razis <haris@razis.com>
/close: resolved in #218 |
Expected Behaviour
If any command fails, the script should stop and make it obvious to the user that things didn't work. I ran into an error downloading containerd and it was buried in the output.
Current Behaviour
hack/install.sh doesn't exit if a command fails
See also: alexellis/containerd-arm#1
List all Possible Solutions
Perhaps add pipefail if it's not being used already?
Steps to Reproduce (for bugs)
Context
This hides errors which may not be picked up in e2e testing due to variations in OS/architecture of different users.
The text was updated successfully, but these errors were encountered: