Skip to content

Commit dd8968b

Browse files
authored
Merge pull request #842 from rancher-sandbox/instdir
Make sure inst.Dir is set when store.Inspect returns no error
2 parents 2e97e75 + 611c294 commit dd8968b

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)