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

observe: Document default flow count output #318

Merged
merged 1 commit into from
Jul 14, 2020

Conversation

joestringer
Copy link
Member

I couldn't tell from the help text what the intended default was here,
but there seems to be some special logic to try to ensure that the
number of flows is only restricted when no other selector parameters are
specified. Manually add the default string at the end so that we don't
have to restrict the number of flows to 20 by default when specifying
other selector criteria, but it's still apparent what the default
behaviour is.

I couldn't tell from the help text what the intended default was here,
but there seems to be some special logic to try to ensure that the
number of flows is only restricted when no other selector parameters are
specified. Manually add the default string at the end so that we don't
have to restrict the number of flows to 20 by default when specifying
other selector criteria, but it's still apparent what the default
behaviour is.

Signed-off-by: Joe Stringer <joe@cilium.io>
@joestringer joestringer added ⌨️ area/cli Impacts the command line interface of any command in the repository. release-note/misc This PR makes changes that have no direct user impact. labels Jul 13, 2020
@glibsm
Copy link
Member

glibsm commented Jul 13, 2020

last and since|until are mutually exclusive. Even if you provide other filters such as --from-ip=12.31.231.23, you will still only get back 20.

That said I think your approach is ok to use here instead of the default helpers for cobra since we'd like to know if the user actually set it to 20, or that's just the default (makes error handling easier without propagating the default value everywhere).

@joestringer
Copy link
Member Author

last and since|until are mutually exclusive. Even if you provide other filters such as --from-ip=12.31.231.23, you will still only get back 20.

Ah cool, I wasn't sure but I figured I'd go for the minimal change here since I'm sure it was written this way for a reason.

@rolinh rolinh merged commit 3f425a5 into cilium:master Jul 14, 2020
@joestringer joestringer deleted the submit/last-help branch July 14, 2020 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⌨️ area/cli Impacts the command line interface of any command in the repository. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants