chaos

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chaos

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

Chaos is the service that will ensure that the desired pod terminator CRDs are met. Chaos will have running instances of PodDestroyers.

func NewChaos

func NewChaos(k8sCli kubernetes.Interface, logger log.Logger) *Chaos

NewChaos returns a new Chaos service.

func (*Chaos) DeletePodTerminator

func (c *Chaos) DeletePodTerminator(name string) error

DeletePodTerminator satisfies ChaosSyncer interface.

func (*Chaos) EnsurePodTerminator

func (c *Chaos) EnsurePodTerminator(pt *chaosv1alpha1.PodTerminator) error

EnsurePodTerminator satisfies ChaosSyncer interface.

type PodKiller

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

PodKiller will kill pods at regular intervals.

func NewCustomPodKiller

func NewCustomPodKiller(pt *chaosv1alpha1.PodTerminator, k8sCli kubernetes.Interface, time TimeWrapper, logger log.Logger) *PodKiller

NewCustomPodKiller is a constructor that lets you customize everything on the object construction.

func NewPodKiller

func NewPodKiller(pt *chaosv1alpha1.PodTerminator, k8sCli kubernetes.Interface, logger log.Logger) *PodKiller

NewPodKiller returns a new pod killer.

func (*PodKiller) SameSpec

func (p *PodKiller) SameSpec(pt *chaosv1alpha1.PodTerminator) bool

SameSpec checks if the pod killer has the same spec.

func (*PodKiller) Start

func (p *PodKiller) Start() error

Start will run the pod killer at regular intervals.

func (*PodKiller) Stop

func (p *PodKiller) Stop() error

Stop stops the pod killer.

type Syncer

type Syncer interface {
	// EnsurePodTerminator will ensure that the pod terminator is running and working.
	EnsurePodTerminator(pt *chaosv1alpha1.PodTerminator) error
	// DeletePodTerminator will stop and delete the pod terminator.
	DeletePodTerminator(name string) error
}

Syncer is the interface that every chaos service implementation needs to implement.

type TimeWrapper

type TimeWrapper interface {
	// After is the same as time.After
	After(d time.Duration) <-chan time.Time
	// Now is the same as Now.
	Now() time.Time
}

TimeWrapper is a wrapper around time so it can be mocked

Jump to

Keyboard shortcuts

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