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

cli: only print to stdout if it is a tty #1271

Merged
merged 1 commit into from
Mar 10, 2025
Merged

Conversation

davidweisse
Copy link
Contributor

With this PR, user-friendly messages during CLI commands like ✔️ Generated workload policy annotations are only printed if a terminal is connected. This way, the output of, e.g., contrast generate can be piped directly to kubectl apply:

contrast generate -o /dev/stdout | kubectl apply -f -

@davidweisse davidweisse added the changelog PRs that should be part of the release notes label Mar 5, 2025
@davidweisse davidweisse requested a review from burgerdev March 5, 2025 15:01
@davidweisse davidweisse force-pushed the dav/cli-discard-stdout branch 2 times, most recently from 4663d42 to 6b09535 Compare March 5, 2025 15:10
Copy link
Contributor

@burgerdev burgerdev left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

@burgerdev burgerdev added this to the v1.6.0 milestone Mar 7, 2025
@davidweisse davidweisse force-pushed the dav/cli-discard-stdout branch from 6b09535 to 8aa07c5 Compare March 10, 2025 09:49
@davidweisse davidweisse merged commit 7b4b823 into main Mar 10, 2025
10 checks passed
@davidweisse davidweisse deleted the dav/cli-discard-stdout branch March 10, 2025 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog PRs that should be part of the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants