-
Notifications
You must be signed in to change notification settings - Fork 712
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
When k8s present, allow filtering of containers by namespace #2285
Conversation
app/api_topologies.go
Outdated
kubernetesFilters(ns...), unmanagedFilter, | ||
}) | ||
if len(ns) > 0 { | ||
// We only want to apply k8s filters if any k8s info is present |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
for i, t := range topologies { | ||
if t.id == podsID || t.id == servicesID || t.id == deploymentsID || t.id == replicaSetsID { | ||
topologies[i] = updateTopologyFilters(t, []APITopologyOptionGroup{ | ||
kubernetesFilters(ns...), unmanagedFilter, |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
render/filters.go
Outdated
@@ -293,7 +293,14 @@ func IsNotPseudo(n report.Node) bool { | |||
// IsNamespace checks if the node is a pod/service in the specified namespace | |||
func IsNamespace(namespace string) FilterFunc { | |||
return func(n report.Node) bool { | |||
gotNamespace, _ := n.Latest.Lookup(kubernetes.Namespace) | |||
try_keys := []string{kubernetes.Namespace, docker.LabelPrefix + "io.kubernetes.pod.namespace"} |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@ekimekim ping |
92621b4
to
bc6e030
Compare
To facilitate this, we replace the existing functionality of updateFilters which sets k8s topologies to have the filters [namespace, managed], to instead append the namespace filter to any existing. This lets it apply to both k8s and container topologies without overwriting existing container filters. We instead set the managed filter in the static definition. This however has the side effect that the ordering of the namespace filter and the managed filter in k8s topologies has been reversed, so it reads: Show Unmanaged | Hide Unmanaged foo | bar | default | baz | All Namespaces instead of: foo | bar | default | baz | All Namespaces Show Unmanaged | Hide Unmanaged
bc6e030
to
b01e890
Compare
ptal |
Revert "Merge pull request #2285 from weaveworks/mike/k8s-ns-in-container-view"
…in-container-view"" This reverts commit d55c528.
To facilitate this, we replace the existing functionality of updateFilters which
sets k8s topologies to have the filters [namespace, managed], to instead append the namespace filter
to any existing. This lets it apply to both k8s and container topologies without overwriting existing
container filters. We instead set the managed filter in the static definition.
This however has the side effect that the ordering of the namespace filter and the managed filter
in k8s topologies has been reversed, so it reads:
instead of:
Fixes #1504