Explorar o código

Remove bind options when creating a volume type

Signed-off-by: Joana Hrotko <[email protected]>
Joana Hrotko hai 1 ano
pai
achega
41df35c1f4
Modificáronse 1 ficheiros con 2 adicións e 7 borrados
  1. 2 7
      pkg/compose/create.go

+ 2 - 7
pkg/compose/create.go

@@ -1067,7 +1067,7 @@ func buildMount(project types.Project, volume types.ServiceVolumeConfig) (mount.
 		}
 	}
 
-	bind, vol, tmpfs := buildMountOptions(project, volume)
+	bind, vol, tmpfs := buildMountOptions(volume)
 
 	volume.Target = path.Clean(volume.Target)
 
@@ -1087,7 +1087,7 @@ func buildMount(project types.Project, volume types.ServiceVolumeConfig) (mount.
 	}, nil
 }
 
-func buildMountOptions(project types.Project, volume types.ServiceVolumeConfig) (*mount.BindOptions, *mount.VolumeOptions, *mount.TmpfsOptions) {
+func buildMountOptions(volume types.ServiceVolumeConfig) (*mount.BindOptions, *mount.VolumeOptions, *mount.TmpfsOptions) {
 	switch volume.Type {
 	case "bind":
 		if volume.Volume != nil {
@@ -1104,11 +1104,6 @@ func buildMountOptions(project types.Project, volume types.ServiceVolumeConfig)
 		if volume.Tmpfs != nil {
 			logrus.Warnf("mount of type `volume` should not define `tmpfs` option")
 		}
-		if v, ok := project.Volumes[volume.Source]; ok && v.DriverOpts["o"] == types.VolumeTypeBind {
-			return buildBindOption(&types.ServiceVolumeBind{
-				CreateHostPath: true,
-			}), nil, nil
-		}
 		return nil, buildVolumeOptions(volume.Volume), nil
 	case "tmpfs":
 		if volume.Bind != nil {