Documentation ¶
Index ¶
- Variables
- type Matcher
- func And(ms ...Matcher) Matcher
- func AnyServiceName(expected echo.NamespacedNames) Matcher
- func CapturedService() Matcher
- func Cluster(c cluster.Cluster) Matcher
- func Namespace(n namespace.Instance) Matcher
- func NamespaceName(ns string) Matcher
- func Network(n string) Matcher
- func Not(m Matcher) Matcher
- func Or(ms ...Matcher) Matcher
- func ServiceName(n echo.NamespacedName) Matcher
- func WaypointService() Matcher
- func (m Matcher) All(i echo.Instances) bool
- func (m Matcher) Any(i echo.Instances) bool
- func (m Matcher) First(i echo.Instances) (echo.Instance, error)
- func (m Matcher) FirstOrFail(t test.Failer, i echo.Instances) echo.Instance
- func (m Matcher) GetMatches(i echo.Instances) echo.Instances
- func (m Matcher) GetServiceMatches(services echo.Services) echo.Services
Constants ¶
This section is empty.
Variables ¶
var NotExternal = Not(External)
NotExternal is equivalent to Not(External)
var NotHeadless = Not(Headless)
NotHeadless is equivalent to Not(Headless)
var NotMultiVersion = Not(MultiVersion)
var NotNaked = Not(Naked)
NotNaked is equivalent to Not(Naked)
var NotProxylessGRPC = Not(ProxylessGRPC)
NotProxylessGRPC is equivalent to Not(ProxylessGRPC)
var NotRegularPod = Not(RegularPod)
var NotTProxy = Not(TProxy)
var NotVM = Not(VM)
NotVM is matches against instances that are NOT VMs.
var NotWaypoint = Not(Waypoint)
Functions ¶
This section is empty.
Types ¶
type Matcher ¶
Matcher is used to filter matching instances
AllNaked matches instances where every subset has SidecarInject set to false.
External matches instances that have a custom DefaultHostHeader defined
Headless matches instances that are backed by headless services.
var MultiVersion Matcher = func(i echo.Instance) bool { if len(i.Config().Subsets) != 2 { return false } var matchIstio, matchLegacy bool for _, s := range i.Config().Subsets { if s.Version == "vistio" { matchIstio = true } else if s.Version == "vlegacy" && !s.Annotations.GetBool(echo.SidecarInject) { matchLegacy = true } } return matchIstio && matchLegacy }
MultiVersion matches echos that have Multi-version specific setup.
Naked matches instances with any subset marked with SidecarInject equal to false.
ProxylessGRPC matches instances that are Pods with a SidecarInjectTemplate annotation equal to grpc.
var RegularPod Matcher = func(instance echo.Instance) bool {
return instance.Config().IsRegularPod()
}
RegularPod matches echos that don't meet any of the following criteria: - VM - Naked - Headless - TProxy - Multi-Subset
VM matches instances with DeployAsVM
func AnyServiceName ¶
func AnyServiceName(expected echo.NamespacedNames) Matcher
AnyServiceName matches instances if they have the same Service and Namespace as any of the provided instances.
func CapturedService ¶
func CapturedService() Matcher
add a new matcher for "captured service -> service"
func NamespaceName ¶
NamespaceName matches instances within the given namespace name.
func ServiceName ¶
func ServiceName(n echo.NamespacedName) Matcher
ServiceName matches instances with the given namespace and service name.
func (Matcher) FirstOrFail ¶
FirstOrFail calls First and then fails the test if an error occurs.
func (Matcher) GetMatches ¶
GetMatches returns the subset of echo.Instances that match this Matcher.