environment

package
v0.0.0-...-80bb616 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package environment contains the main implementation for Environment class.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Environment

type Environment struct {
	VU modules.VU

	// This is now set from init context, see newEnvironment call
	ParentContext string
	TestName      string

	// set from JS
	JSOptions
	// contains filtered or unexported fields
}

Environment is the type for our custom API.

func NewEnvironment

func NewEnvironment(fenv *fs.EnvDescription, logger *zap.Logger) *Environment

NewEnvironment constructs a new Environment.

func (*Environment) Apply

func (e *Environment) Apply(ctx context.Context, file string) error

Apply deploys the manifest file.

func (*Environment) ApplySpec

func (e *Environment) ApplySpec(ctx context.Context, spec string) (err error)

ApplySpec deploys the manifest spec.

func (*Environment) Create

func (e *Environment) Create(ctx context.Context) (err error)

Create creates a vcluster and deploys the initial environment according to user's configuration. Create is meant to be called in setup() of the script.

func (*Environment) Delete

func (e *Environment) Delete(_ context.Context) error

Delete deletes a vcluster. Delete is meant to be called in teardown() of the script.

func (*Environment) Describe

func (e *Environment) Describe() string

Describe returns a short text description of the Environment.

func (*Environment) GetN

func (e *Environment) GetN(ctx context.Context, optsArg map[string]interface{}) (n int, err error)

GetN returns number of objects within environment with the given parameters.

func (*Environment) InitKubernetes

func (e *Environment) InitKubernetes(ctx context.Context, ctxName string) (err error)

InitKubernetes switches to the given Kubernetes context if provided and builds a new Kubernetes client.

func (*Environment) SetTestName

func (e *Environment) SetTestName(n string)

SetTestName set the name of environment.

func (*Environment) Wait

func (e *Environment) Wait(ctx context.Context, wc *kubernetes.WaitCondition) (err error)

Wait blocks execution until given wait condition is reached.

type JSOptions

type JSOptions struct {
	Source         string
	IncludeGrafana bool // not supported yet
	Criteria       criteriaDef
	Timeout        string // not supported yet: should be passed to waiting functions
}

JSOptions holds configuration of environment, as specified by a user in the script.

Jump to

Keyboard shortcuts

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