types

package
v0.0.0-...-7e08c69 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 15 Imported by: 9

Documentation

Index

Constants

View Source
const (
	SideCarEnabled = "sidecar/enabled"
	SideCarPrefix  = "SIDECAR"
)
View Source
const (
	// PreChaosCheck initial stage of experiment check for health before chaos injection
	PreChaosCheck string = "PreChaosCheck"
	// PostChaosCheck  pre-final stage of experiment check for health after chaos injection
	PostChaosCheck string = "PostChaosCheck"
	// Summary final stage of experiment update the verdict
	Summary string = "Summary"
	// ChaosInject this stage refer to the main chaos injection
	ChaosInject string = "ChaosInject"
	// AwaitedVerdict marked the start of test
	AwaitedVerdict string = "Awaited"
	// PassVerdict marked the verdict as passed in the end of experiment
	PassVerdict string = "Pass"
	// FailVerdict marked the verdict as failed in the end of experiment
	FailVerdict string = "Fail"
	// AbortVerdict marked the verdict as abort when experiment aborted
	AbortVerdict string = "Abort"
	// ErrorVerdict marked the verdict as error in the end of experiment
	ErrorVerdict string = "Error"
)

Variables

This section is empty.

Functions

func GetChaosEngine

func GetChaosEngine(chaosDetails *ChaosDetails, clients clients.ClientSets) (*v1alpha1.ChaosEngine, error)

GetChaosEngine fetches the chaosengine instance

func GetChaosResultVerdictEvent

func GetChaosResultVerdictEvent(verdict v1alpha1.ResultVerdict) (string, string)

GetChaosResultVerdictEvent return the verdict and event type

func GetValuesFromChaosEngine

func GetValuesFromChaosEngine(chaosDetails *ChaosDetails, clients clients.ClientSets, chaosresult *ResultDetails) error

GetValuesFromChaosEngine get the values from the chaosengine

func Getenv

func Getenv(key string, defaultValue string) string

Getenv fetch the env and set the default value, if any

func InitialiseChaosVariables

func InitialiseChaosVariables(chaosDetails *ChaosDetails)

InitialiseChaosVariables initialise all the global variables

func InitializeProbesInChaosResultDetails

func InitializeProbesInChaosResultDetails(chaosresult *ResultDetails, probes []v1alpha1.ProbeAttributes) error

func InitializeSidecarDetails

func InitializeSidecarDetails(chaosDetails *ChaosDetails, engine *v1alpha1.ChaosEngine, env []corev1.EnvVar)

InitializeSidecarDetails sets the sidecar details

func SetEngineEventAttributes

func SetEngineEventAttributes(eventsDetails *EventDetails, Reason, Message, Type string, chaosDetails *ChaosDetails)

SetEngineEventAttributes initialise attributes for event generation in chaos engine

func SetResultAfterCompletion

func SetResultAfterCompletion(resultDetails *ResultDetails, verdict v1alpha1.ResultVerdict, phase v1alpha1.ResultPhase, failStep string, errorCode cerrors.ErrorType)

SetResultAfterCompletion set all the chaos result ENV in the EOT

func SetResultAttributes

func SetResultAttributes(resultDetails *ResultDetails, chaosDetails ChaosDetails)

SetResultAttributes initialise all the chaos result ENV

func SetResultEventAttributes

func SetResultEventAttributes(eventsDetails *EventDetails, Reason, Message, Type string, resultDetails *ResultDetails)

SetResultEventAttributes initialise attributes for event generation in chaos result

Types

type AppDetails

type AppDetails struct {
	Namespace string
	Labels    []string
	Kind      string
	Names     []string
}

AppDetails contains all the application related envs

func GetTargets

func GetTargets(targets string) []AppDetails

type ChaosDetails

type ChaosDetails struct {
	ChaosUID             clientTypes.UID
	ChaosNamespace       string
	ChaosPodName         string
	EngineName           string
	InstanceID           string
	ExperimentName       string
	Timeout              int
	Delay                int
	AppDetail            []AppDetails
	ChaosDuration        int
	JobCleanupPolicy     string
	ProbeImagePullPolicy string
	Randomness           bool
	Targets              []v1alpha1.TargetDetails
	ParentsResources     []ParentResource
	DefaultHealthCheck   bool
	Annotations          map[string]string
	Resources            corev1.ResourceRequirements
	ImagePullSecrets     []corev1.LocalObjectReference
	Labels               map[string]string
	Phase                ExperimentPhase
	ProbeContext         ProbeContext
	SideCar              []SideCar
}

ChaosDetails is for collecting all the global variables

type EventDetails

type EventDetails struct {
	Message      string
	Reason       string
	ResourceName string
	ResourceUID  clientTypes.UID
	Type         string
}

EventDetails is for collecting all the events-related details

type ExperimentPhase

type ExperimentPhase string
const (
	PreChaosPhase    ExperimentPhase = "PreChaos"
	PostChaosPhase   ExperimentPhase = "PostChaos"
	ChaosInjectPhase ExperimentPhase = "ChaosInject"
)

type ParentResource

type ParentResource struct {
	Name      string
	Kind      string
	Namespace string
}

type ProbeArtifact

type ProbeArtifact struct {
	ProbeArtifacts RegisterDetails
}

ProbeArtifact contains the probe artifacts

type ProbeContext

type ProbeContext struct {
	Ctx        context.Context
	CancelFunc context.CancelFunc
}

type ProbeDetails

type ProbeDetails struct {
	Name                   string
	Type                   string
	Mode                   string
	Status                 v1alpha1.ProbeStatus
	IsProbeFailedWithError error
	Failed                 bool
	HasProbeCompleted      bool
	RunID                  string
	RunCount               int
	Stopped                bool
	Timeouts               ProbeTimeouts
}

ProbeDetails is for collecting all the probe details

type ProbeTimeouts

type ProbeTimeouts struct {
	ProbeTimeout         time.Duration
	Interval             time.Duration
	ProbePollingInterval time.Duration
	InitialDelay         time.Duration
	EvaluationTimeout    time.Duration
}

type RegisterDetails

type RegisterDetails struct {
	Register string
}

RegisterDetails contains the output of the corresponding probe

type ResultDetails

type ResultDetails struct {
	Name             string
	Verdict          v1alpha1.ResultVerdict
	ErrorOutput      *v1alpha1.ErrorOutput
	Phase            v1alpha1.ResultPhase
	ResultUID        clientTypes.UID
	ProbeDetails     []*ProbeDetails
	PassedProbeCount int
	ProbeArtifacts   map[string]ProbeArtifact
}

ResultDetails is for collecting all the chaos-result-related details

type SideCar

type SideCar struct {
	ENV             []corev1.EnvVar
	Image           string
	ImagePullPolicy corev1.PullPolicy
	Name            string
	Secrets         []v1alpha1.Secret
	EnvFrom         []corev1.EnvFromSource
}

Jump to

Keyboard shortcuts

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