Преглед на файлове

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 <pawel.gronowski@docker.com>
Paweł Gronowski преди 1 година
родител
ревизия
05b883bdc8
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      volume/mounts/linux_parser.go

+ 3 - 1
volume/mounts/linux_parser.go

@@ -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)}
 			}
 		}