Skip to content

Commit

Permalink
Validate: Add warning in case bundle metadata have different bundle name
Browse files Browse the repository at this point in the history
This patch will warn users in case do something following and bundle is
already extracted.

```
$ ./crc start -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
```
  • Loading branch information
praveenkumar committed Sep 13, 2022
1 parent a6d08f3 commit 0d76300
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/crc/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ func ValidateBundlePath(bundlePath string, preset crcpreset.Preset) error {

func ValidateBundle(bundlePath string, preset crcpreset.Preset) error {
bundleName := filepath.Base(bundlePath)
_, err := bundle.Get(bundleName)
bundleMetadata, err := bundle.Get(bundleName)
if err != nil {
return ValidateBundlePath(bundlePath, preset)
}
bundleMismatchWarning(bundleMetadata.GetBundleName(), preset)
/* 'bundle' is already unpacked in ~/.crc/cache */
return nil
}
Expand Down

0 comments on commit 0d76300

Please sign in to comment.