deployment

package
v1.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ASvc             = "a"
	BSvc             = "b"
	CSvc             = "c"
	TproxySvc        = "tproxy"
	VMSvc            = "vm"
	HeadlessSvc      = "headless"
	StatefulSetSvc   = "statefulset"
	ProxylessGRPCSvc = "proxyless-grpc"
	NakedSvc         = "naked"
	DeltaSvc         = "delta"
)
View Source
const (
	ExternalSvc = "external"
)

Variables

This section is empty.

Functions

func Setup

func Setup(apps *Echos, cfg Config) resource.SetupFn

Setup function for writing to a global deployment variable.

func SetupSingleNamespace

func SetupSingleNamespace(view *SingleNamespaceView) resource.SetupFn

SetupSingleNamespace calls Setup and returns a SingleNamespaceView.

func SetupTwoNamespaces

func SetupTwoNamespaces(view *TwoNamespaceView) resource.SetupFn

SetupTwoNamespaces calls Setup and returns a TwoNamespaceView.

Types

type Config

type Config struct {
	// Echos is the target Echos for the newly created echo apps. If nil, a new Echos
	// instance will be created.
	Echos *Echos

	// NamespaceCount indicates the number of echo namespaces to be generated.
	// Ignored if Namespaces is non-empty. Defaults to 1.
	NamespaceCount int

	// Namespaces is the user-provided list of echo namespaces. If empty, NamespaceCount
	// namespaces will be generated.
	Namespaces []namespace.Instance

	// NoExternalNamespace if true, no external namespace will be generated and no external echo
	// instance will be deployed. Ignored if ExternalNamespace is non-nil.
	NoExternalNamespace bool

	// ExternalNamespace the namespace to use for the external deployment. If nil, a namespace
	// will be generated unless NoExternalNamespace is specified.
	ExternalNamespace namespace.Instance
}

Config for new echo deployment.

type EchoNamespace

type EchoNamespace struct {
	// Namespace where the services are deployed.
	Namespace namespace.Instance

	// Standard echo app to be used by tests
	A echo.Instances
	// Standard echo app to be used by tests
	B echo.Instances
	// Standard echo app to be used by tests
	C echo.Instances
	// Standard echo app with TPROXY interception mode to be used by tests
	Tproxy echo.Instances
	// Headless echo app to be used by tests
	Headless echo.Instances
	// StatefulSet echo app to be used by tests
	StatefulSet echo.Instances
	// ProxylessGRPC echo app to be used by tests
	ProxylessGRPC echo.Instances
	// Echo app to be used by tests, with no sidecar injected
	Naked echo.Instances
	// A virtual machine echo app (only deployed to one cluster)
	VM echo.Instances
	// DeltaXDS echo app uses the delta XDS protocol. This should be functionally equivalent to A.
	DeltaXDS echo.Instances

	// All echo apps in this namespace
	All echo.Services
}

EchoNamespace contains the echo instances for a single namespace.

type Echos

type Echos struct {
	// NS is the list of echo namespaces.
	NS []EchoNamespace

	// External (out-of-mesh) deployments
	External External

	// All echo instances.
	All echo.Services
}

Echos is a common set of echo deployments to support integration testing.

func New

func New(ctx resource.Context, cfg Config) (*Echos, error)

New echo deployment with the given configuration.

func NewOrFail

func NewOrFail(t test.Failer, ctx resource.Context, cfg Config) *Echos

NewOrFail calls New and fails if an error is returned.

func (Echos) SingleNamespaceView

func (d Echos) SingleNamespaceView() SingleNamespaceView

SingleNamespaceView converts this Echos into a SingleNamespaceView.

func (Echos) TwoNamespaceView

func (d Echos) TwoNamespaceView() TwoNamespaceView

TwoNamespaceView converts this Echos into a TwoNamespaceView.

type External

type External struct {
	// Namespace where external echo app will be deployed
	Namespace namespace.Instance

	// All external echo instances with no sidecar injected
	All echo.Instances
}

type SingleNamespaceView

type SingleNamespaceView struct {
	// Include the echos at the top-level, so there is no need for accessing sub-structures.
	EchoNamespace

	// External (out-of-mesh) deployments
	External External

	// All echo instances
	All echo.Services
}

SingleNamespaceView is a simplified view of Echos for tests that only require a single namespace.

type TwoNamespaceView

type TwoNamespaceView struct {
	// Ns1 contains the echo deployments in the first namespace
	Ns1 EchoNamespace

	// Ns2 contains the echo deployments in the second namespace
	Ns2 EchoNamespace

	// Ns1AndNs2 contains just the echo services in Ns1 and Ns2 (excludes External).
	Ns1AndNs2 echo.Services

	// External (out-of-mesh) deployments
	External External

	// All echo instances
	All echo.Services
}

TwoNamespaceView is a simplified view of Echos for tests that require 2 namespaces.

Jump to

Keyboard shortcuts

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