-
Notifications
You must be signed in to change notification settings - Fork 5.4k
prefer bind API #12734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prefer bind API #12734
Conversation
@@ -874,8 +866,8 @@ func (s *composeService) buildContainerVolumes( | |||
v := findVolumeByTarget(service.Volumes, m.Target) | |||
vol := findVolumeByName(p.Volumes, m.Source) | |||
if v != nil && vol != nil { | |||
if _, ok := vol.DriverOpts["device"]; ok && vol.Driver == "local" && vol.DriverOpts["o"] == "bind" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed this earlier fix, as with volumeRequiresMountAPI
we will prefer bind
for all volumes without advanced mount options, not just those created with o=bind
@@ -838,13 +837,7 @@ func (s *composeService) buildContainerVolumes( | |||
var mounts []mount.Mount | |||
var binds []string | |||
|
|||
img := api.GetImageNameOrDefault(service, p.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to buildContainerMountOptions
as this is only used when we manage anonymous volumes inheritance (allows to write test without a useless API call/mock)
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
5ba1af3
to
d5753b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@ndeloof Will this fix be available in 2.36.0 release? |
@vg22 the issue should be fixed in the latest |
What I did
Always prefer
bind
API for volumes overmount
when not required.added a test case to check various combinations
Related issue
test to prevent regression reported on #12121
(not mandatory) A picture of a cute animal, if possible in relation to what you did