Skip to content

Commit 68e4237

Browse files
committed
vz: return err if linuxBootLoader() returns error other than os.ErrNotExist
Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
1 parent df917d2 commit 68e4237

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/vz/vm_darwin.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,9 +682,11 @@ func getMachineIdentifier(driver *driver.BaseDriver) (*vz.GenericMachineIdentifi
682682
}
683683

684684
func bootLoader(driver *driver.BaseDriver) (vz.BootLoader, error) {
685-
// ignore the error it might be a non-existing kernel file
686-
if linuxBootLoder, _ := linuxBootLoader(driver); linuxBootLoder != nil {
685+
linuxBootLoder, err := linuxBootLoader(driver)
686+
if linuxBootLoder != nil {
687687
return linuxBootLoder, nil
688+
} else if !errors.Is(err, os.ErrNotExist) {
689+
return nil, err
688690
}
689691

690692
efiVariableStore, err := getEFI(driver)

0 commit comments

Comments
 (0)