quintush / helm-unittest

BDD styled unit test framework for Kubernetes Helm charts as a Helm plugin.
MIT License
345 stars 69 forks source link

Install fails with sha256sum #78

Closed Toghr closed 3 years ago

Toghr commented 3 years ago

When I try to instal plugin on centos 7 I get following error:

Validating Checksum.
sha256sum: invalid option -- 's'
Try 'sha256sum --help' for more information.
Failed to install helm-unittest

It's caused by this part: curl -s -L "$PROJECT_CHECKSUM" | grep "$DOWNLOAD_FILE" | sha256sum -c -s

While -s is valid option for shasum

shasum --help
Usage: shasum [OPTION]... [FILE]...
Print or check SHA checksums.
...
  -s, --status          don't output anything, status code shows success

It's not ok for sha256sum:

sha256sum --help
Usage: sha256sum [OPTION]... [FILE]...
Print or check SHA256 (256-bit) checksums.
...
The following four options are useful only when verifying checksums:
      --status         don't output anything, status code shows success

Workarounds: install shasum, it will be preferred over sha256sum yum install -y perl-Digest-SHA

quintush commented 3 years ago

Hello @Toghr ,

I'm aware of the defect and also received a pullrequest to fix the problem (https://github.com/quintush/helm-unittest/pull/73). However the pullrequest does not fulfill the complete request so I started investigating other options.

In the mean time i noticed there are 3 versions of sha256sum. 1 version (used in apline) which allows the -s option 2 version which supports both -s and --status 3 the version which only supports --status

As i use the alpine version for the docker images i have created a branch in which i try to solve all combinations. Still need to verify if all setups are working, but feel free to comment.

Toghr commented 3 years ago

@quintush thanks for Your quick reply. I was not aware of 'alpine' version. Indeed it does not support full: '--status' option which, I was hoping, could be a good solution :(