Skip to content

Commit

Permalink
vz: add errors.Is(err, os.ErrNotExist)
Browse files Browse the repository at this point in the history
Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
  • Loading branch information
norio-nomura committed Aug 31, 2024
1 parent 569a551 commit 0347c2c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/vz/vm_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,11 @@ func linuxBootLoader(driver *driver.BaseDriver) (*vz.LinuxBootLoader, error) {
kernelCmdline := filepath.Join(driver.Instance.Dir, filenames.KernelCmdline)
initrd := filepath.Join(driver.Instance.Dir, filenames.Initrd)
if _, err := os.Stat(kernel); err != nil {
logrus.Debugf("Kernel file %q not found", kernel)
if errors.Is(err, os.ErrNotExist) {
logrus.Debugf("Kernel file %q not found", kernel)
} else {
logrus.Debugf("Error while checking kernel file %q: %v", kernel, err)
}
return nil, err
}
var opt []vz.LinuxBootLoaderOption
Expand Down

0 comments on commit 0347c2c

Please # to comment.