Documentation ¶
Index ¶
- Constants
- func GetChaosEngine(chaosDetails *ChaosDetails, clients clients.ClientSets) (*v1alpha1.ChaosEngine, error)
- func GetChaosResultVerdictEvent(verdict v1alpha1.ResultVerdict) (string, string)
- func GetValuesFromChaosEngine(chaosDetails *ChaosDetails, clients clients.ClientSets, ...) error
- func Getenv(key string, defaultValue string) string
- func InitialiseChaosVariables(chaosDetails *ChaosDetails)
- func InitializeProbesInChaosResultDetails(chaosresult *ResultDetails, probes []v1alpha1.ProbeAttributes) error
- func InitializeSidecarDetails(chaosDetails *ChaosDetails, engine *v1alpha1.ChaosEngine, env []corev1.EnvVar)
- func SetEngineEventAttributes(eventsDetails *EventDetails, Reason, Message, Type string, ...)
- func SetResultAfterCompletion(resultDetails *ResultDetails, verdict v1alpha1.ResultVerdict, ...)
- func SetResultAttributes(resultDetails *ResultDetails, chaosDetails ChaosDetails)
- func SetResultEventAttributes(eventsDetails *EventDetails, Reason, Message, Type string, ...)
- type AppDetails
- type ChaosDetails
- type EventDetails
- type ExperimentPhase
- type ParentResource
- type ProbeArtifact
- type ProbeContext
- type ProbeDetails
- type ProbeTimeouts
- type RegisterDetails
- type ResultDetails
- type SideCar
Constants ¶
const ( SideCarEnabled = "sidecar/enabled" SideCarPrefix = "SIDECAR" )
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 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 ¶
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 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 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