This repository was archived by the owner on Nov 27, 2023. It is now read-only.
when bind mount has CreateHostPath set, use bind API#1604
Merged
ndeloof merged 1 commit intodocker-archive:mainfrom Apr 28, 2021
Merged
when bind mount has CreateHostPath set, use bind API#1604ndeloof merged 1 commit intodocker-archive:mainfrom
ndeloof merged 1 commit intodocker-archive:mainfrom
Conversation
45c0552 to
393e5aa
Compare
Signed-off-by: Nicolas De Loof <[email protected]>
gtardif
reviewed
Apr 28, 2021
| binds = append(binds, fmt.Sprintf("%s:%s:rw", m.Source, m.Target)) | ||
| volumeMounts[m.Target] = struct{}{} | ||
| // `Bind` API is used when host path need to be created if missing, `Mount` is preferred otherwise | ||
| if m.Type == mount.TypeBind { |
Contributor
There was a problem hiding this comment.
To confirm: so we keep "bind" mounts only in the case of "createHostPath == true", otherwise default to the mount API even when m.Type == mount.TypeBind, is this correct ?
Collaborator
Author
There was a problem hiding this comment.
yes indeed, which will only happen if user did define an explicit mount with full syntax,
... which is probably less than 1% usages, everybody just uses source:target short syntax
gtardif
approved these changes
Apr 28, 2021
This was referenced May 17, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
Use
bindwhen volume definition require host path to be created when missing, which isn't supported bymountCloses #1543
Supersede #1563
https://docker.atlassian.net/browse/IL-79