Documentation ¶
Overview ¶
Package environment contains the main implementation for Environment class.
Index ¶
- type Environment
- func (e *Environment) Apply(ctx context.Context, file string) error
- func (e *Environment) ApplySpec(ctx context.Context, spec string) (err error)
- func (e *Environment) Create(ctx context.Context) (err error)
- func (e *Environment) Delete(_ context.Context) error
- func (e *Environment) Describe() string
- func (e *Environment) GetN(ctx context.Context, optsArg map[string]interface{}) (n int, err error)
- func (e *Environment) InitKubernetes(ctx context.Context, ctxName string) (err error)
- func (e *Environment) SetTestName(n string)
- func (e *Environment) Wait(ctx context.Context, wc *kubernetes.WaitCondition) (err error)
- type JSOptions
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 ¶
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.