v1

package
v0.0.0-...-6a3c6e2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2019 License: Apache-2.0 Imports: 3 Imported by: 17

Documentation

Index

Constants

View Source
const (
	// ExperimentKind is the kind a experiment.
	ExperimentKind = "experiment"
	// ExperimentVersion is the version of an experiment.
	ExperimentVersion = "chaos/v1"
)
View Source
const (
	// FailureKind is the kind a failure.
	FailureKind = "failure"
	// FailureVersion is the version of the failure
	FailureVersion = "chaos/v1"
)

Variables

View Source
var ExperimentListTypeMeta = api.TypeMeta{
	Kind:    experimentListKind,
	Version: experimentListVersion,
}

ExperimentListTypeMeta is the experiment list type metadata.

View Source
var ExperimentTypeMeta = api.TypeMeta{
	Kind:    ExperimentKind,
	Version: ExperimentVersion,
}

ExperimentTypeMeta is the experiment type metadata.

View Source
var FailureListTypeMeta = api.TypeMeta{
	Kind:    failureListKind,
	Version: failureListVersion,
}

FailureListTypeMeta is the failure list type metadata.

View Source
var FailureTypeMeta = api.TypeMeta{
	Kind:    FailureKind,
	Version: FailureVersion,
}

FailureTypeMeta is the failure type metadata.

Functions

This section is empty.

Types

type AttackMap

type AttackMap map[string]attack.Opts

AttackMap is a type that defines a list of map of attackers.

type Experiment

type Experiment struct {
	api.TypeMeta

	Metadata api.ObjectMeta   `json:"metadata,omitempty"`
	Spec     ExperimentSpec   `json:"spec,omitempty"`
	Status   ExperimentStatus `json:"status,omitempty"`
}

Experiment is only a simple group of failures that are being injected in the targets that have been selected by the experiment using selectors.

func NewExperiment

func NewExperiment() Experiment

NewExperiment is a plain Experiment object contructor.

func (*Experiment) DeepCopy

func (e *Experiment) DeepCopy() api.Object

DeepCopy satisfies object interface.

func (*Experiment) GetObjectMetadata

func (e *Experiment) GetObjectMetadata() api.ObjectMeta

GetObjectMetadata satisfies object interface.

type ExperimentFailureTemplate

type ExperimentFailureTemplate struct {
	Spec FailureSpec `json:"spec,omitempty"`
}

ExperimentFailureTemplate is the template of a failure

type ExperimentList

type ExperimentList struct {
	api.TypeMeta `json:",inline"`
	ListMetadata api.ListMeta  `json:"listMetadata,omitempty"`
	Items        []*Experiment `json:"items,omitempty"`
}

ExperimentList is a experiment list.

func NewExperimentList

func NewExperimentList(experiments []*Experiment, continueList string) ExperimentList

NewExperimentList returns a new ExperimentList.

func (*ExperimentList) DeepCopy

func (e *ExperimentList) DeepCopy() api.Object

DeepCopy satisfies object interface.

func (*ExperimentList) GetItems

func (e *ExperimentList) GetItems() []api.Object

GetItems satisfies ObjectList interface.

func (*ExperimentList) GetListMetadata

func (e *ExperimentList) GetListMetadata() api.ListMeta

GetListMetadata satisfies objectList interface.

func (*ExperimentList) GetObjectMetadata

func (e *ExperimentList) GetObjectMetadata() api.ObjectMeta

GetObjectMetadata satisfies object interface.

type ExperimentSpec

type ExperimentSpec struct {
	// Name is the name of the experiment.
	Name string `json:"name,omitempty"`
	// Description is the description of the experiment.
	Description string `json:"description,omitempty"`
	// Selector is the map of key-value pairs that will match the desired nodes where the attacks
	// will be injected.
	Selector map[string]string         `json:"selector,omitempty"`
	Template ExperimentFailureTemplate `json:"template,omitempty"`
}

ExperimentSpec is the spec of the experiment

type ExperimentStatus

