-
Notifications
You must be signed in to change notification settings - Fork 242
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 hubble list namespaces command #1086
Conversation
static check is acting starnge. It doesn't appear to pick up your function rename 🤔 |
Oh I forgot to update the tests after changing the name of a function. |
1f20eb4
to
2b110dc
Compare
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.
LGTM ✔️
The release note label is major, but I leave it to Hubble team to decide 🤔
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.
Thanks @chancez! Tested the patch and LGTM.
One thing I noticed that bugged me:
% ./hubble list namespaces -o wide
NAMESPACE CLUSTER
kube-system N/A
local-path-storage N/A
Here my cluster name is "default", but I see N/A. I wonder if we should consider removing this guard and consistently output "default" instead of empty string, although on the other hand it will go against this CFP.
cmd/observe/io_reader_observer.go
Outdated
@@ -55,6 +55,11 @@ func (o *IOReaderObserver) GetNodes(_ context.Context, _ *observerpb.GetNodesReq | |||
return nil, status.Errorf(codes.Unimplemented, "GetNodes not implemented") | |||
} | |||
|
|||
// GetNamespaces is not implemented, and will throw an error if used. |
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.
"throw" 😄
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.
I copied the existing comments 😂
@kaworu I thought about this too, but I wasn't sure if the client should be doing that or not. I kinda feel like perhaps I should be extracting the cluster name from the flows inside hubble server, and configuring the cluster name there. What do you think? |
if err != nil { | ||
return err | ||
} | ||
_, err = fmt.Fprintln(buf, string(bs)) |
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.
it's a minor nit, but i think w.Write()
here is more typical without string()
conversion
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.
This was how it was already written, I just moved which file this function was in. I believe the goal is to get a newline at the end so that when it's logged it's not on the same line as the prompt.
Can the client disambiguate between
I don't understand what you are suggesting, could you clarify? |
We don't really define anywhere how they should be treated, so it's hard to say. In the NodeNameFilter we basically treat empty as "default" for filtering purposes. But in the node_name we field we return in After writing that out, it makes me think the best option then is to just return "" instead of "N/A". What do you think?
Right now, the clusterName for a flow is determined by using nodeTypes.GetClusterName() which uses configuration to determine the cluster_name. I was thinking that we could use the value from the flow itself (which is part of the node_name field), but I realize now it's not much better. I had thought we were adding "default/" to the node_name of flows so it would make sense to use the node_name field to figure out cluster_name, but I believe the node_name is just left alone unless cluster_name is configured explicitly. |
2b110dc
to
2813400
Compare
2813400
to
1584d8c
Compare
Rebased and removed |
1584d8c
to
b1965f9
Compare
Signed-off-by: Chance Zibolski <chance.zibolski@gmail.com>
b1965f9
to
256be08
Compare
Now that the Hubble Observer API supports GetNamespaces, implement it in Hubble CLI.
Relates to