xdstest

package
v0.0.0-...-a142011 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareEndpoints

func CompareEndpoints(cluster string, got []*endpointv3.LocalityLbEndpoints, want []LocLbEpInfo) error

func CompareEndpointsOrFail

func CompareEndpointsOrFail(t *testing.T, cluster string, got []*endpointv3.LocalityLbEndpoints, want []LocLbEpInfo)

func Dump

func Dump(t test.Failer, p proto.Message) string

func DumpList

func DumpList[T any](t test.Failer, protoList []T) []string

DumpList will dump a list of protos.

func EvaluateListenerFilterPredicates

func EvaluateListenerFilterPredicates(predicate *listener.ListenerFilterChainMatchPredicate, port int) bool

EvaluateListenerFilterPredicates runs through the ListenerFilterChainMatchPredicate logic This is exposed for testing only, and should not be used in XDS generation code

func ExtractCluster

func ExtractCluster(name string, cc []*cluster.Cluster) *cluster.Cluster

func ExtractClusterEndpoints

func ExtractClusterEndpoints(clusters []*cluster.Cluster) map[string][]string

func ExtractClusterSecretResources

func ExtractClusterSecretResources(t test.Failer, c *cluster.Cluster) []string

func ExtractClusters

func ExtractClusters(cc []*cluster.Cluster) map[string]*cluster.Cluster

func ExtractEdsClusterNames

func ExtractEdsClusterNames(cl []*cluster.Cluster) []string

func ExtractEndpoints

func ExtractEndpoints(cla *endpoint.ClusterLoadAssignment) []string

ExtractEndpoints returns all endpoints in the load assignment (including unhealthy endpoints)

func ExtractFilterChain

func ExtractFilterChain(name string, l *listener.Listener) *listener.FilterChain

func ExtractFilterChainNames

func ExtractFilterChainNames(l *listener.Listener) []string

func ExtractFilterNames

func ExtractFilterNames(t test.Failer, fcs *listener.FilterChain) ([]string, []string)

func ExtractHTTPConnectionManager

func ExtractHTTPConnectionManager(t test.Failer, fcs *listener.FilterChain) *hcm.HttpConnectionManager

func ExtractHealthEndpoints

func ExtractHealthEndpoints(cla *endpoint.ClusterLoadAssignment) ([]string, []string)

ExtractHealthEndpoints returns all health and unhealth endpoints

func ExtractListener

func ExtractListener(name string, ll []*listener.Listener) *listener.Listener

func ExtractListenerAddresses

func ExtractListenerAddresses(l *listener.Listener) []string

func ExtractListenerFilters

func ExtractListenerFilters(l *listener.Listener) map[string]*listener.ListenerFilter

func ExtractListenerNames

func ExtractListenerNames(ll []*listener.Listener) []string

func ExtractListenerSecretResources

func ExtractListenerSecretResources(t test.Failer, l *listener.Listener) []string

func ExtractLoadAssignments

func ExtractLoadAssignments(cla []*endpoint.ClusterLoadAssignment) map[string][]string

func ExtractLocalityLbEndpoints

func ExtractLocalityLbEndpoints(cla []*endpoint.ClusterLoadAssignment) map[string][]*endpoint.LocalityLbEndpoints

func ExtractResource

func ExtractResource(res model.Resources) sets.String

func ExtractRouteConfigurations

func ExtractRouteConfigurations(rc []*route.RouteConfiguration) map[string]*route.RouteConfiguration

func ExtractRoutesFromListeners

func ExtractRoutesFromListeners(ll []*listener.Listener) []string

func ExtractSecretResources

func ExtractSecretResources(t test.Failer, rs []*anypb.Any) []string

ExtractSecretResources fetches all referenced SDS resource names from a list of clusters and listeners

func ExtractTCPProxy

func ExtractTCPProxy(t test.Failer, fcs *listener.FilterChain) *tcpproxy.TcpProxy

func ExtractTLSSecrets

func ExtractTLSSecrets(t test.Failer, secrets []*anypb.Any) map[string]*tls.Secret

func ExtractVirtualHosts

func ExtractVirtualHosts(rc *route.RouteConfiguration) map[string][]string

func FilterClusters

func FilterClusters(cl []*cluster.Cluster, f func(c *cluster.Cluster) bool) []*cluster.Cluster

func MapKeys

func MapKeys[M ~map[string]V, V any](mp M) []string

func SilentlyUnmarshalAny

func SilentlyUnmarshalAny[T any](a *anypb.Any) *T

func ToDiscoveryResponse

func ToDiscoveryResponse[T proto.Message](p []T) *discovery.DiscoveryResponse

func TypeName

func TypeName[T proto.Message]() string

func UnmarshalAny

func UnmarshalAny[T any](t test.Failer, a *anypb.Any) *T

func UnmarshalClusterLoadAssignment

func UnmarshalClusterLoadAssignment(t test.Failer, resp []*anypb.Any) []*endpoint.ClusterLoadAssignment

func UnmarshalRouteConfiguration

func UnmarshalRouteConfiguration(t test.Failer, resp []*anypb.Any) []*route.RouteConfiguration

func ValidateCluster

func ValidateCluster(t testing.TB, c *cluster.Cluster)

func ValidateClusterLoadAssignment

func ValidateClusterLoadAssignment(t testing.TB, l *endpoint.ClusterLoadAssignment)

func ValidateClusterLoadAssignments

func ValidateClusterLoadAssignments(t testing.TB, ls []*endpoint.ClusterLoadAssignment)

func ValidateClusters

func ValidateClusters(t testing.TB, ls []*cluster.Cluster)

func ValidateListener

func ValidateListener(t testing.TB, l *listener.Listener)

func ValidateListeners

func ValidateListeners(t testing.TB, ls []*listener.Listener)

func ValidateRoute

func ValidateRoute(t testing.TB, r *route.Route)

func ValidateRouteConfiguration

func ValidateRouteConfiguration(t testing.TB, l *route.RouteConfiguration)

func ValidateRouteConfigurations

func ValidateRouteConfigurations(t testing.TB, ls []*route.RouteConfiguration)

func ValidateRoutes

func ValidateRoutes(t testing.TB, ls []*route.Route)

Types

type LbEpInfo

type LbEpInfo struct {
	Address string
	// nolint: structcheck
	Weight uint32
}

type LocLbEpInfo

type LocLbEpInfo struct {
	LbEps  []LbEpInfo
	Weight uint32
}

func (LocLbEpInfo) GetAddrs

func (i LocLbEpInfo) GetAddrs() []string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL