Skip to content

Commit

Permalink
Use ValidateBundlePath for setup command
Browse files Browse the repository at this point in the history
As of now there is no warning as part of setup if specified bundle
doesn't correspond to the expected one. This patch uses ValidateBundlePath
which validate user's specify bundle patch  and also let user
know if the bundle is in used, different from the expected one.

```
$ ./crc setup -b ~/.crc/cache/crc_libvirt_4.10.22_amd64.crcbundle
WARN Using crc_libvirt_4.10.22_amd64.crcbundle bundle, but crc_libvirt_4.11.0_amd64.crcbundle is expected for this release

$ ./crc config set bundle ~/.crc/cache/crc_libvirt_4.10.22_amd64.crcbundle
WARN Using crc_libvirt_4.10.22_amd64.crcbundle bundle, but crc_libvirt_4.11.0_amd64.crcbundle is expected for this release
Successfully configured bundle to /home/prkumar/.crc/cache/crc_libvirt_4.10.22_amd64.crcbundle
```
  • Loading branch information
praveenkumar committed Sep 13, 2022
1 parent e16d1ad commit 46f26c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/crc/cmd/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func runSetup(arguments []string) error {
}

if !config.Get(crcConfig.Bundle).IsDefault {
if err := validation.ValidatePath(config.Get(crcConfig.Bundle).AsString()); err != nil {
if err := validation.ValidateBundlePath(config.Get(crcConfig.Bundle).AsString(), crcConfig.GetPreset(config)); err != nil {
return err
}
}
Expand Down

0 comments on commit 46f26c8

Please sign in to comment.