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

Fix podman --noout to suppress all output #16518

Merged
merged 1 commit into from
Nov 15, 2022

Conversation

ashley-cui
Copy link
Member

Podman --noout was not suppressing output from commands that do not create the podman engine. Now, podman --noout properly suppresses output from every command.

Fixes: #16201

Signed-off-by: Ashley Cui [email protected]

Does this PR introduce a user-facing change?

Fixed a bug where `podman --noout` was not suppressing output from certain commands such as `podman machine` and `podman system connection`

Podman --noout was not suppressing output from commands that do not
create the podman engine. Now, podman --noout properly suppresses output
from every command.

Fixes: containers#16201

Signed-off-by: Ashley Cui <[email protected]>
@openshift-ci openshift-ci bot added release-note approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 15, 2022
@ashley-cui
Copy link
Member Author

ashley-cui commented Nov 15, 2022

Little background: Commands that do not create the podman engine do not run PersistentPreRunE, so we have to do this in a hook. I think it should be safe to remove the NoOut field from pkg/domain/entities since it's not used or consumed anywhere else in the codebase other than in cmd/podman (functionally was a NoOp). This avoids an expensive registry.PodmanConfig() from inside the hook.

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM

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.

One nit, not a blocker. Also, while learning about --nout, I found this in podman.1.md:

Redirect stdout to /dev/null. This command will prevent all stdout from the Podman command. The --noout option will not block stderr or stdout from containers.

(emphasis mine). Should be option, not command. And the phrasing is clumsy, could be collapsed to "from the Podman command but will not block ...". Again, only if you need to re-push for other reasons.

@@ -232,4 +232,10 @@ See 'podman version --help'" "podman version --remote"
is "$output" "Setting --log-level and --debug is not allowed"
}

# Tests --noout for commands that do not enter the engine
@test "podman --noout properly supresses output" {
run_podman --noout system connection ls
Copy link
Member

Choose a reason for hiding this comment

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

Wrong indentation, but not worth re-pushing for. (If you need to re-push for any reason, though, please fix it)

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 15, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ashley-cui, edsantiago

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:
  • OWNERS [ashley-cui,edsantiago]

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

@rhatdan
Copy link
Member

rhatdan commented Nov 15, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 15, 2022
@openshift-merge-robot openshift-merge-robot merged commit 54b1fd3 into containers:main Nov 15, 2022
@ashley-cui ashley-cui deleted the noout branch February 9, 2023 20:10
@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 10, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 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. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Podman --noout does not suppress machine command output
5 participants