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

Validation: Don't fail if the bundle path is same as default path #3826

Merged
merged 5 commits into from
Sep 29, 2023

Conversation

praveenkumar
Copy link
Member

ValidateBundle function try to get the bundle info if the bundle is
already extracted or run ValidateBundlePath which in case check if the
bundle exist for provided path and for default bundle it give error in
case not persent in the default location. Ideally ValidateBundle should
just return nil in case default bundle path is provided.

With this change, same function can consme as part of cmd/setup which
right now have addition logic to ignore default bundle path.

@openshift-ci openshift-ci bot requested review from cfergeau and evidolob September 6, 2023 16:05
Copy link
Contributor

@cfergeau cfergeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, a few questions though.

pkg/crc/preflight/preflight_checks_common.go Show resolved Hide resolved
pkg/crc/preflight/preflight_checks_common.go Show resolved Hide resolved
@praveenkumar
Copy link
Member Author

/retest

@openshift-ci
Copy link

openshift-ci bot commented Sep 21, 2023

@praveenkumar: 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 b541736 link true /test integration-crc
ci/prow/e2e-crc b541736 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.

ValidateBundle function try to get the bundle info if the bundle is
already extracted or run ValidateBundlePath which in case check if the
bundle exist for provided path and for default bundle it give error in
case not persent in the default location. Ideally ValidateBundle should
just return nil in case default bundle path is provided.

With this change, same function can consme as part of `cmd/setup` which
right now have addition logic to ignore default bundle path.
In previous commit 5fbcac2 ,
ValidateBundle now handle the default bundlepath also so we shouldn't
have a different logic here.
This logic we have in `fixBundleExtract` function is kind of unnecessary
because ValidationBundle already part of setup,start and config set
command so having same logic doesn't make sense.
invalidPath type only used in the validation so no point to make it
public.
With this PR now end user will observe more meaningful message to run
`crc setup` in case want to use the default bundle.
```
$ ./crc config set bundle /foo/bar
Value '/foo/bar' for configuration property 'bundle' is invalid, reason: /foo/bar is invalid or missing, run 'crc setup' to download the default bundle

$ ./crc start -b /foo/bar
/foo/bar is invalid or missing, run 'crc setup' to download the default bundle
```
@openshift-ci
Copy link

openshift-ci bot commented Sep 29, 2023

[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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants