Skip to content

Commit 05b883b

Browse files
committed
mounts/validate: Don't check source exists with CreateMountpoint
Don't error out when mount source doesn't exist and mounts has `CreateMountpoint` option enabled. Signed-off-by: Paweł Gronowski <[email protected]>
1 parent 3865c63 commit 05b883b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

volume/mounts/linux_parser.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ func (p *linuxParser) validateMountConfigImpl(mnt *mount.Mount, validateBindSour
8585
if err != nil {
8686
return &errMountConfig{mnt, err}
8787
}
88-
if !exists {
88+
89+
createMountpoint := mnt.BindOptions != nil && mnt.BindOptions.CreateMountpoint
90+
if !exists && !createMountpoint {
8991
return &errMountConfig{mnt, errBindSourceDoesNotExist(mnt.Source)}
9092
}
9193
}

0 commit comments

Comments
 (0)