xds

package
v0.0.0-...-e7c9706 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: 48 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIWatches

func APIWatches() []string

func DisableAuthorizationForSecret

func DisableAuthorizationForSecret(fake *fake.Clientset)

DisableAuthorizationForSecret makes the authorization check always pass. Should be used only for tests.

Types

type FakeDiscoveryServer

type FakeDiscoveryServer struct {
	*core.ConfigGenTest

	Discovery   *xds.DiscoveryServer
	Listener    net.Listener
	BufListener *bufconn.Listener

	KubeRegistry *kube.FakeController
	XdsUpdater   model.XDSUpdater
	MemRegistry  *memregistry.ServiceDiscovery
	// contains filtered or unexported fields
}

func NewFakeDiscoveryServer

func NewFakeDiscoveryServer(t test.Failer, opts FakeOptions) *FakeDiscoveryServer

func (*FakeDiscoveryServer) Connect

func (f *FakeDiscoveryServer) Connect(p *model.Proxy, watch []string, wait []string) *adsc.ADSC

Connect starts an ADS connection to the server using adsc. It will automatically be cleaned up when the test ends watch can be configured to determine the resources to watch initially, and wait can be configured to determine what resources we should initially wait for.

func (*FakeDiscoveryServer) ConnectADS

func (f *FakeDiscoveryServer) ConnectADS() *xds.AdsTest

ConnectADS starts an ADS connection to the server. It will automatically be cleaned up when the test ends

func (*FakeDiscoveryServer) ConnectDeltaADS

func (f *FakeDiscoveryServer) ConnectDeltaADS() *xds.DeltaAdsTest

ConnectDeltaADS starts a Delta ADS connection to the server. It will automatically be cleaned up when the test ends

func (*FakeDiscoveryServer) ConnectUnstarted

func (f *FakeDiscoveryServer) ConnectUnstarted(p *model.Proxy, watch []string) *adsc.ADSC

func (*FakeDiscoveryServer) Endpoints

func (*FakeDiscoveryServer) EnsureSynced

func (f *FakeDiscoveryServer) EnsureSynced(t test.Failer)

func (*FakeDiscoveryServer) KubeClient

func (f *FakeDiscoveryServer) KubeClient() kubelib.Client

func (*FakeDiscoveryServer) PushContext

func (f *FakeDiscoveryServer) PushContext() *model.PushContext

func (*FakeDiscoveryServer) T

type FakeOptions

type FakeOptions struct {
	// If provided, sets the name of the "default" or local cluster to the similaed pilots. (Defaults to opts.DefaultClusterName)
	DefaultClusterName cluster.ID
	// If provided, the minor version will be overridden for calls to GetKubernetesVersion to 1.minor
	KubernetesVersion string
	// If provided, a service registry with the name of each map key will be created with the given objects.
	KubernetesObjectsByCluster map[cluster.ID][]runtime.Object
	// If provided, these objects will be used directly for the default cluster ("Kubernetes" or DefaultClusterName)
	KubernetesObjects []runtime.Object
	// If provided, a service registry with the name of each map key will be created with the given objects.
	KubernetesObjectStringByCluster map[cluster.ID]string
	// If provided, the yaml string will be parsed and used as objects for the default cluster ("Kubernetes" or DefaultClusterName)
	KubernetesObjectString string
	// If provided, these configs will be used directly
	Configs []config.Config
	// If provided, the yaml string will be parsed and used as configs
	ConfigString string
	// If provided, the ConfigString will be treated as a go template, with this as input params
	ConfigTemplateInput any
	// If provided, this mesh config will be used
	MeshConfig      *meshconfig.MeshConfig
	NetworksWatcher mesh.NetworksWatcher

	// Callback to modify the kube client before it is started
	KubeClientModifier func(c kubelib.Client)

	// Override the default kube client constructor
	KubeClientBuilder func(objects ...runtime.Object) kubelib.Client

	// ListenerBuilder, if specified, allows making the server use the given
	// listener instead of a buffered conn.
	ListenerBuilder func() (net.Listener, error)

	// Time to debounce
	// By default, set to 0s to speed up tests
	DebounceTime time.Duration

	// EnableFakeXDSUpdater will use a XDSUpdater that can be used to watch events
	EnableFakeXDSUpdater       bool
	DisableSecretAuthorization bool
	Services                   []*model.Service
	Gateways                   []model.NetworkGateway
}

Jump to

Keyboard shortcuts

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