Skip to content

Commit

Permalink
mounts/validate: Don't check source exists with CreateMountpoint
Browse files Browse the repository at this point in the history
Don't error out when mount source doesn't exist and mounts has
`CreateMountpoint` option enabled.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
  • Loading branch information
vvoland committed Feb 22, 2024
1 parent f40db66 commit 8539542
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion volume/mounts/linux_parser.go
Expand Up @@ -85,7 +85,9 @@ func (p *linuxParser) validateMountConfigImpl(mnt *mount.Mount, validateBindSour
if err != nil {
return &errMountConfig{mnt, err}
}
if !exists {

createMountpoint := mnt.BindOptions != nil && mnt.BindOptions.CreateMountpoint
if !exists && !createMountpoint {
return &errMountConfig{mnt, errBindSourceDoesNotExist(mnt.Source)}
}
}
Expand Down

0 comments on commit 8539542

Please sign in to comment.