Skip to content

Commit 611c294

Browse files
committed
Make sure inst.Dir is set when store.Inspect returns no error
This is necessary to be able to delete instances that fail YAML validation (e.g. because they have been created using a different branch). Signed-off-by: Jan Dubois <[email protected]>
1 parent 4510d67 commit 611c294

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/store/instance.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ func Inspect(instName string) (*Instance, error) {
6565
if err != nil {
6666
return nil, err
6767
}
68+
// Make sure inst.Dir is set, even when YAML validation fails
69+
inst.Dir = instDir
6870
yamlPath := filepath.Join(instDir, filenames.LimaYAML)
6971
y, err := LoadYAMLByFilePath(yamlPath)
7072
if err != nil {
@@ -74,7 +76,6 @@ func Inspect(instName string) (*Instance, error) {
7476
inst.Errors = append(inst.Errors, err)
7577
return inst, nil
7678
}
77-
inst.Dir = instDir
7879
inst.Arch = *y.Arch
7980
inst.CPUType = y.CPUType[*y.Arch]
8081

0 commit comments

Comments
 (0)