-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cwd argument for hooks exec Run func #1514
Add cwd argument for hooks exec Run func #1514
Conversation
7990d0a
to
3dcf7b3
Compare
Shouldn't we be calling this from somewhere in the code? I did not notice that they calls were all in test function. |
@rhatdan The and here https://github.com/containers/buildah/pull/4871/files I checked in the common code base, it's not called anywhere except from tests. |
5ba137e
to
48bdf46
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please squash the commits.
@vrothberg PTAL
Maybe taking a step back, is it anywhere defined what the cwd when executing hooks should be? |
That's a fair point, @Luap99. Technically, the cwd shouldn't matter and if the hook relies on this behavior it may work with Podman/crun but not other container engines. |
The only reason I created the issue is because I saw a difference between hook executable invoked by crun and podman (poststop in this case). It's a bit odd to see a bit different behaivor for the hooks. But I also understand one probably should not rely on cwd for reading I guess because before making the crun call by podman, the cwd will be set to use the bundle dir, so the hook calls coming from crun is going to be the bundle dir. But for poststop hook call, it's made by podman directly, so no explicit dir set, as a result, the current working dir of podman will be used. Please feel free to close my issues and PRs as if this is not part of the spec and not really a bug 😅 |
I think it is a good idea overall to have a stable cwd for the hooks and not depend on the cmd of the calling process. |
I agree. |
48bdf46
to
89b5dbd
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fangpenlin The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Fang-Pen Lin <[email protected]>
89b5dbd
to
e4d5dde
Compare
Close in favor of #1521 |
For fixing the wrong cwd bug in podman:
containers/podman#18907