-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add generic Kubectl binary download script for all Linux distributions #31
Add generic Kubectl binary download script for all Linux distributions #31
Conversation
hack/install-kubectl.sh
Outdated
curl \ | ||
git | ||
# Find a suitable install location | ||
if [[ -w /usr/local/bin ]]; then |
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 would rather see ${HOME}/bin
as the first location to be checked since this is not an official installation script
.
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.
@kevydotvinu I think it is a good point that @coreydaley brought up here. Maybe you can change this piece here and the one in shipwright-io/build#819 to this one:
# Find a suitable install location
for CANDIDATE in "$HOME/bin" "/usr/local/bin" "/usr/bin"; do
if [[ -w $CANDIDATE ]] && grep -q "$CANDIDATE" <<<"$PATH"; then
TARGET_DIR="$CANDIDATE"
break
fi
done
# Bail out in case no suitable location could be found
if [[ -z ${TARGET_DIR:-} ]]; then
echo -e "Unable to determine a writable install location. Make sure that you have write access to either \\033[1m/usr/local/bin\\033[0m or \\033[1m${HOME}/bin\\033[0m and that is in your PATH."
exit 1
fi
I tried it out in my repository and this should be better to read and better to maintain in terms of the order.
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 have made the suggested changes in both places. Thanks, @HeavyWombat @coreydaley.
d10a5b9
to
96b6e4f
Compare
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.
/lgtm
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: HeavyWombat The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
Kubectl binary download script modification has been done to accommodate support for all Linux distributions. It is relatively short, requires no sudo and should run on most distros just fine.
Submitter Checklist
Release Notes