Repository navigation
Fix nsenter working dir for child - #3385
Conversation
|
GEEEZ I hate nsenter. Turns out older versions do not have |
|
This is the last straw with nsenter... Can we just replace with re-exec? Any reason I should know of to be concerned about doing that? |
Yes
The complexity can be a concern. |
Signed-off-by: apostasie <[email protected]>
|
Ok. This PR here does fix my problem, and it is ready to go - CI is green. @AkihiroSuda PTAL at your convenience. (note that I am not completely sure what's going on inside nsenter - but fact is, that does fix the issue) |
Currently, we are losing the working directory after we nsenter in some circumstances.
It is not entirely clear to me why.
This is manifest in testing (for example
TestRunVolumeRelativePath) if you try to change theDirof theicmdcommand to a newly created temp directory, nerdctl will then error when trying to mount the relative path insidenerdctl/pkg/mountutil/mountutil.go
Line 172 in 1a55c72
It is not clear to me either if that would be a bug in nsenter (as I would expect
-wto still be used as a default?).Note that @fahedouch clearly had the right intuition as they suggested to change to
-Win (related) PR: #3329 (comment)This PR here was triggered by the ongoing refactoring of the
cmdpackage, as one of the incidental changes required for tests to pass after the refactoring.