Merge pull request #1423 from aluzzardi/exec-mount-errors

exec: mount: improve error reporting on non-concrete mounts
This commit is contained in:
Andrea Luzzardi 2022-01-18 15:11:37 -08:00 committed by GitHub
commit 7a79395bd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -139,6 +139,10 @@ func (t execTask) mountAll(pctx *plancontext.Context, mounts *compiler.Value) ([
return nil, err return nil, err
} }
for _, mnt := range fields { for _, mnt := range fields {
if mnt.Value.Lookup("dest").IsConcreteR() != nil {
return nil, fmt.Errorf("mount %q is not concrete", mnt.Selector.String())
}
dest, err := mnt.Value.Lookup("dest").String() dest, err := mnt.Value.Lookup("dest").String()
if err != nil { if err != nil {
return nil, err return nil, err