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

Small cleanups to pkg/crc/machine/bundle.DownloadDefault() code #3813

Merged
merged 5 commits into from
Sep 13, 2023

Conversation

cfergeau
Copy link
Contributor

There should be no visible changes, this PR removes some dead code, and add unit tests for the GPG signature checks for https downloads.

More could be built on top of that, such as trying to get a single code path for Download/downloadDefault, so that there is (optional) GPG signature checks in the non-default bundle case as well.

@openshift-ci
Copy link

openshift-ci bot commented Aug 30, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from cfergeau. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

pkg/crc/gpg/gpg.go Show resolved Hide resolved
pkg/crc/image/image.go Outdated Show resolved Hide resolved
test/integration/proxy_test.go Outdated Show resolved Hide resolved
It has a single caller in the bundle package, no need to export it.
This is no longer needed since 73a6cbc as we no longer have hardcoded
URL with version -> sha256sum mappings in a constants.go file.

This check was introduced in 9761b41 to check that the version
hardcoded in the URL is the same as the one hardcoded in our Makefile.
This check is no longer useful.
Instead of only having getDefaultBundleVerifiedHash() which takes a
'preset' argument and only works for the default bundle, this commit
introduces a getVerifiedHash() helper which expects a URL to the
signed sha256sum.txt file, and the name of the file we want the
sha256sum of.
This makes it easier to reuse this function for different purpose, and
to unit test this code.
Hopefully makes the code easier to follow.
The call we are reporting an error does not return an `error` value, the
`err` variable was set by the goOpenpgp.ReadArmoredKeyRing call.
 We should not include ("%w", err) in the error we return after a
goClearSign.Decode() failure as 'err' is nil anyway if we reach this
call.
@openshift-ci
Copy link

openshift-ci bot commented Sep 12, 2023

@cfergeau: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/integration-crc 40d8827 link true /test integration-crc
ci/prow/e2e-crc 40d8827 link true /test e2e-crc

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@praveenkumar praveenkumar merged commit 45831b0 into crc-org:main Sep 13, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants