Skip to content

Commit 279c1aa

Browse files
authored
Merge pull request #3595 from songponssw/log-exist-dir
Fix logging non-existent path
2 parents 3998c63 + 63c8912 commit 279c1aa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/limayaml/validate.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ func Validate(y *LimaYAML, warn bool) error {
163163
if !errors.Is(err, os.ErrNotExist) {
164164
errs = errors.Join(errs, fmt.Errorf("field `mounts[%d].location` refers to an inaccessible path: %q: %w", i, f.Location, err))
165165
}
166+
if warn {
167+
logrus.Warnf("field `mounts[%d].location` refers to a non-existent directory: %q:", i, f.Location)
168+
}
166169
} else if !st.IsDir() {
167170
errs = errors.Join(errs, fmt.Errorf("field `mounts[%d].location` refers to a non-directory path: %q: %w", i, f.Location, err))
168171
}

0 commit comments

Comments
 (0)