Skip to content

Commit ad5b945

Browse files
authored
Merge pull request #2777 from afbjorklund/vz-identifier
Don't look for vz-identifier on other systems
2 parents 0da8964 + d386e14 commit ad5b945

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

pkg/limayaml/defaults.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,12 +1008,16 @@ func ResolveVMType(y, d, o *LimaYAML, filePath string) VMType {
10081008

10091009
// If this is an existing instance, guess the VMType from the contents of the instance directory.
10101010
if dir, basename := filepath.Split(filePath); dir != "" && basename == filenames.LimaYAML && isExistingInstanceDir(dir) {
1011-
vzIdentifier := filepath.Join(dir, filenames.VzIdentifier) // since Lima v0.14
1012-
if _, err := os.Lstat(vzIdentifier); !errors.Is(err, os.ErrNotExist) {
1013-
logrus.Debugf("ResolveVMType: resolved VMType %q (existing instance, with %q)", VZ, vzIdentifier)
1014-
return VZ
1011+
if runtime.GOOS == "darwin" {
1012+
vzIdentifier := filepath.Join(dir, filenames.VzIdentifier) // since Lima v0.14
1013+
if _, err := os.Lstat(vzIdentifier); !errors.Is(err, os.ErrNotExist) {
1014+
logrus.Debugf("ResolveVMType: resolved VMType %q (existing instance, with %q)", VZ, vzIdentifier)
1015+
return VZ
1016+
}
1017+
logrus.Debugf("ResolveVMType: resolved VMType %q (existing instance, without %q)", QEMU, vzIdentifier)
1018+
return QEMU
10151019
}
1016-
logrus.Debugf("ResolveVMType: resolved VMType %q (existing instance, without %q)", QEMU, vzIdentifier)
1020+
logrus.Debugf("ResolveVMType: resolved VMType %q (existing instance)", QEMU)
10171021
return QEMU
10181022
}
10191023

0 commit comments

Comments
 (0)