-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Added the "--out" parameter and fixed an issue with "--noout" which prevented stdout from being written to. #18657
Conversation
… by various commands Commands like podman-create(1), podman-run(1), podman-inspect(1), podman-ps(1) will emit formatted output upon success. This allows the output from commands to be emitted directly to a file and can supersede the --noout parameter by using /dev/null. An issue with --noout was also remedied. This closes issue containers#18120. Signed-off-by: Ali Rizvi-Santiago <[email protected]>
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.
Thank you for your PR! A few quick suggestions and requests from a very quick pass. Also, please collapse your commits.
80768b6
to
c036081
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.
I am not a huge fan of these kind of options but I won't block over it. Is there a reason to do stdout only but not for stderr, seems inconsistent?
Please squash the commits into one and where say add unit test it should really say system test as these are not unit tests.
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.
Thanks again. And please remember to squash your commits.
Awesome. All the tests passed, re-requesting review. (Do at your leisure). |
@arizvisa could you please squash your commits? And please remove unnecessary tests. There is no need for so many tests. (I can't believe I'm saying that!) |
65ce994
to
55a7d3f
Compare
… requires rootless. Signed-off-by: Ali Rizvi-Santiago <[email protected]>
squashed and included as many suggestions as you gave input on. |
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.
I wonder if we should just hide --noout now that you can use --out=/dev/null
and just keep it for backwards compat.
i.e. add lFlags.MatkHidden("noout")
and remove the docs for this option.
…Luap99 in containers#18657. Signed-off-by: Ali Rizvi-Santiago <[email protected]>
7587ec9
to
bb2deef
Compare
I think it makes sense. Added your suggestions until someone suggests otherwise. |
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.
Thanks, LGTM.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: arizvisa, 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 |
/lgtm |
Where does STDERR go? Anyway to redirect it as well? |
@vans163, Which podman command are you trying to capture STDERR from specifically? Just all of podman's STDERR in general or container output? |
This adds an additional parameter, "--out", which can be used to capture the output of any part of podman. This is similar to the original "--noout", but instead of redirecting stdout to "/dev/null" it allows the user to choose the file that is being written to. Thus using the parameter as in
podman --out /dev/null ...
corresponds to the same logic. The original "--noout" parameter was left alone as I expect someone is already depending on this functionality. The original "--noout" parameter had a bug in that "/dev/null" was not being opened as writable. This results in an EBADF error being returned everytime the fd being written to gets used.The PR adds the additional parameter using the same logic as "--noout", fixes the prior-mentioned issue with "--noout", and adds testcases for each of them. To perform the test for the "--noout" error, the only symptom I could identify (without running
strace
) was that golang would complain to stderr if it couldn't write to stdout when running podman without any parameters. Hence the test is written against this symptom.This fixes issue #18120.
Does this PR introduce a user-facing change?