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

Filter by Kubernetes Namespaces #1386

Merged
merged 6 commits into from
May 3, 2016
Merged

Conversation

paulbellamy
Copy link
Contributor

Fixes #1340

Won't really work in multitenant, as the topologyRegistry shouldn't
change. We need to apply it transiently on each call, on a per-report
basis.

Options are:

a) replace topologyRegistry.walk() with topologyRegistry.Topologies(),
and then modify them, in renderTopologies.

b) make APITopologyDesc.Options a func(report.Report)
[]APITopologyOptionGroup, and call that from renderTopologies.

@tomwilkie, any thoughts? preferences?

@paulbellamy
Copy link
Contributor Author

Per f2f discussion, (a) sounds better.

@paulbellamy
Copy link
Contributor Author

Blocked on #1371

@paulbellamy paulbellamy force-pushed the 1340-k8s-filter-namespace branch 3 times, most recently from 603aa7b to 23fdf47 Compare April 29, 2016 14:56
@paulbellamy
Copy link
Contributor Author

@tomwilkie probably worth having a look at this. It is still showing the wrong node-count for services (it's showing the pod node count), but...

@paulbellamy
Copy link
Contributor Author

Also, we should filter out delete pods/services when figuring out the available namespaces.

@paulbellamy paulbellamy force-pushed the 1340-k8s-filter-namespace branch from 5427a26 to 64c9ff6 Compare April 29, 2016 15:36
@paulbellamy paulbellamy changed the title WIP -- Filter by Kubernetes Namespaces Filter by Kubernetes Namespaces Apr 29, 2016
@paulbellamy
Copy link
Contributor Author

@tomwilkie, ptal

return r.rendererForTopology(mux.Vars(req)["topology"], values, rpt)
}

func captureReporter(rep Reporter, f reportRenderHandler) CtxHandlerFunc {

This comment was marked as abuse.

This comment was marked as abuse.

@tomwilkie tomwilkie assigned paulbellamy and unassigned tomwilkie May 3, 2016
func(n report.Node) bool {
// Drop deleted or empty pods
state, ok := n.Latest.Lookup(kubernetes.PodState)
return HasChildren(report.Container)(n) && (!ok || state != kubernetes.StateDeleted)

This comment was marked as abuse.

@paulbellamy paulbellamy force-pushed the 1340-k8s-filter-namespace branch from 3371060 to 2d7df7c Compare May 3, 2016 11:07
@paulbellamy paulbellamy force-pushed the 1340-k8s-filter-namespace branch from 2d7df7c to 0e70f70 Compare May 3, 2016 11:59
@tomwilkie
Copy link
Contributor

LGTM (assuming green)

@paulbellamy paulbellamy merged commit 57bc6f7 into master May 3, 2016
@paulbellamy paulbellamy deleted the 1340-k8s-filter-namespace branch May 3, 2016 12:48
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.

2 participants