chaos

package
v0.0.0-...-3803488 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context interface {
	// GetSpec returns the current specification of the deployment
	GetSpec() api.DeploymentSpec
	// DeletePod deletes a pod with given name in the namespace
	// of the deployment. If the pod does not exist, the error is ignored.
	DeletePod(ctx context.Context, podName string, options meta.DeleteOptions) error
	// GetOwnedPods returns a list of all pods owned by the deployment.
	GetOwnedPods(ctx context.Context) ([]core.Pod, error)
}

Context provides methods to the chaos package.

type Monkey

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

Monkey is the service that introduces chaos in the deployment if allowed and enabled.

func NewMonkey

func NewMonkey(namespace, name string, context Context) *Monkey

NewMonkey creates a new chaos monkey with given context.

func (Monkey) Run

func (m Monkey) Run(stopCh <-chan struct{})

Run the monkey until the given channel is closed.

func (Monkey) WrapLogger

func (m Monkey) WrapLogger(in *zerolog.Event) *zerolog.Event

Jump to

Keyboard shortcuts

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