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 parsing kubectl output with warnings #470

Merged
merged 2 commits into from
Dec 12, 2022
Merged

Conversation

usmonster
Copy link
Contributor

@usmonster usmonster commented Sep 14, 2022

Exclude stderr (e.g. deprecation warnings) when parsing command output.

What this PR does / why we need it: It ensures that warnings or other output that goes to stderr won't be parsed when trying to list deployments, pods, etc. Today, this is not the case, and many ct subcommands will fail in such situations (e.g. when the gke-gcloud-auth-plugin isn't yet installed).

Special notes for your reviewer:
It's possible that the original implementation wanted to include stderr in the output for these commands for a reason, but this feels like a simple oversight.

It's also possible that there are other similar places in the code that require the same modification, so please feel free to update the PR or request these changes, which I will then apply. Thanks!

Don't parse error output (e.g. deprecation warnings) when trying to list deployments.

Signed-off-by: Usman <[email protected]>
Signed-off-by: usmonster <[email protected]>
@usmonster usmonster marked this pull request as ready for review September 14, 2022 13:56
@usmonster usmonster changed the title Fix for getting deployments Fix parsing kubectl output with warnings Sep 14, 2022
@usmonster
Copy link
Contributor Author

Bump! @cpanato, @smlx—as recent committers on this file, can you please take a look as soon as you get a chance? 🙏 Thanks!

@usmonster
Copy link
Contributor Author

Hello, just checking in—@davidkarlsen, @scottrigby, do you think you can take a quick look at this fix and hopefully get it into the next version? Thanks again! 🙇

@davidkarlsen
Copy link
Member

I'm a bit uneasy to merge it straight as I suspect some unexpected side-effects, but I'd like @unguiculus comments as the original author. Do you remember the reasoning between getting both streams here?

@unguiculus
Copy link
Member

Maybe we should adjust RunProcessAndCaptureOutput so that it also logs the proc's stderr to stderr, so we don't swallow any errors. Otherwise, I'd be fine with this change.

@usmonster
Copy link
Contributor Author

Thanks @unguiculus! I like your suggestion as a separate PR, which could also help with #359.

Regarding @davidkarlsen's concerns, there should be no unwanted side effects since we're now only filtering stderr output that isn't currently used or expected in these cases.

Please feel free to merge if there's nothing else to change, and thanks again for the review!

@usmonster
Copy link
Contributor Author

Just a friendly bump to @davidkarlsen & @scottrigby. 🙂

Do you need anything else from me before this can be merged? Thanks again!

Copy link
Member

@davidkarlsen davidkarlsen left a comment

Choose a reason for hiding this comment

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

lgtm

@cpanato cpanato merged commit 98f96d2 into helm:main Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants