Open A-725-K opened 22 hours ago
Hi @A-725-K. Thanks for your PR.
I'm waiting for a crc-org member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test
on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test
label.
I understand the commands that are listed here.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: cfergeau
The full list of commands accepted by this bot can be found here.
The pull request process is described here
New changes are detected. LGTM label has been removed.
@A-725-K: 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 | 2262b80bf81336c2c8745db08e77a55f0494a7ef | link | true | /test integration-crc |
ci/prow/e2e-crc | 2262b80bf81336c2c8745db08e77a55f0494a7ef | link | true | /test e2e-crc |
Full PR test history. Your PR dashboard.
The "latest" tag is not supported, therefore it is necessary to stop with an error in case it is not provided when using the -b flag command line flag.
Add unit tests to reproduce the bug and verify the fix.
Closes issue #4470
Fixes: Issue #4470
Solution/Idea
Before, in the
GetBundleNameFromURI
function, theimageAndTag
array was trying to access its second element without ensuring that the length is at least 2 causing a crash in case the-b
command line option was used to specify a bundle from a container image repository (using thedocker://
scheme) without a tag. I have added a check to prevent the program from crashing, returning an error to the user since the "latest" tag is not an option.Proposed changes
In
GetBundleNameFromURI
function:imageAndTag
arrayimageAndTag[0]
andimageAndTag[1]
respectivelyTesting
Added unit tests to reproduce the bug and validate the fix proposed. Check the
TestGetBundleNameFromURI
function in thepkg/crc/machine/bundle/metadata_test.go
file. Runningcrc setup -b docker://quay.io/crcont/openshift-bundle
should now return an error message instead of crashing.