Skip to content
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

podman wait accept args > 1 #7630

Merged
merged 1 commit into from
Sep 15, 2020

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Sep 14, 2020

Fixes #7627

@rhatdan
Copy link
Member

rhatdan commented Sep 14, 2020

LGTM

@Luap99 Luap99 force-pushed the wait-n-args branch 2 times, most recently from 9c704a5 to 3ff60b2 Compare September 14, 2020 19:29
Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before we go through with this: do we really, really want this? I see this as a huge can of worms: how exactly is multi-wait defined? Is it AND or OR? Right now it looks like it's sequential AND:

$ ./bin/podman run -d --name foo1 ... sleep 90
$ !!:gs/90/5/
$ ./bin/podman wait foo1 foo2      (hangs for ~90 seconds with no output)
0
0

If this is truly the desired behavior -- and it might not be, because I for one was expecting "wait for any one of these" -- I believe it should be clearly documented in the man page.

I would encourage is all to step back and maybe consider saying "podman wait takes exactly one argument".

@Luap99
Copy link
Member Author

Luap99 commented Sep 14, 2020

@edsantiago
Copy link
Member

@Luap99 thanks but that's still an unhelpful description: it does not specify how the exit codes are emitted (by command-line order? by order of which exited first?) Whether or not this approach is desired, that whole description needs a lot of work.

@Luap99
Copy link
Member Author

Luap99 commented Sep 14, 2020

@edsantiago A quick test shows it will print in the same order as the given containers and will only print the exit codes after all containers exited.

$ bin/podman run --name 1 -d alpine sh -c "sleep 20; exit 1"
e1e6c2be23ccab5f85aa575d35c9f3b6726b1c97f1d277f5a28ac340d2a9fc0b
$ bin/podman run --name 2 -d alpine sh -c "sleep 10; exit 2"
354adb8744b4433466fcf2e16e68b093cfc8f42a8eb3effd8f95de593e0e3791
$ bin/podman wait 1 2
1
2
$ bin/podman rm 1 2
354adb8744b4433466fcf2e16e68b093cfc8f42a8eb3effd8f95de593e0e3791
e1e6c2be23ccab5f85aa575d35c9f3b6726b1c97f1d277f5a28ac340d2a9fc0b
$ bin/podman run --name 1 -d alpine sh -c "sleep 20; exit 1"
069d21ada22bdf464d29fff5faa238b343485d9db93e25b43ae302064545bc6a
$ bin/podman run --name 2 -d alpine sh -c "sleep 10; exit 2"
8d0b2f7482017a8e98e5a3d247e11c9ddf12bed6e21719164af194e553cf2d19
$ bin/podman wait 2 1 
2
1

@edsantiago
Copy link
Member

A quick test shows it will print in the same order as the given containers and will only print the exit codes after all containers exited.

Understood; that was my experience as well. My point is, this should be clearly and unambiguously documented in the man page.

@Luap99
Copy link
Member Author

Luap99 commented Sep 14, 2020

@edsantiago @rhatdan PTAL
I have updated the man page.

Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orthographic nit. Aside from that, if this truly is the desired behavior for wait, it lgtm.

docs/source/markdown/podman-wait.1.md Outdated Show resolved Hide resolved
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: edsantiago, Luap99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 14, 2020
@mheon
Copy link
Member

mheon commented Sep 15, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 15, 2020
@openshift-merge-robot openshift-merge-robot merged commit 5c47a33 into containers:master Sep 15, 2020
edsantiago added a commit to edsantiago/libpod that referenced this pull request Sep 15, 2020
PR containers#7633 disallowed "-l" (--latest) with container args.

PR containers#7630 made changes to the "podman wait" command. The error
message it issues is inconsistent (and incompatible) with
the one required by the new BATS --help test. Fix that.

This is entirely my fault. I was aware of containers#7630, and I was
careful to check the output message format, but I was not
careful enough (I trusted my eyes, not my code).

Signed-off-by: Ed Santiago <santiago@redhat.com>
@Luap99 Luap99 deleted the wait-n-args branch November 19, 2020 20:34
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: podman wait accepts at most one argument
7 participants