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
Add --cluster flag for filtering by cluster #1309
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patch LGTM, requesting change for a test func
to be added for this new flag.
Also there is a potential incompatibility with the node-name
flag, e.g.
hubble observe --cluster foo --node-name bar/cilium
Ideally we would check for this in the same fashion we do for e.g. the --from-namespace
--from-pod
since the "format" is the same (i.e. slash separated), but IMO non-blocking as --node-name
is less useful than --{from,to}-pod
and likewise for --cluster
vs --{from,to}-namespace
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As is I think the following does something unexpected
hubble observe --cluster foo --node-name bar
I'd expect it to show me all flows related to node bar
on cluster foo
, but it'll show all flows on cluster foo
as well as flows on node bar
in any cluster.
So, I agree we should probably make --cluster
incompatible with --node-name
or implement the same logic I added for namespaces in #1279. But I think just making the flags incompatible should be good enough.
Hmm, good point. I had considered making them conflict, but found they seemed fine when using both flags to filter by cluster, but I didn't think about filtering by cluster + node, so I can see the possible confusing behavior. I'll update the PR. |
This is just a short-cut to `--node-name <cluster-name>/` but should make it more easier for users to filter by cluster, since many users are not aware the cluster name is part of the node name field on a flow. Signed-off-by: Chance Zibolski <chance.zibolski@gmail.com>
5dd20c6
to
d5e5338
Compare
This is just a short-cut to
--node-name <cluster-name>/
but should make it more easier for users to filter by cluster, since many users are not aware the cluster name is part of the node name field on a flow.