mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-18 03:46:45 +00:00
api_topologies: Add a selectType field to option groups
This field changes the option group behaviour depending on its value. Currently only supports two values: "one" (default): Old behaviour, one option can be selected "union": Any number of options can be selected, and the filters are OR-ed togther It is written in such a way as to easily enable a future "intersection" option, as per union but AND-ing the filters. But this is not done here. YAGNI.
This commit is contained in:
@@ -321,6 +321,12 @@ func IsNotPseudo(n report.Node) bool {
|
||||
return n.Topology != Pseudo || strings.HasSuffix(n.ID, TheInternetID) || strings.HasPrefix(n.ID, ServiceNodeIDPrefix)
|
||||
}
|
||||
|
||||
// IsPseudoTopology returns true if the node is in a pseudo topology,
|
||||
// mimicing the check performed by MakeFilter() instead of the more complex check in IsNotPseudo()
|
||||
func IsPseudoTopology(n report.Node) bool {
|
||||
return n.Topology == Pseudo
|
||||
}
|
||||
|
||||
// IsNamespace checks if the node is a pod/service in the specified namespace
|
||||
func IsNamespace(namespace string) FilterFunc {
|
||||
return func(n report.Node) bool {
|
||||
|
||||
Reference in New Issue
Block a user