chaos

package
v0.0.0-...-2c42c2a Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddRemovePolicy

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

AddRemovePolicy removes a node from the cluster, wipes it's data directory and it back to the cluster as a new node.

func (*AddRemovePolicy) Inject

Inject injects the failure policy.

func (*AddRemovePolicy) Recover

func (d *AddRemovePolicy) Recover(ctx context.Context, tc *cluster.TestCluster) error

Recover recovers from the failure policy.

func (*AddRemovePolicy) String

func (d *AddRemovePolicy) String() string

type DriftAllPolicy

type DriftAllPolicy struct{}

DriftAllPolicy introduces drift on all the nodes part of kronos cluster.

func (*DriftAllPolicy) Inject

func (d *DriftAllPolicy) Inject(
	ctx context.Context, tc *cluster.TestCluster,
) (time.Duration, error)

Inject injects the failure policy.

func (*DriftAllPolicy) Recover

func (d *DriftAllPolicy) Recover(ctx context.Context, tc *cluster.TestCluster) error

Recover recovers from the failure policy.

func (*DriftAllPolicy) String

func (d *DriftAllPolicy) String() string

type DriftOraclePolicy

type DriftOraclePolicy struct{}

DriftOraclePolicy introduces drift in the time of the oracle.

func (*DriftOraclePolicy) Inject

Inject injects the failure policy.

func (*DriftOraclePolicy) Recover

Recover recovers from the failure policy.

func (*DriftOraclePolicy) String

func (d *DriftOraclePolicy) String() string

type Policy

type Policy interface {
	Inject(ctx context.Context, tc *cluster.TestCluster) (time.Duration, error)
	Recover(ctx context.Context, tc *cluster.TestCluster) error
	String() string
}

Policy describes the chaos policies that we inject while we are testing the cluster.

type RestartAllPolicy

type RestartAllPolicy struct{}

RestartAllPolicy restart all the nodes part of kronos cluster.

func (*RestartAllPolicy) Inject

Inject injects the failure policy.

func (*RestartAllPolicy) Recover

Recover recovers from the failure policy.

func (*RestartAllPolicy) String

func (r *RestartAllPolicy) String() string

type RestartOraclePolicy

type RestartOraclePolicy struct{}

RestartOraclePolicy restarts the oracle.

func (*RestartOraclePolicy) Inject

Inject injects the failure policy.

func (*RestartOraclePolicy) Recover

Recover recovers from the failure policy.

func (*RestartOraclePolicy) String

func (r *RestartOraclePolicy) String() string

type StopAnySubsetPolicy

type StopAnySubsetPolicy struct {
	MaxNodeFailuresAllowed int
	// contains filtered or unexported fields
}

StopAnySubsetPolicy stops any subset of nodes in the cluster. Only MaxNodeFailuresAllowed are allowed to be stopped together.

func (*StopAnySubsetPolicy) Inject

Inject injects the failure policy.

func (*StopAnySubsetPolicy) Recover

Recover recovers from the failure policy.

func (*StopAnySubsetPolicy) String

func (s *StopAnySubsetPolicy) String() string

type StopOraclePolicy

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

StopOraclePolicy stops the oracle node.

func (*StopOraclePolicy) Inject

Inject injects the failure policy.

func (*StopOraclePolicy) Recover

Recover recovers from the failure policy.

func (*StopOraclePolicy) String

func (s *StopOraclePolicy) String() string

Jump to

Keyboard shortcuts

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