safemode

package
v0.0.0-...-5a438e0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Reinit

func Reinit(safetyNets []Safemode, disruption v1beta1.Disruption, k8sClient client.Client)

Reinit resets the saved disruption configs for each safety net in the case where the same disruption is updated with new parameters

Types

type CPU

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

func (*CPU) Init

func (sm *CPU) Init(disruption v1beta1.Disruption, client client.Client)

Init Refer to safemode.Safemode interface for documentation

type ContainerFailure

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

func (*ContainerFailure) Init

func (sm *ContainerFailure) Init(disruption v1beta1.Disruption, client client.Client)

Init Refer to safemode.Safemode interface for documentation

type DNS

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

func (*DNS) Init

func (sm *DNS) Init(disruption v1beta1.Disruption, client client.Client)

Init Refer to safemode.Safemode interface for documentation

type DiskFailure

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

func (*DiskFailure) Init

func (sm *DiskFailure) Init(disruption v1beta1.Disruption, client client.Client)

Init Refer to safemode.Safemode interface for documentation

type DiskPressure

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

func (*DiskPressure) Init

func (sm *DiskPressure) Init(disruption v1beta1.Disruption, client client.Client)

Init Refer to safemode.Safemode interface for documentation

type GRPC

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

func (*GRPC) Init

func (sm *GRPC) Init(disruption v1beta1.Disruption, client client.Client)

Init Refer to safemode.Safemode interface for documentation

type Generic

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

func (*Generic) Init

func (sm *Generic) Init(disruption v1beta1.Disruption, client client.Client)

Init Refer to safemode.Safemode interface for documentation

type Network

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

func (*Network) Init

func (sm *Network) Init(disruption v1beta1.Disruption, client client.Client)

Init Refer to safemode.Safemode interface for documentation

type Node

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

func (*Node) Init

func (sm *Node) Init(disruption v1beta1.Disruption, client client.Client)

Init Refer to safemode.Safemode interface for documentation

type Safemode

type Safemode interface {
	// Init will grab the necessary spec depending on the type (e.g. SafemodeNetwork will grab NetworkDisruptionSpec)
	// and grab the disruption itself for data such as the kubernetes namespace the disruption is running on
	// It will also grab the kube client for functions that require state information from k8s system
	Init(disruption v1beta1.Disruption, client client.Client)
}

func AddAllSafemodeObjects

func AddAllSafemodeObjects(disruption v1beta1.Disruption, k8sClient client.Client) []Safemode

AddAllSafemodeObjects will populate a list of Safemode objects with Safemode's related to the disruptions described in the disruption in question. Once populated, the list can be traversed and run with the same function which applies all safety nets for each Safemode object.

type SafemodeMock

type SafemodeMock struct {
	mock.Mock
}

SafemodeMock is an autogenerated mock type for the Safemode type

func NewSafemodeMock

func NewSafemodeMock(t interface {
	mock.TestingT
	Cleanup(func())
}) *SafemodeMock

NewSafemodeMock creates a new instance of SafemodeMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*SafemodeMock) EXPECT

func (_m *SafemodeMock) EXPECT() *SafemodeMock_Expecter

func (*SafemodeMock) Init

func (_m *SafemodeMock) Init(disruption v1beta1.Disruption, _a1 client.Client)

Init provides a mock function with given fields: disruption, _a1

type SafemodeMock_Expecter

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

func (*SafemodeMock_Expecter) Init

func (_e *SafemodeMock_Expecter) Init(disruption interface{}, _a1 interface{}) *SafemodeMock_Init_Call

Init is a helper method to define mock.On call

  • disruption v1beta1.Disruption
  • _a1 client.Client

type SafemodeMock_Init_Call

type SafemodeMock_Init_Call struct {
	*mock.Call
}

SafemodeMock_Init_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Init'

func (*SafemodeMock_Init_Call) Return

func (*SafemodeMock_Init_Call) Run

func (_c *SafemodeMock_Init_Call) Run(run func(disruption v1beta1.Disruption, _a1 client.Client)) *SafemodeMock_Init_Call

func (*SafemodeMock_Init_Call) RunAndReturn

Jump to

Keyboard shortcuts

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