Skip to content
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

install.sh select from a set of checksum tools (to support a wider range of distributions) #129

Open
pivotaljohn opened this issue Jun 9, 2021 · 3 comments
Labels
carvel accepted This issue should be considered for future work and that the triage process has been completed enhancement This issue is a feature request

Comments

@pivotaljohn
Copy link
Contributor

pivotaljohn commented Jun 9, 2021

As a user installing Carvel tools on Fedora or Ubuntu (or other OS's not shipped with shasum)
I want to be able to verify the shas of the tools
So that I can use them confidently

Acceptance Criteria

Given I am on an OS that does not have shasum like Fedora
When I run carvel.dev/install.sh
Then It exits successfully
and has verified the downloaded tools against their shas

Notes: Since shasum defaults to using "1", we should default to sha1sum, and if that is not installed use shasum.

Describe the problem/challenge you have
Running install.sh on Fedora 27+:

#16 1.266 + install
#16 1.266 + set -euo pipefail
#16 1.266 + dst_dir=/opt/kubernetes/bin
#16 1.266 ++ command -v wget
#16 1.267 + '[' -x '' ']'
#16 1.267 + dl_bin='curl -s -L'
#16 1.267 + shasum -v
#16 1.268 Missing shasum binary
#16 1.268 + echo 'Missing shasum binary'
#16 1.268 + exit 1

Describe the solution you'd like
Be a bit more resilient to differences in distros.

Instead of erroring out, consider a small set of checksum tools and detect one that is present and use it.

Anything else you would like to add:
Users many not always be able to / want to install these kinds of utility tools as part of their installation of Carvel tools.

(Thanks to @GrahamDumpleton for pointing this issue out)

@pivotaljohn pivotaljohn added enhancement This issue is a feature request carvel triage This issue has not yet been reviewed for validity labels Jun 9, 2021
@GrahamDumpleton
Copy link

Specifically Linux distros tend to favour sha1sum and sha256sum. Only macOS and BSD based systems are guaranteed to have shasum.

Since default algorithm of shasum seems to be "1", then should check for existence of sha1sum and use it, otherwise fallback to shasum.

@GrahamDumpleton
Copy link

For Linux systems without shasum, may be able to get it by installing perl-Digest-SHA package.

@pivotaljohn pivotaljohn added carvel accepted This issue should be considered for future work and that the triage process has been completed and removed carvel triage This issue has not yet been reviewed for validity labels Jun 15, 2021
@pivotaljohn
Copy link
Contributor Author

As this improves the installation experience for a category of users, this issue is quite relevant. ==> "carvel accepted"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
carvel accepted This issue should be considered for future work and that the triage process has been completed enhancement This issue is a feature request
Projects
None yet
Development

No branches or pull requests

2 participants