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

hubble observe --json does not print json #602

Closed
aanm opened this issue Aug 7, 2021 · 7 comments
Closed

hubble observe --json does not print json #602

aanm opened this issue Aug 7, 2021 · 7 comments
Labels
🐛 kind/bug This is a bug in the Hubble logic.

Comments

@aanm
Copy link
Member

aanm commented Aug 7, 2021

The command hubble observe --json --last 1000 --follow --namespace default does not print json. It does print a warning that --json flag has been deprecated but the behavior is not the expected one. If a flag is deprecated the behavior should be kept until the flag is removed.

Flag --json has been deprecated, use '--output json' instead
Aug  7 23:29:01.675: default/client-f4dd54c78-k8bz8:53030 -> default/server-778bd884d6-5qrbj:8080 to-endpoint FORWARDED (TCP Flags: ACK, PSH)
Aug  7 23:29:01.676: default/client-f4dd54c78-k8bz8:53030 <- default/server-778bd884d6-5qrbj:80 to-endpoint FORWARDED (TCP Flags: ACK, PSH)
hubble --version
hubble v0.8.0
@aanm aanm added the 🐛 kind/bug This is a bug in the Hubble logic. label Aug 7, 2021
@gandro
Copy link
Member

gandro commented Aug 9, 2021

Looking at the source, it seems like the legacy flags got broken by #536 - because we now set a default value, the fallback to deprecated options got broken (this also affects --compact and --dict)

@rolinh
Copy link
Member

rolinh commented Aug 9, 2021

The flags have been deprecated since v0.5.0 release 1.5 year ago. The latest stable release is now v0.8. Should we just drop support for them at this point?

@gandro
Copy link
Member

gandro commented Aug 9, 2021

The flags have been deprecated since v0.5.0 release 1.5 year ago. The latest stable release is now v0.8. Should we just drop support for them at this point?

Yes, let's remove them.

@rolinh
Copy link
Member

rolinh commented Aug 9, 2021

Should we backport the above PR to the v0.8 branch or cook a patch for it?

@gandro
Copy link
Member

gandro commented Aug 9, 2021

Should we backport the above PR to the v0.8 branch or cook a patch for it?

If there is an easy fix (I haven't found one without changing the -o default as well), I think we should fix it on v0.8. Otherwise let's just remove the broken flags. It's not like we will be breaking anyone's v0.8 scripts by removing them, since they are already broken.

@rolinh
Copy link
Member

rolinh commented Aug 9, 2021

An easy fix is to just ignore the default output value and unconditionally set the output to the respective format when one of the old flag is provided. This means that when both --output table and --json are provided (for example), the latter will win though.
Any other fix will be a little more involved I think. However, considering the flags were already broken in v0.8 and based on your comment above, I think we should just backport the PR that removes the flags.

@rolinh
Copy link
Member

rolinh commented Oct 26, 2021

PR #603 has been backported to the v0.8 branch (#606), closing.

@rolinh rolinh closed this as completed Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 kind/bug This is a bug in the Hubble logic.
Projects
None yet
Development

No branches or pull requests

3 participants