pkg

package
v0.0.0-...-a222fec Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAfterMatch

func AddAfterMatch(filepath, key, newvalue string) error

AddAfterMatch will add a new line when a match is found

func AddAnnotation

func AddAnnotation(deployment, key, value, ns string) error

AddAnnotation will add or update annotation on an application

func ChaosAbort

func ChaosAbort(testsDetails *types.TestDetails, clients environment.ClientSets) error

ChaosAbort will abort the execution of chaosexperiment

func ChaosEngineVerdict

func ChaosEngineVerdict(testsDetails *types.TestDetails, clients environment.ClientSets) error

ChaosEngineVerdict checks the chaosengine verdict

func ChaosPodLogs

func ChaosPodLogs(testsDetails *types.TestDetails, clients environment.ClientSets) error

ChaosPodLogs will print the experiment and helper pod logs

func ChaosPodStatus

func ChaosPodStatus(testsDetails *types.TestDetails, clients environment.ClientSets) error

ChaosPodStatus will check the creation of chaos pod

func ChaosResultVerdict

func ChaosResultVerdict(testsDetails *types.TestDetails, clients environment.ClientSets) error

ChaosResultVerdict checks the chaos result verdict

func CheckRunHistoryUpdate

func CheckRunHistoryUpdate(testsDetails *types.TestDetails, clients environment.ClientSets, previousRunHistory v1alpha1.HistoryDetails) error

CheckRunHistoryUpdate checks the chaos result run history according to the ChaosResultVerdict

func CheckRunnerPodCreation

func CheckRunnerPodCreation(engineName, runnerNS string, clients environment.ClientSets) error

CheckRunnerPodCreation will check for the create of runner pod

func Cleanup

func Cleanup() error

Cleanup will delete the chaosengine and chaosexperiment in all namespaces

func CreateChaosResource

func CreateChaosResource(testsDetails *types.TestDetails, fileData []byte, namespace string, clients environment.ClientSets) error

CreateChaosResource creates litmus components with given inputs

func CreateDeployment

func CreateDeployment(clients environment.ClientSets, deploymentName, image, namespace string) error

CreateDeployment will create a deployment

func CreateNamespace

func CreateNamespace(clients environment.ClientSets, namespaceName string) error

CreateNamespace is used to create a namespace

func DeploymentCleanupCheck

func DeploymentCleanupCheck(testsDetails *types.TestDetails, deploymentName string, clients environment.ClientSets) error

DeploymentCleanupCheck checks the termination of deployment

func DeploymentStatusCheck

func DeploymentStatusCheck(testsDetails *types.TestDetails, deploymentName, deploymentNS string, clients environment.ClientSets) error

DeploymentStatusCheck checks running status of deployment with deployment name and namespace

func DownloadFile

func DownloadFile(filepath string, url string) error

DownloadFile will download a url to a local file. It's efficient because it will write as it downloads and not load the whole file into memory.

func EditFile

func EditFile(filepath, old, new string) error

EditFile will edit the content of a file

func EditKeyValue

func EditKeyValue(filepath, key, oldvalue, newvalue string) error

EditKeyValue will edit the value according to key content of the file

func GetAppNameAndIP

func GetAppNameAndIP(appLabel, appNS string, clients environment.ClientSets) (string, string, string, error)

GetAppNameAndIP will return the first app name and its ip along with a helper pod to ping from the list of app pods

func GetApplicationNode

func GetApplicationNode(testsDetails *types.TestDetails, clients environment.ClientSets) error

GetApplicationNode will give the node name of the application pod

func GetChaosEngineVerdict

func GetChaosEngineVerdict(testsDetails *types.TestDetails, clients environment.ClientSets) (string, error)

GetChaosEngineVerdict checks the chaosengine verdict

func GetChaosResultVerdict

func GetChaosResultVerdict(testsDetails *types.TestDetails, clients environment.ClientSets) (string, error)

GetChaosResultVerdict checks the chaos result verdict

func GetImageTag

func GetImageTag(experimentImage string) string

GetImageTag returns the Go experiment image tag

func GetJobPod

func GetJobPod(testsDetails *types.TestDetails, jobNamespace string, clients environment.ClientSets) error

GetJobPod checks the job pod is present or not

func GetRandomNode

func GetRandomNode(clients environment.ClientSets) (*v1.Node, error)

GetRandomNode returns a random node name

func GetRunHistoryStatus

func GetRunHistoryStatus(testsDetails *types.TestDetails, clients environment.ClientSets) v1alpha1.HistoryDetails

GetRunHistoryStatus fetches the chaos result run history

func GetSelectorNode

func GetSelectorNode(testsDetails *types.TestDetails, clients environment.ClientSets) (string, error)

