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

Add filters for pseudo nodes. #1581

Merged
merged 2 commits into from
Jun 16, 2016
Merged

Add filters for pseudo nodes. #1581

merged 2 commits into from
Jun 16, 2016

Conversation

tomwilkie
Copy link
Contributor

Fixes #1129

Default: "show",
Options: []APITopologyOption{
{"show", "Show pseudo nodes", nil, false},
{"hide", "Hide pseudo nodes", render.IsNotPseudo, true},

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

@2opremio
Copy link
Contributor

I'm not fully convinced this is the best way to solve #1129 . Instead of adding another knob I think we should filter out pseudo-nodes not connected to the meaningful nodes of the view being displayed (e.g. container nodes).

@rade
Copy link
Member

rade commented Jun 14, 2016

I'm not fully convinced this is the best way to solve #1129

It certainly isn't, but the more interesting question is whether it is a net improvement...

I imagine it will be quite common to have both proper and pseudo nodes connected to the internet, and only wanting to see the former nodes&connections but not the latter. Combined with the "extra knob that really shouldn't be needed", that swings the answer slightly in the 'non' direction for me.

@tomwilkie
Copy link
Contributor Author

tomwilkie commented Jun 14, 2016

Feedback from actual user that inspired this PR contradicts your views:

Give me the option to hide/filter anything that is not a Pod, service, or container. Some of the items on the screen don't make sense to show in most contexts.

@davkal
Copy link
Contributor

davkal commented Jun 14, 2016

Maybe this is a naming thing. "pseudo" is Scope jargon. What do those nodes have in common? Are they ancillary, supporting, external, bogus, extra, helper, secondary?

@rade
Copy link
Member

rade commented Jun 14, 2016

Feedback from actual user that inspired this PR contradict your views

It does not. Bear in mind that it was me who raised the issue and proposed this very solution as a quick fix. Three months ago. Since then the UI has moved on a lot. Yes, for the users that have no pseudo-nodes connected to their proper nodes the quick fix is an improvement. For them, not showing pseudo nodes at all would be even better. For everybody else it isn't an improvement and it burdens everyone with an additional knob.

If it takes little effort to review this then I am willing to let it through under one condition: we raise a separate issue for the proper fix.

@rade
Copy link
Member

rade commented Jun 14, 2016

I imagine it will be quite common to have both proper and pseudo nodes connected to the internet, and only wanting to see the former nodes&connections but not the latter.

It occurs to me that this could be addressed by not including the internet nodes in this filter.

Which would then also address David's concern, since the filter could say 'Uncontained' or 'Unmanaged', which makes it very obvious what this is hiding since it corresponds to labels in the UI.

Question: if we did exclude internet nodes from the filter, would the internet nodes be hidden if the filter is on and only unmanaged/uncontained nodes are connected to them?

@davkal
Copy link
Contributor

davkal commented Jun 15, 2016

Question: if we did exclude internet nodes from the filter, would the internet nodes be hidden if the filter is on and only unmanaged/uncontained nodes are connected to them?

I think always showing the internet node (exclude from the filter) would be fine by me. Then it would be independent of the knob.

@rade
Copy link
Member

rade commented Jun 15, 2016

My point was that ideally it wouldn't show the internet nodes if they don't have edges to any other shown nodes. So I was wondering whether perhaps that would be happening anyway in the current algorithm.

@davkal
Copy link
Contributor

davkal commented Jun 15, 2016

My point was that ideally it wouldn't show the internet nodes if they don't have edges to any other shown nodes. So I was wondering whether perhaps that would be happening anyway in the current algorithm.

Ah yes, that's what I meant too. I had that algo in mind (not showing internet nodes that dont have edges to them)

@tomwilkie
Copy link
Contributor Author

This is a one line change.

@tomwilkie tomwilkie added this to the 0.16.0 milestone Jun 15, 2016
@tomwilkie tomwilkie assigned tomwilkie and unassigned 2opremio Jun 15, 2016
@tomwilkie
Copy link
Contributor Author

@2opremio @davkal @rade PTAL

@tomwilkie tomwilkie assigned rade, davkal and 2opremio and unassigned tomwilkie Jun 15, 2016
@rade
Copy link
Member

rade commented Jun 15, 2016

can't/won't comment on the code, but if it does what I suggested then that SGTM.

@tomwilkie tomwilkie removed this from the 0.16.0 milestone Jun 15, 2016
if (f.filterPseudo || node.Topology != Pseudo) && f.FilterFunc(node) {
output[id] = node
inDegrees[id] = 0
} else if !f.filterPseudo && node.Topology == Pseudo {

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

@@ -73,25 +73,24 @@ func ComposeFilterFuncs(fs ...FilterFunc) FilterFunc {
// Filter removes nodes from a view based on a predicate.
type Filter struct {
Renderer
FilterFunc FilterFunc
filterPseudo bool

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

- Don't filter the internet node as a pseudo node.
- Rename pseudo filter to unmanaged/uncontained.
- Review feedback
- Move the FilterFoo funcs into the tests
- Drop the 'nodes' from filter labels.
@tomwilkie tomwilkie force-pushed the 1129-filter-pseudo branch from 2c6df19 to 48936ef Compare June 16, 2016 18:09
@tomwilkie tomwilkie merged commit c80eb42 into master Jun 16, 2016
@tomwilkie tomwilkie deleted the 1129-filter-pseudo branch June 16, 2016 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants