chaos

package
v0.14.9 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Docker and docker-tc commands
	CmdPause     = "pause"
	CmdDelay     = "delay"
	CmdLoss      = "loss"
	CmdDuplicate = "duplicate"
	CmdCorrupt   = "corrupt"
)

Variables

This section is empty.

Functions

func ExecPumba

func ExecPumba(command string, wait time.Duration) (func(), error)

DEPRECATED: Since Pumba has outdated Docker dependencies it may not work without additional setting to allow using Docker client which is out of client<>server compatibility range. Use NewDockerChaos for pause and network experiments!

ExecPumba executes Pumba (https://github.com/alexei-led/pumba) command since handling various docker race conditions is hard and there is no easy API for that for now you can provide time to wait until chaos is applied

Types

type DockerChaos added in v0.14.8

type DockerChaos struct {
	Experiments map[string]string
}

DockerChaos is a chaos generator for Docker

func NewDockerChaos added in v0.14.8

func NewDockerChaos(ctx context.Context) (*DockerChaos, error)

NewDockerChaos creates a new "docker-tc" instance or reuses existing one

func (*DockerChaos) Chaos added in v0.14.8

func (m *DockerChaos) Chaos(containerName string, cmd, val string) error

Chaos executes either Docker or "docker-tc" commands

func (*DockerChaos) RemoveAll added in v0.14.8

func (m *DockerChaos) RemoveAll() error

RemoveAll removes all the experiments

Jump to

Keyboard shortcuts

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