Relative symlinks don't work with --device argument#22272
Relative symlinks don't work with --device argument#22272vdemeester merged 1 commit intomoby:masterfrom
Conversation
|
@mlaventure we may want to consider including this in 1.11.1 (the follow symlinks is a new addition in 1.11.0) |
There was a problem hiding this comment.
Does os.Symlink error out if /dev/symzero already exists? if so, i dont think we should error out, because it is not impossible that the defer won't run in some weird cases. We could just print the error though and move on.
There was a problem hiding this comment.
Thanks @tiborvass just updated the pull request. Let me know if there are any other issues.
|
I'm not opposed to this PR, in fact I don't even see why we wouldn't follow absolute symlinks too. |
7731ab5 to
0608629
Compare
|
Same thought as @tiborvass so LGTM 🐼 |
|
one nit, otherwise LGTM |
There was a problem hiding this comment.
should defer os.Remove("/dev/symzero") below the if err != nil check?
36c1c37 to
a73e631
Compare
This fix tries to address the issue raised in moby#22271 where relative symlinks don't work with --device argument. Previously, the symlinks in --device was implemneted (moby#20684) with `os.Readlink()` which does not resolve if the linked target is a relative path. In this fix, `filepath.EvalSymlinks()` has been used which will reolve correctly with relative paths. An additional test case has been added to the existing `TestRunDeviceSymlink` to cover changes in this fix. This fix is related to moby#13840 and moby#20684, moby#22271. This fix fixes moby#22271. Signed-off-by: Yong Tang <[email protected]>
a73e631 to
632b314
Compare
|
LGTM |
This fix tries to address the issue raised in moby#22271 where relative symlinks don't work with --device argument. Previously, the symlinks in --device was implemneted (moby#20684) with `os.Readlink()` which does not resolve if the linked target is a relative path. In this fix, `filepath.EvalSymlinks()` has been used which will reolve correctly with relative paths. An additional test case has been added to the existing `TestRunDeviceSymlink` to cover changes in this fix. backport from: moby#22272 Signed-off-by: Yong Tang <[email protected]> Signed-off-by: Yuanhong Peng <[email protected]>
Relative symlinks don't work with --device argument This fix tries to address the issue raised in moby#22271 where relative symlinks don't work with --device argument. Previously, the symlinks in --device was implemneted (moby#20684) with `os.Readlink()` which does not resolve if the linked target is a relative path. In this fix, `filepath.EvalSymlinks()` has been used which will reolve correctly with relative paths. An additional test case has been added to the existing `TestRunDeviceSymlink` to cover changes in this fix. backport from: moby#22272 Signed-off-by: Yong Tang <[email protected]> Signed-off-by: Yuanhong Peng <[email protected]> See merge request docker/docker!348
- What I did
This fix tries to address the issue raised in #22271 where relative symlinks don't work with --device argument.
- How I did it
Previously, the symlinks in --device was implemneted (#20684) with
os.Readlink()which does not resolve if the linked target is a relative path. In this fix,filepath.EvalSymlinks()has been used which will reolve correctly with relative paths.- How to verify it
An additional test case has been added to the existing
TestRunDeviceSymlinkto cover changes in this fix.- A picture of a cute animal (not mandatory but encouraged)
This fix is related to #13840 and #20684, #22271.
This fix fixes #22271.
Signed-off-by: Yong Tang [email protected]