@@ -144,6 +144,8 @@ func Validate(y *LimaYAML, warn bool) error {
144
144
}
145
145
}
146
146
147
+ var mountWarnings []string
148
+
147
149
for i , f := range y .Mounts {
148
150
if ! filepath .IsAbs (f .Location ) && ! strings .HasPrefix (f .Location , "~" ) {
149
151
return fmt .Errorf ("field `mounts[%d].location` must be an absolute path, got %q" ,
@@ -159,6 +161,7 @@ func Validate(y *LimaYAML, warn bool) error {
159
161
if ! errors .Is (err , os .ErrNotExist ) {
160
162
return fmt .Errorf ("field `mounts[%d].location` refers to an inaccessible path: %q: %w" , i , f .Location , err )
161
163
}
164
+ mountWarnings = append (mountWarnings , fmt .Sprintf ("field `mounts[%d].location` non-existent directory: %q:" , i , f .Location ))
162
165
} else if ! st .IsDir () {
163
166
return fmt .Errorf ("field `mounts[%d].location` refers to a non-directory path: %q: %w" , i , f .Location , err )
164
167
}
@@ -180,6 +183,12 @@ func Validate(y *LimaYAML, warn bool) error {
180
183
}
181
184
}
182
185
186
+ if warn && len (mountWarnings ) > 0 {
187
+ for _ , warning := range mountWarnings {
188
+ logrus .Warn (warning )
189
+ }
190
+ }
191
+
183
192
if * y .SSH .LocalPort != 0 {
184
193
if err := validatePort ("ssh.localPort" , * y .SSH .LocalPort ); err != nil {
185
194
return err
0 commit comments