type ExperimentStatus struct {
	// FailureIDs are the IDs of the failures that have been created.
	FailureIDs []string  `json:"failureIDs,omitempty"`
	Creation   time.Time `json:"creation,omitempty"` // Creation is when the creation of the node happenned.
}

ExperimentStatus is the status after the creation of the Experiment.

type Failure

type Failure struct {
	api.TypeMeta `json:",inline"`
	// Metdata is additional data of a failure object.
	Metadata api.ObjectMeta `json:"metadata,omitempty"`
	// Spec has all the required data to create a Failure and use it.
	Spec FailureSpec `json:"spec,omitempty"`
	// Status is the current information and status of the Failure.
	Status FailureStatus `json:"status,omitempty"`
}

Failure is the way a failure is defined.

func NewFailure

func NewFailure() Failure

NewFailure is a plain Failure object contructor.

func (*Failure) DeepCopy

func (f *Failure) DeepCopy() api.Object

DeepCopy satisfies object interface.

func (*Failure) GetObjectMetadata

func (f *Failure) GetObjectMetadata() api.ObjectMeta

GetObjectMetadata satisfies object interface.

type FailureList

type FailureList struct {
	api.TypeMeta `json:",inline"`
	ListMetadata api.ListMeta `json:"listMetadata,omitempty"`
	Items        []*Failure   `json:"items,omitempty"`
}

FailureList is a failure list.

func NewFailureList

func NewFailureList(failures []*Failure, continueList string) FailureList

NewFailureList returns a new FailureList.

func (*FailureList) DeepCopy

func (f *FailureList) DeepCopy() api.Object

DeepCopy satisfies object interface.

func (*FailureList) GetItems

func (f *FailureList) GetItems() []api.Object

GetItems satisfies ObjectList interface.

func (*FailureList) GetListMetadata

func (f *FailureList) GetListMetadata() api.ListMeta

GetListMetadata satisfies objectList interface.

func (*FailureList) GetObjectMetadata

func (f *FailureList) GetObjectMetadata() api.ObjectMeta

GetObjectMetadata satisfies object interface.

type FailureSpec

type FailureSpec struct {
	// Timeout is
	Timeout time.Duration `json:"timeout,omitempty"`
	// Attacks used an array so the no repeated elements of map limitation can be bypassed.
	Attacks []AttackMap `json:"attacks,omitempty"`
}

FailureSpec is the specification that has the information to it can be created and applied.

type FailureState

type FailureState int

FailureState is the state a failure can be.

const (
	// UnknownFailureState is an unknown status.
	UnknownFailureState FailureState = iota
	// EnabledFailureState is when the failure should be making stuff.
	EnabledFailureState
	// ExecutingFailureState is when the failure its making stuff.
	ExecutingFailureState
	// RevertingFailureState is when the failure is being reverted.
	RevertingFailureState
	// DisabledFailureState is when the failure is should be not making stuff.
	DisabledFailureState
	// StaleFailureState is when the failure has go through alll the lifecycle and should be archived ((reverted already).
	StaleFailureState
	// ErroredFailureState is when the failure is not making stuff (due to an error).
	ErroredFailureState
	// ErroredRevertingFailureState is when the failure is not making stuff (due to an error reverting).
	ErroredRevertingFailureState
)

func (FailureState) String

func (f FailureState) String() string

type FailureStatus

type FailureStatus struct {
	CurrentState  FailureState `json:"currentState,omitempty"`  // CurrentState is the state of the failure.
	ExpectedState FailureState `json:"expectedState,omitempty"` // ExpectedState is the state the failure should be.
	Creation      time.Time    `json:"creation,omitempty"`      // Creation is when the failure injection was created.
	Executed      time.Time    `json:"executed,omitempty"`      // Executed is when the failure injectionwas executed.
	Finished      time.Time    `json:"finished,omitempty"`      // Finished is when the failure injection was reverted.
}

FailureStatus has all the information of a failure to create an injection

Directories

Path Synopsis
Package pb is a generated protocol buffer package.
Package pb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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