-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat: add sha256sums for kind binaries #2336
feat: add sha256sums for kind binaries #2336
Conversation
Welcome @viveksyngh! |
Hi @viveksyngh. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/assign @BenTheElder |
/kind feature |
hack/release/build/cross.sh
Outdated
@@ -48,3 +48,6 @@ export GOOS=linux GOARCH=arm64 | |||
export GOOS=linux GOARCH=ppc64le | |||
EOF | |||
) | |||
|
|||
# add sha256 for binaries | |||
for f in ${REPO_ROOT}/bin/kind-*; do shasum -a 256 $f > $f.sha256sum; done |
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.
the original output for shasum
is something like hashValue fileName
, I think it only needs the hash value here?
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.
how do you know the filaname to check it with the command?
[aojea@aojea-laptop ~]$ shasum -a 256 ifac.go > ifac.sha
[aojea@aojea-laptop ~]$ sha256sum -c ifac.sha
ifac.go: OK
[aojea@aojea-laptop ~]$ cp ifac.sha ifac.shaonly
[aojea@aojea-laptop ~]$ vi ifac.shaonly #removed the filename
[aojea@aojea-laptop ~]$ sha256sum -c ifac.shaonly
sha256sum: ifac.shaonly: no properly formatted SHA256 checksum lines found
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.
You are right, it is not easy to check.
however,I found that we have a lot of current tar files are only have the hash value,I'm just curious what is the reason for this.
➜ ~ gsutil cat gs://kubernetes-release/release/v1.21.0-alpha.0/kubernetes-test-windows-amd64.tar.gz.sha256
e3b8a57d0bba4665f54874e4478bf2b360254314a482f4ba36f15ce228c561b7%
➜ ~ gsutil cat gs://kubernetes-release/release/v1.21.0-alpha.0/kubernetes-src.tar.gz.sha256
7eaf8fa1aa03afead4292d1e10dbc839439b4cd45a5a749bac242f8cf0040f45%
I find a shell script using the command to check.
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.
not an expert here, I always used the hash filename format, that is what shasum reports directly
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 also used hash filename format for one of the CLI in the past. Not sure what benefit other approach has.
/ok-to-test |
the verify job fails
|
b5e477d
to
00b9664
Compare
/test pull-kind-verify |
00b9664
to
651a50d
Compare
hack/release/build/cross.sh
Outdated
@@ -48,3 +48,6 @@ export GOOS=linux GOARCH=arm64 | |||
export GOOS=linux GOARCH=ppc64le | |||
EOF | |||
) | |||
|
|||
# add sha256 for binaries | |||
for f in "${REPO_ROOT}"/bin/kind-*; do shasum -a 256 "$f" > "$f".sha256sum; done |
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.
don't use the oneliner and keep the last line, is easier to read
for f in "${REPO_ROOT}"/bin/kind-*; do shasum -a 256 "$f" > "$f".sha256sum; done | |
for f in "${REPO_ROOT}"/bin/kind-*; do | |
shasum -a 256 "$f" > "$f".sha256sum | |
done | |
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.
Updated
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.
hmm this adds the whole path to the generated file, I think that we have to cd first in the folder
cd "${REPO_ROOT}"/bin
for f in kind-*; do
shasum -a 256 "$f" > "$f".sha256sum
done
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.
yup it was adding full path. I have updated that to change to the directory and then run sha command.
651a50d
to
85a6d13
Compare
- Add sha256sum file for kind binaries build as a part of release process
85a6d13
to
6937f75
Compare
/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.
/lgtm
/approve
/hold
thanks!
@@ -48,3 +48,9 @@ export GOOS=linux GOARCH=arm64 | |||
export GOOS=linux GOARCH=ppc64le | |||
EOF | |||
) | |||
|
|||
# add sha256 for binaries | |||
cd "${REPO_ROOT}"/bin |
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.
TODO: refactor to not need cd
EDIT: at least in the current shell scope, we could perhaps do this bit in a subshell or see if there's some other approach to manipulating the output.
TODO: update loop to ignore files with .sha256sum extension.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BenTheElder, viveksyngh 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 |
/hold cancel |
Fixes: #2331