Conversation
|
@thaJeztah I have created a new PR from #35159 to try and fix the tests, but I am slightly confused by the orignal fix. On diff --git a/volume/mounts/windows_parser.go b/volume/mounts/windows_parser.go
index ac610440436a..2ba9f0daedab 100644
--- a/volume/mounts/windows_parser.go
+++ b/volume/mounts/windows_parser.go
@@ -251,10 +251,7 @@ func (p *windowsParser) validateMountConfigReg(mnt *mount.Mount, destRegex strin
if err != nil {
return &errMountConfig{mnt, err}
}
- if !exists {
- return &errMountConfig{mnt, errBindSourceDoesNotExist(mnt.Source)}
- }
- if !isdir {
+ if exists && !isdir {
return &errMountConfig{mnt, fmt.Errorf("source path must be a directory")}
}But don't we have the same check in for Would love some guideince! 🙇 |
|
Hm, interesting; I'd have to dig a bit, but could it be that the original PR was actually changing the wrong API? (i.e. the @cpuguy83 you're more familiar with these; perhaps you can point faster to the right location for the change? |
|
Hm, good point; that would explain yes. Looking if this is where that's happening (but not clear yet where the difference is made between windows and linux 🤔 ); Lines 144 to 163 in b3e9f7b |
|
Ok, I think I understand what is happening now. Inside of moby/volume/mounts/linux_parser.go Lines 84 to 89 in e78a3dc When I would imagine we want the same logic for windows is that correct for |
Yes, the intent of the original PR was to make |
@thaJeztah understood, but we need to add the extra check to see if it's a |
|
Right, yes, |
|
Both are supported on both platforms. The only thing that needs to change is to coelesce the handling for when the host directory doesn't exist when "-v" is used. |
287ec46 to
bf1a422
Compare
|
Please sign your commits following these rules: $ git clone -b "create-dirctory-on-host-for-windows" [email protected]:steveazz/moby.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842354568008
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -fAmending updates the existing PR. You DO NOT need to open a new one. |
bf1a422 to
f061263
Compare
|
@cpuguy83 @thaJeztah I think this is ready to review can one of you take a look, appreciate any feedback! 🙇 |
|
I see the following failures for pwerpc build, which I am not sure it is related. Is that expected to fail? |
|
There are some legit test failures that I need to look at |
f061263 to
f656e1f
Compare
Codecov Report
@@ Coverage Diff @@
## master #38465 +/- ##
=========================================
Coverage ? 36.61%
=========================================
Files ? 608
Lines ? 45178
Branches ? 0
=========================================
Hits ? 16541
Misses ? 26350
Partials ? 2287 |
e398eff to
c3c28ae
Compare
|
Ok, the final failure is not related to this PR and I am not sure if it should be fixed or removed altogether. Looking at the failure below: Looking a bit closer, it's this specific case that is failing. After checking out master, the error that is returned is Inside windowsDetectMountType we try and figure out what mount type it is, by taking the source, which in this case ends up being What is the best way to procced with this? |
|
@cpuguy83 I hope I am not genearting noise for you, but mind if you review this one? |
|
@steveazz It looks like the test was passing for invalid reasons before the change. |
563e403 to
bb5e756
Compare
|
I updated the tests so at least it's easier to tell what is going on when it fails. |
|
Still need to deal with making sure dir -> named pipe fails (I'm assuming this should not be allowed... /cc @jhowardmsft) |
|
Hi, just wondering if and when this will be solved. Can anyone give an update? |
|
@tallandtree there is one comment from me in #38465 (comment) that I'd like guidance on so we get the CI green after that it should be ready for review. |
|
Let me try getting this discussed in the maintainers meeting / review session (I might have another look at it before that). In the meantime; could you rebase this PR? We replaced our CI with a new Jenkins, so it would be helpful to have it up to date, and have a fresh run of CI |
Sure, I will try and find time to update it this week! |
fcea52d to
60f63c8
Compare
|
Ok I've updated an update the fixes the failure for |
On Linux, volume binding creates the directory on the host. This conditional check on Windows was preventing Windows Containers from creating the directory producing inconsistent behavior between platforms. Signed-off-by: Steve Azzopardi <[email protected]>
0329d36 to
df5800a
Compare
Add a new check to validate if the source path of the volume binding exists. This is a is not always validated since in `ParseMountRaw` we don't want to validate this. This brings feature parity between the Linux parse and Windows parser, where a directory is created if the source path doesn't exists. Signed-off-by: Steve Azzopardi <[email protected]>
For consistency, testtability and reuseability sake move the string to a func that returns a formatted error. Signed-off-by: Steve Azzopardi <[email protected]>
Create a new mock specific for the test `TestValidateMount` which returns `exist` to `false` only when it's equal to `testSourcePathDoesNotExist` so that the validation is done correctly. Signed-off-by: Steve Azzopardi <[email protected]>
Signed-off-by: Brian Goff <[email protected]>
When the mount type is set to `bind` check that the target is not a named pipe. Signed-off-by: Steve Azzopardi <[email protected]>
df5800a to
e0293f3
Compare
|
@thaJeztah I managed to make the pipeline green 🎉 I had to refactor the initial implementation a bit to make it successful and not modify any existing logic. I'm not 100% sure about the code quality, I welcome any feedback! |
|
Going to close this PR for now since it seems like we lost traction on this! However feel free to re-use my code if you need this! |

On Linux, volume binding creates the directory on the host. This
conditional check on Windows was preventing Windows Containers from
creating the directory producing inconsistent behavior between
platforms.
- What I did
Removed the hard check if the directory exists on the host in mount config validation.
- How I did it
Changed the condition logic.
- How to verify it
Mount a volume to a directory that does not exist on the host. It should be created and not throw an error.
- Description for the changelog
Remove feature parity between Linux & Windows when mounting directory that doesn't already exist.
- A picture of a cute animal (not mandatory but encouraged)
Cute gopher