Closed cfergeau closed 2 weeks ago
The execution of crc setup
should fail with an error message that the bundle does not match the configured preset type.
There's that warning:
$ crc config set preset microshift
Changes to configuration property 'preset' are only applied when the CRC instance is created.
If you already have a running CRC instance with different preset, then for this configuration change to take effect, delete the CRC instance with 'crc delete', setup it with `crc setup` and start it with 'crc start'.
$ crc setup -b ~/Downloads/crc_libvirt_4.12.9_amd64.crcbundle
WARN Using crc_libvirt_4.12.9_amd64.crcbundle bundle, but crc_microshift_libvirt_4.12.9_amd64.crcbundle is expected for this release
.
.
.
I'm not suggesting that it's good as it is :), but for comparison crc start
is successful even if some operators aren't running yet (exit code 0).
Should the warning also be displayed together with the reason of failure? It would look like this:
$ crc setup --bundle crc_microshift_libvirt_4.16.7_amd64.crcbundle
WARN Using crc_microshift_libvirt_4.16.7_amd64.crcbundle bundle, but crc_libvirt_4.16.7_amd64.crcbundle is expected for this release
FATA Preset openshift is used but bundle is provided for microshift preset
The warning is displayed by this function: https://github.com/crc-org/crc/blob/e6495fe7492eb0464bfb33c55be104272cd16547/pkg/crc/validation/validation.go#L105-L118
which I assume is meant for cases when the user supplies their custom bundles.
Warning for custom bundle is non-fatal and we carry on but I think in case of different preset it should be fatal and we should error out.
Merged
General information
crc setup
before starting it (Yes/No)?CRC version
Steps to reproduce
crc config set preset openshift
crc setup --bundle ~/crc_podman_vfkit_4.4.2_amd64.crcbundle
crc start --bundle ~/crc_podman_vfkit_4.4.2_amd64.crcbundle
Expected
crc setup
detects the bundle mismatchActual
crc setup
is successful, and tells me to runcrc start