introduce workingdir option for docker exec#35661
Conversation
Signed-off-by: Nicolas De Loof <[email protected]>
|
I've ran |
|
Design LGTM |
yongtang
left a comment
There was a problem hiding this comment.
looks good to me, though can you add a test for it?
c259609 to
0ef331f
Compare
vdemeester
left a comment
There was a problem hiding this comment.
Design LGTM
/cc @thaJeztah @dnephin
dnephin
left a comment
There was a problem hiding this comment.
Thanks, couple comments about the test.
There was a problem hiding this comment.
exec is not a component (see https://github.com/moby/moby/tree/master/api/server/router). The component is container so this should go in integration/container.
There was a problem hiding this comment.
ok, I can move this to container.
There was a problem hiding this comment.
We shouldn't write an integration test for option. How about just making this TestExec() and we can add a bunch of fields to this single test.
There was a problem hiding this comment.
Do you mean you prefer a single, huge test to check all options and their correct behaviour ? Won't this make it harder to diagnose a build failure with a clear cause ?
There was a problem hiding this comment.
It shouldn't be any harder if the failure messages are written correctly.
If there are options that conflict with each other, or that significantly change the behaviour of other options then multiple tests might be necessary, but I don't think that's the case here. Most of the options are independent, and we don't need to run multiple extremely slow tests to check each independent option.
There was a problem hiding this comment.
right, but testing workdir require to set a custom command executed, while testing other options like env will require to run /bin/env, etc...
There was a problem hiding this comment.
fair point. For those two cases I think env works for both, since PWD should be set. Is that right?
|
@dnephin PR was updated 👍 |
There was a problem hiding this comment.
This cleanup is automatically handled by defer setupTest(t)() but I guess it doesn't hurt to have it, other than it might encourage others to add unnecessary cleanup to new tests.
thaJeztah
left a comment
There was a problem hiding this comment.
changes LGTM, but can you squash your commits (where needed)? Also while doing so, perhaps you can address @dnephin's nit https://github.com/moby/moby/pull/35661/files#r155046183
Then we can merge; if you can prepare a PR for the docker/cli it may just make it for 17.12
Signed-off-by: Nicolas De Loof <[email protected]>
|
commits squashed |
|
oh! looks like there's an issue with the Swagger definition; |
|
@thaJeztah yes, this happened on a regular basis on this PR, I can't explain why. Used to re-run janky build with rebuild/janky tag. |
Yes, definitely! I actually started building from this PR to check what the diff was, but I'm currently on super-slow-hotel-wifi, and just emptied my image cache before I left the office 😂 Let me trigger CI again to see if it resolves itself 👍 |
Signed-off-by: Nicolas De Loof [email protected]
- What I did
Implemented
WorkingDirsupport for execs, as discussed on #8917- How I did it
introduced WorkingDir in API and used for new process to be ran, falling back to container's WorkingDir if not set.
- How to verify it
Need to forge API call or use client package
- Description for the changelog
Introduce option to configure woking directory to run additional process in a container with
exec- A picture of a cute animal (not mandatory but encouraged)