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

Commits on Sep 12, 2023

  1. bundle: Make downloadDefault private to the package

    It has a single caller in the bundle package, no need to export it.
    cfergeau committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    5457dce View commit details
    Browse the repository at this point in the history
  2. bundle: Remove bundle version check from downloadDefault()

    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.
    cfergeau committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    3563509 View commit details
    Browse the repository at this point in the history
  3. bundle: Add more generic getVerifiedHash helper

    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.
    cfergeau committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    b59a17a View commit details
    Browse the repository at this point in the history
  4. bundle: Use switch case for default bundle

    Hopefully makes the code easier to follow.
    cfergeau committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    5e15d3b View commit details
    Browse the repository at this point in the history
  5. gpg: Remove incorrect %w from error string

    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.
    cfergeau committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    40d8827 View commit details
    Browse the repository at this point in the history