chaos

package
v0.0.0-...-33929cd Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NAMESPACE  = metav1.NamespaceDefault
	IDENTIFIER = "kube-monkey-id"
	KIND       = "Pod"
	NAME       = "name"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Chaos

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

func New

func New(killtime time.Time, victim victims.Victim) *Chaos

New creates a new Chaos instance

func NewMock

func NewMock() *Chaos

func (*Chaos) DurationToKillTime

func (c *Chaos) DurationToKillTime() time.Duration

DurationToKillTime calculates the duration from now until Chaos.killAt

func (*Chaos) Execute

func (c *Chaos) Execute(resultchan chan<- *Result)

Execute exposed function that calls the actual execution of the chaos, i.e. termination of pods The result is sent back over the channel provided

func (*Chaos) KillAt

func (c *Chaos) KillAt() time.Time

func (*Chaos) NewResult

func (c *Chaos) NewResult(e error) *Result

NewResult creates a ChaosResult instance

func (*Chaos) Schedule

func (c *Chaos) Schedule(resultchan chan<- *Result)

Schedule the execution of Chaos

func (*Chaos) Victim

func (c *Chaos) Victim() victims.Victim

type Result

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

func NewResult

func NewResult(chaos *Chaos, err error) *Result

NewResult creates a new Result instance

func (*Result) Error

func (r *Result) Error() error

func (*Result) Victim

func (r *Result) Victim() victims.Victim

type VictimMock

type VictimMock struct {
	mock.Mock
	victims.VictimBase
}

func NewVictimMock

func NewVictimMock() *VictimMock

func (*VictimMock) DeleteRandomPod

func (vm *VictimMock) DeleteRandomPod(clientset kube.Interface) error

func (*VictimMock) DeleteRandomPods

func (vm *VictimMock) DeleteRandomPods(clientset kube.Interface, killValue int) error

func (*VictimMock) IsBlacklisted

func (vm *VictimMock) IsBlacklisted() bool

func (*VictimMock) IsEnrolled

func (vm *VictimMock) IsEnrolled(clientset kube.Interface) (bool, error)

func (*VictimMock) IsWhitelisted

func (vm *VictimMock) IsWhitelisted() bool

func (*VictimMock) KillNumberForFixedPercentage

func (vm *VictimMock) KillNumberForFixedPercentage(clientset kube.Interface, killValue int) (int, error)

func (*VictimMock) KillNumberForKillingAll

func (vm *VictimMock) KillNumberForKillingAll(clientset kube.Interface) (int, error)

func (*VictimMock) KillNumberForMaxPercentage

func (vm *VictimMock) KillNumberForMaxPercentage(clientset kube.Interface, killValue int) (int, error)

func (*VictimMock) KillType

func (vm *VictimMock) KillType(clientset kube.Interface) (string, error)

func (*VictimMock) KillValue

func (vm *VictimMock) KillValue(clientset kube.Interface) (int, error)

Jump to

Keyboard shortcuts

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