Skip to content

Commit

Permalink
Merge pull request #2777 from afbjorklund/vz-identifier
Browse files Browse the repository at this point in the history
Don't look for vz-identifier on other systems
  • Loading branch information
AkihiroSuda authored Oct 22, 2024
2 parents 0da8964 + d386e14 commit ad5b945
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pkg/limayaml/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -1008,12 +1008,16 @@ func ResolveVMType(y, d, o *LimaYAML, filePath string) VMType {

// If this is an existing instance, guess the VMType from the contents of the instance directory.
if dir, basename := filepath.Split(filePath); dir != "" && basename == filenames.LimaYAML && isExistingInstanceDir(dir) {
vzIdentifier := filepath.Join(dir, filenames.VzIdentifier) // since Lima v0.14
if _, err := os.Lstat(vzIdentifier); !errors.Is(err, os.ErrNotExist) {
logrus.Debugf("ResolveVMType: resolved VMType %q (existing instance, with %q)", VZ, vzIdentifier)
return VZ
if runtime.GOOS == "darwin" {
vzIdentifier := filepath.Join(dir, filenames.VzIdentifier) // since Lima v0.14
if _, err := os.Lstat(vzIdentifier); !errors.Is(err, os.ErrNotExist) {
logrus.Debugf("ResolveVMType: resolved VMType %q (existing instance, with %q)", VZ, vzIdentifier)
return VZ
}
logrus.Debugf("ResolveVMType: resolved VMType %q (existing instance, without %q)", QEMU, vzIdentifier)
return QEMU
}
logrus.Debugf("ResolveVMType: resolved VMType %q (existing instance, without %q)", QEMU, vzIdentifier)
logrus.Debugf("ResolveVMType: resolved VMType %q (existing instance)", QEMU)
return QEMU
}

Expand Down

0 comments on commit ad5b945

Please sign in to comment.