mount: add BindOptions.NonRecursive (API v1.40)#38003
Conversation
7e55bd0 to
50f54ca
Compare
Codecov Report
@@ Coverage Diff @@
## master #38003 +/- ##
=========================================
Coverage ? 35.92%
=========================================
Files ? 610
Lines ? 45473
Branches ? 0
=========================================
Hits ? 16337
Misses ? 26897
Partials ? 2239 |
|
ping @justincormack @kolyshkin ptal |
thaJeztah
left a comment
There was a problem hiding this comment.
Left some comments about the API changes; I'm not too familiar with the actual changes for mounting, so I'll leave that to @cpuguy83 and @kolyshkin
docs/api/version-history.md
Outdated
There was a problem hiding this comment.
Can you also mention;
GET /containers/<id>/jsonGET /containers/json
And when swarmkit changes are done;
POST /services/createPOST /services/{id}/updateGET /servicesGET /services/{id}
api/types/mount/mount.go
Outdated
There was a problem hiding this comment.
Does omitempty actually work for a bool (not a pointer)? If not; perhaps we should make it a pointer so that it can be kept empty (and we can distinguish false from not set)
We should also make sure that this option is ignored on older API versions; i.e., if a request is sent to API version < 1.40, the NoRecursive option should be set to nil (or false); similar to
moby/api/server/router/container/container_routes.go
Lines 463 to 466 in 8e610b2
Same for createService;
moby/api/server/router/swarm/cluster_routes.go
Lines 189 to 195 in 9f296d1
And for updateService;
moby/api/server/router/swarm/cluster_routes.go
Lines 232 to 238 in 9f296d1
There was a problem hiding this comment.
Does omitempty actually work for a bool (not a pointer)?
Seems yes
|
Updated PR. (Swarm-mode will be separate PR) |
50f54ca to
f18d34b
Compare
0c71dfc to
d9f5a2a
Compare
|
thanks, rebased |
824e04c to
42ad996
Compare
|
renamed to |
thaJeztah
left a comment
There was a problem hiding this comment.
Thanks @AkihiroSuda - I left some comments.
Erm... (not gonna make myself popular with you 😅) I was just recalling a discussion we had on another PR about options for tmpfs. (this PR: #36720)
Thinking now if we should have a dedicated boolean for this in the API, or take the same approach as was used in that PR.
@AkihiroSuda @cpuguy83 @kolyshkin wdyt?
I feel this PR is really specific to |
This allows non-recursive bind-mount, i.e. mount(2) with "bind" rather than "rbind". Swarm-mode will be supported in a separate PR because of mutual vendoring. Signed-off-by: Akihiro Suda <[email protected]>
|
updated |
42ad996 to
596cdff
Compare
| } | ||
|
|
||
| func TestContainerBindMountNonRecursive(t *testing.T) { | ||
| skip.If(t, testEnv.DaemonInfo.OSType != "linux" || testEnv.IsRemoteDaemon()) |
There was a problem hiding this comment.
Could probably get rid of the remote daemon check if we do all the mounting in a container with shared propagation.
There was a problem hiding this comment.
Could you be more specific? Do you mean DIND?
thaJeztah
left a comment
There was a problem hiding this comment.
LGTM after @cpuguy83's comment https://github.com/moby/moby/pull/38003/files#r231328643 is addressed (but I'd be ok with keeping that for a follow-up)
|
Yeah LGTM as is. |
From moby/moby#38003 Signed-off-by: Akihiro Suda <[email protected]>
|
Swarmkit PR: moby/swarmkit#2780 |
From moby/moby#38003 Signed-off-by: Akihiro Suda <[email protected]>
From moby/moby#38003 Signed-off-by: Akihiro Suda <[email protected]>
From moby/moby#38003 Signed-off-by: Akihiro Suda <[email protected]>
Full diff: moby/swarmkit@8af8c42...1a0ebd4 relevant changes: - swarmkit#2771 Allow using Configs as CredentialSpecs - swarmkit#2804 Make Service.UpdateStatus non-ambiguous - swarmkit#2805 Refactor condition in restart supervisor - swarmkit#2780 api: add BindOptions.NonRecursive - related to moby#38003 - swarmkit#2790 Fix possible panic if NetworkConfig is nil - swarmkit#2797 Include old error-message for backward compatibility - related to swarmkit#2779 / moby#38140 / moby#38142 Signed-off-by: Sebastiaan van Stijn <[email protected]>
|
PR for Swarm-mode: #38788 |
Full diff: moby/swarmkit@8af8c42...1a0ebd4 relevant changes: - swarmkit#2771 Allow using Configs as CredentialSpecs - swarmkit#2804 Make Service.UpdateStatus non-ambiguous - swarmkit#2805 Refactor condition in restart supervisor - swarmkit#2780 api: add BindOptions.NonRecursive - related to moby#38003 - swarmkit#2790 Fix possible panic if NetworkConfig is nil - swarmkit#2797 Include old error-message for backward compatibility - related to swarmkit#2779 / moby#38140 / moby#38142 Signed-off-by: Sebastiaan van Stijn <[email protected]>
This allows non-recursive bind-mount, i.e. mount(2) with "bind" rather than "rbind".
Signed-off-by: Akihiro Suda [email protected]
- What I did
Support non-recursive bind-mount.
Related to #37838 .
- How I did it
NonRecursivetoBindOptions.- How to verify it
CLI: docker/cli#1430
- Description for the changelog
mount: add BindOptions.NonRecursive (API v1.40)
- A picture of a cute animal (not mandatory but encouraged)
https://upload.wikimedia.org/wikipedia/commons/2/28/Kaiserpinguine_mit_Jungen.jpg