GetSelectorNode will return a node other than the application node selected for using in node selector in chaos engine spec

func GetUID

func GetUID(engineName, namespace string, clients environment.ClientSets) (string, error)

GetUID will return the uid from chaosengine

func InstallAdminRbac

func InstallAdminRbac(testsDetails *types.TestDetails) error

InstallAdminRbac installs admin rbac to run chaos

func InstallGoChaosEngine

func InstallGoChaosEngine(testsDetails *types.TestDetails, chaosEngine *v1alpha1.ChaosEngine, engineNamespace string, setAppInfo bool, clients environment.ClientSets) error

InstallGoChaosEngine installs the given go based chaos engine

func InstallGoChaosExperiment

func InstallGoChaosExperiment(testsDetails *types.TestDetails, chaosExperiment *v1alpha1.ChaosExperiment, experimentNamespace string, clients environment.ClientSets) error

InstallGoChaosExperiment installs the given go based chaos experiment

func InstallGoRbac

func InstallGoRbac(testsDetails *types.TestDetails, rbacNamespace string) error

InstallGoRbac installs and configure rbac for running go based chaos

func InstallLitmus

func InstallLitmus(testsDetails *types.TestDetails) error

InstallLitmus installs the latest version of litmus

func Int32Ptr

func Int32Ptr(i int32) *int32

func Kubectl

func Kubectl(command ...string) error

Kubectl will run kubectl commands and print the output

func NodeCordon

func NodeCordon(testsDetails *types.TestDetails) error

NodeCordon will cordon the given node

func NodeUncordon

func NodeUncordon(testsDetails *types.TestDetails) error

NodeUncordon will uncordon the given node

func OperatorStatusCheck

func OperatorStatusCheck(testsDetails *types.TestDetails, clients environment.ClientSets) error

OperatorStatusCheck checks the running status of chaos operator

func PodStatusCheck

func PodStatusCheck(testsDetails *types.TestDetails, clients environment.ClientSets) error

PodStatusCheck checks the pod running status

func PrepareChaos

func PrepareChaos(testsDetails *types.TestDetails, chaosExperiment *v1alpha1.ChaosExperiment, chaosEngine *v1alpha1.ChaosEngine, clients environment.ClientSets, annotation bool) error

PrepareChaos install all the Chaos resourses like rbac, experiment and engine

func RunnerPodStatus

func RunnerPodStatus(testsDetails *types.TestDetails, runnerNamespace string, clients environment.ClientSets) error

RunnerPodStatus will check the runner pod running state

func UpdateEngine

func UpdateEngine(testsDetails *types.TestDetails, clients environment.ClientSets) error

UpdateEngine updating engine

func UpdateExperiment

func UpdateExperiment(testsDetails *types.TestDetails, clients environment.ClientSets) error

UpdateExperiment updating experiment

func UpdatePipelineStatus

func UpdatePipelineStatus(testsDetails *types.TestDetails, coverageData string) error

UpdatePipelineStatus will update the status of pipeline at the end of all jobs

func UpdateResultTable

func UpdateResultTable(experimentDetails, testVerdict string, testsDetails *types.TestDetails) error

UpdateResultTable will update the result of pipelines in a table on github using python update script

func ValidateNetworkChaos

func ValidateNetworkChaos(testsDetails *types.TestDetails, TargetPodIP, HelperPod string, clients environment.ClientSets) error

ValidateNetworkChaos checks the network interruption in the target pod specified

func ValidateNodeName

func ValidateNodeName(nodeName string, clients environment.ClientSets, testsDetails *types.TestDetails) error

ValidateNodeName validates a given target node name with the target node name present in the chaos result

func ValidateTargetPodChaos

func ValidateTargetPodChaos(testsDetails *types.TestDetails, clients environment.ClientSets) error

ValidateTargetPodChaos will check if the chaos induced on target pod or not.

func WaitForChaosResultCompletion

func WaitForChaosResultCompletion(testsDetails *types.TestDetails, clients environment.ClientSets) error

WaitForChaosResultCompletion waits for chaosresult state to get completed

func WaitForEngineStatus

func WaitForEngineStatus(testsDetails *types.TestDetails, clients environment.ClientSets, status string) error

WaitForEngineStatus waits for engine state to get completed

func WaitForRunnerCompletion

func WaitForRunnerCompletion(testsDetails *types.TestDetails, clients environment.ClientSets) error

WaitForRunnerCompletion waits for runner pod completion

Types

type ENVDetails

type ENVDetails struct {
	ENV map[string]string
}

ENVDetails contains the ENV details

func (*ENVDetails) SetEnv

func (envDetails *ENVDetails) SetEnv(key, value string) *ENVDetails

SetEnv sets the env inside envDetails struct

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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