plan

package
v15.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConditionAlwaysExecute = "always-execute"
)

Variables

This section is empty.

Functions

func IsCommandNotFound

func IsCommandNotFound(err error) bool

IsCommandNotFound asserts commandNotFoundError.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

Types

type Backoff

type Backoff struct {
	// contains filtered or unexported fields
}

Backoff is a simple wrapper that allows us to better explain how the backoff got configured.

func NewBackoff

func NewBackoff(wait time.Duration, interval time.Duration) *Backoff

func (*Backoff) Interval

func (b *Backoff) Interval() time.Duration

func (*Backoff) Wait

func (b *Backoff) Wait() time.Duration

func (*Backoff) Wrapped

func (b *Backoff) Wrapped() backoff.Interface

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

func NewExecutor

func NewExecutor(config ExecutorConfig) (*Executor, error)

func (*Executor) Execute

func (e *Executor) Execute(ctx context.Context) error

func (*Executor) Validate

func (e *Executor) Validate() error

type ExecutorConfig

type ExecutorConfig struct {
	Commands []*cobra.Command
	Logger   micrologger.Logger

	Plan          []Step
	TenantCluster string
}

type Step

type Step struct {
	// Action is the action/command name, e.g. ac013.
	Action StepAction
	// Backoff is the tolerance within the associated action must be
	// successfully executed without returning errors.
	Backoff *Backoff
	// CoolDown is the time to wait after the action was executed, before moving
	// on to execute the following action. This is a delay mechanism in order to
	// defer the execution of actions within a test plan.
	CoolDown time.Duration
	// Condition defines when to execute this step of a plan. By default all
	// steps are executed until an error occurs. This behaviour can be
	// overwritten to always execute certain steps e.g. for cluster deletion.
	Condition StepCondition
}

type StepAction

type StepAction string

func (StepAction) Split

func (a StepAction) Split() []string

func (StepAction) String

func (a StepAction) String() string

type StepCondition

type StepCondition string

Jump to

Keyboard shortcuts

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