-
Notifications
You must be signed in to change notification settings - Fork 450
infra: remove os version #3225
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
infra: remove os version #3225
Conversation
Auto-detect the operating system identifier from /etc/os-release, so that users do not need to specify it manually. The ibmcloud setup command applies to both RH and non-RH distros, so we don't need to check the OS there. Signed-off-by: Ken Dreyer <[email protected]>
| echo "neither system 'ID' nor 'ID_LIKE' is 'fedora' - did you mean to specify a 'rh' system?" | ||
| fi | ||
| curl -fsSL https://clis.cloud.ibm.com/install/linux | sh | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems better to add a check to make sure install success...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that not handled by the exit code of the command still?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some testing.
When the sh command fails, local-setup.sh will exit with a non-zero exit code.
When the curl command fails, sh eats the exit code of curl, so local-setup.sh still exits with 0. That is a problem that is not directly related to the changes I'm making in this PR. We could fix that with set -o pipefail at the top of this script.
(This type of thing is why I prefer other languages to Bash. There are so many gotchas like this with error handling. But I understand this particular script makes sense to keep in Bash for now.)
| echo "neither system 'ID' nor 'ID_LIKE' is 'fedora' - did you mean to specify a 'rh' system?" | ||
| fi | ||
| curl -fsSL https://clis.cloud.ibm.com/install/linux | sh | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that not handled by the exit code of the command still?
Auto-detect the operating system identifier from
/etc/os-release, so that users do not need to specify it manually.The
ibmcloudsetup command applies to both RH and non-RH distros, so we don't need to check the OS there.