environment

package
v0.2.15 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 25 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifacts

type Artifacts struct {
	Namespace string
	DBName    string
	Client    *client.K8sClient
	// contains filtered or unexported fields
}

Artifacts is an artifacts dumping structure that copies logs and database dumps for all deployed pods

func NewArtifacts

func NewArtifacts(client *client.K8sClient, namespace string) (*Artifacts, error)

NewArtifacts create new artifacts instance for provided environment

func (*Artifacts) DumpTestResult

func (a *Artifacts) DumpTestResult(testDir string, dbName string) error

DumpTestResult dumps all pods logs and db dump in a separate test dir

type Config

type Config struct {
	TTL               time.Duration
	NamespacePrefix   string
	Namespace         string
	Labels            []string
	NSLabels          *map[string]*string
	ReadyCheckData    *client.ReadyCheckData
	DryRun            bool
	InsideK8s         bool
	KeepConnection    bool
	RemoveOnInterrupt bool
}

Config environment configuration

type ConnectedChart added in v0.2.3

type ConnectedChart interface {
	IsDeploymentNeeded() bool
	GetName() string
	GetPath() string
	GetProps() interface{}
	GetValues() *map[string]interface{}
	ExportData(e *Environment) error
}

ConnectedChart interface to interact both with cdk8s apps and helm charts

type Environment

type Environment struct {
	App cdk8s.App

	Charts    []ConnectedChart  // All connected charts in the
	Cfg       *Config           // The environment specific config
	Client    *client.K8sClient // Client connecting to the K8s cluster
	Fwd       *client.Forwarder // Used to forward ports from local machine to the K8s cluster
	Artifacts *Artifacts
	Chaos     *client.Chaos
	URLs      map[string][]string // General URLs of launched resources. Uses '_local' to delineate forwarded ports
	// contains filtered or unexported fields
}

Environment describes a launched test environment

func New

func New(cfg *Config) *Environment

New creates new environment

func (*Environment) AddChart added in v0.2.3

func (m *Environment) AddChart(f func(root cdk8s.Chart) ConnectedChart) *Environment

func (*Environment) AddHelm added in v0.2.3

func (m *Environment) AddHelm(chart ConnectedChart) *Environment

func (*Environment) Clear added in v0.2.3

func (m *Environment) Clear()

func (*Environment) Deploy

func (m *Environment) Deploy(manifest string) error

Deploy deploy synthesized manifest and check logs for readiness

func (*Environment) PrintURLs added in v0.2.3

func (m *Environment) PrintURLs() error

func (*Environment) Run added in v0.2.3

func (m *Environment) Run() error

Run deploys or connects to already created environment

func (*Environment) Shutdown

func (m *Environment) Shutdown() error

Shutdown environment, remove namespace

Jump to

Keyboard shortcuts

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