From 41df35c1f438ca4308c876142a82a1af0b24d091 Mon Sep 17 00:00:00 2001 From: Joana Hrotko Date: Tue, 1 Oct 2024 15:07:44 +0100 Subject: [PATCH] Remove bind options when creating a volume type Signed-off-by: Joana Hrotko --- pkg/compose/create.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pkg/compose/create.go b/pkg/compose/create.go index f4178d6af7..e7626830ce 100644 --- a/pkg/compose/create.go +++ b/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 {