From bfdb4216ddc4f9b69d94a1ea50295340a1b32b61 Mon Sep 17 00:00:00 2001 From: UDIT GAURAV <35391335+uditgaurav@users.noreply.github.com> Date: Fri, 18 Sep 2020 10:26:43 +0530 Subject: [PATCH] cherry-pick for 1.8.1 (#134) * chore(socketPath): correcting socketPath env name (#124) Signed-off-by: shubhamchaudhary * chore(network-chaos): Adding ability to inject network chaos w/ pause container (#126) Signed-off-by: shubhamchaudhary * fix(permission-issue): fixing the username permission issue for sockfile (#129) Signed-off-by: shubhamchaudhary * chore(k8sprobe): Adding label-selector field in k8sprobe (#127) Signed-off-by: shubhamchaudhary * Chore/ Splitting different files for network chaos experiment (#128) * Chore/ Splitting different variables for network chaos experiment Signed-off-by: Udit Gaurav * fix(userid): revert the userid from dockerfile (#131) Signed-off-by: shubhamchaudhary * fix(duplicate): fixing network duplicate exp (#132) Signed-off-by: shubhamchaudhary * chore(network-chaos): splitting network chaos for containerd (#133) Signed-off-by: shubhamchaudhary Co-authored-by: Shubham Chaudhary --- build/litmus-go/Dockerfile | 6 -- .../container-kill/lib/container-kill.go | 4 +- .../lib/corruption/corruption.go | 24 +++++++ .../lib/duplication/duplication.go | 24 +++++++ .../network-chaos/lib/latency/latency.go | 24 +++++++ .../litmus/network-chaos/lib/loss/loss.go | 24 +++++++ .../litmus/network-chaos/lib/network-chaos.go | 35 +++------- .../lib/corruption/corruption.go | 44 ++++++++++++ .../lib/duplication/duplication.go | 44 ++++++++++++ .../network-chaos/lib/latency/latency.go | 44 ++++++++++++ chaoslib/pumba/network-chaos/lib/loss/loss.go | 44 ++++++++++++ .../pumba/network-chaos/lib/network-chaos.go | 69 +++---------------- .../generic/container-kill/test/test.yml | 17 ++++- .../pod-network-corruption.go | 8 +-- .../pod-network-corruption/test/test.yml | 17 ++++- .../pod-network-duplication.go | 8 +-- .../pod-network-duplication/test/test.yml | 17 ++++- .../pod-network-latency.go | 8 +-- .../generic/pod-network-latency/test/test.yml | 17 ++++- .../pod-network-loss/pod-network-loss.go | 8 +-- .../generic/pod-network-loss/test/test.yml | 17 ++++- go.mod | 2 +- go.sum | 43 ++++++++---- .../container-kill/environment/environment.go | 2 +- pkg/generic/container-kill/types/types.go | 2 +- .../network-chaos/environment/environment.go | 2 +- pkg/generic/network-chaos/types/types.go | 2 +- pkg/probe/k8sprobe.go | 5 +- .../litmuschaos/v1alpha1/chaosengine_types.go | 28 +++++--- vendor/modules.txt | 2 +- 30 files changed, 449 insertions(+), 142 deletions(-) create mode 100644 chaoslib/litmus/network-chaos/lib/corruption/corruption.go create mode 100644 chaoslib/litmus/network-chaos/lib/duplication/duplication.go create mode 100644 chaoslib/litmus/network-chaos/lib/latency/latency.go create mode 100644 chaoslib/litmus/network-chaos/lib/loss/loss.go create mode 100644 chaoslib/pumba/network-chaos/lib/corruption/corruption.go create mode 100644 chaoslib/pumba/network-chaos/lib/duplication/duplication.go create mode 100644 chaoslib/pumba/network-chaos/lib/latency/latency.go create mode 100644 chaoslib/pumba/network-chaos/lib/loss/loss.go diff --git a/build/litmus-go/Dockerfile b/build/litmus-go/Dockerfile index 57ca2e95b..5441e24b3 100644 --- a/build/litmus-go/Dockerfile +++ b/build/litmus-go/Dockerfile @@ -19,9 +19,6 @@ FROM ubuntu:bionic LABEL maintainer="LitmusChaos" -ENV USER_UID=1001 \ - USER_NAME=litmus-go - #Installing necessary ubuntu packages RUN apt-get update && apt-get install -y curl bash systemd iproute2 @@ -43,7 +40,4 @@ COPY --from=builder /code/stress-ng/stress-ng / #Copying Necessary Files COPY ./build/_output ./litmus/experiments -RUN useradd -ms /bin/bash ${USER_NAME} WORKDIR /litmus -RUN chown -R ${USER_NAME}:root /litmus -USER ${USER_NAME} \ No newline at end of file diff --git a/chaoslib/litmus/container-kill/lib/container-kill.go b/chaoslib/litmus/container-kill/lib/container-kill.go index 49df65671..aebd55aa9 100644 --- a/chaoslib/litmus/container-kill/lib/container-kill.go +++ b/chaoslib/litmus/container-kill/lib/container-kill.go @@ -154,7 +154,7 @@ func CreateHelperPod(experimentsDetails *experimentTypes.ExperimentDetails, clie Name: "cri-socket", VolumeSource: apiv1.VolumeSource{ HostPath: &apiv1.HostPathVolumeSource{ - Path: experimentsDetails.ContainerPath, + Path: experimentsDetails.SocketPath, }, }, }, @@ -183,7 +183,7 @@ func CreateHelperPod(experimentsDetails *experimentTypes.ExperimentDetails, clie VolumeMounts: []apiv1.VolumeMount{ { Name: "cri-socket", - MountPath: experimentsDetails.ContainerPath, + MountPath: experimentsDetails.SocketPath, }, { Name: "cri-config", diff --git a/chaoslib/litmus/network-chaos/lib/corruption/corruption.go b/chaoslib/litmus/network-chaos/lib/corruption/corruption.go new file mode 100644 index 000000000..0d0371da8 --- /dev/null +++ b/chaoslib/litmus/network-chaos/lib/corruption/corruption.go @@ -0,0 +1,24 @@ +package corruption + +import ( + "strconv" + + network_chaos "github.com/litmuschaos/litmus-go/chaoslib/litmus/network-chaos/lib" + clients "github.com/litmuschaos/litmus-go/pkg/clients" + experimentTypes "github.com/litmuschaos/litmus-go/pkg/generic/network-chaos/types" + "github.com/litmuschaos/litmus-go/pkg/types" +) + +var err error + +//PodNetworkCorruptionChaos contains the steps to prepare and inject chaos +func PodNetworkCorruptionChaos(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails) error { + + args := "corrupt " + strconv.Itoa(experimentsDetails.NetworkPacketCorruptionPercentage) + err = network_chaos.PrepareAndInjectChaos(experimentsDetails, clients, resultDetails, eventsDetails, chaosDetails, args) + if err != nil { + return err + } + + return nil +} diff --git a/chaoslib/litmus/network-chaos/lib/duplication/duplication.go b/chaoslib/litmus/network-chaos/lib/duplication/duplication.go new file mode 100644 index 000000000..48291b3b4 --- /dev/null +++ b/chaoslib/litmus/network-chaos/lib/duplication/duplication.go @@ -0,0 +1,24 @@ +package duplication + +import ( + "strconv" + + network_chaos "github.com/litmuschaos/litmus-go/chaoslib/litmus/network-chaos/lib" + clients "github.com/litmuschaos/litmus-go/pkg/clients" + experimentTypes "github.com/litmuschaos/litmus-go/pkg/generic/network-chaos/types" + "github.com/litmuschaos/litmus-go/pkg/types" +) + +var err error + +//PodNetworkDuplicationChaos contains the steps to prepare and inject chaos +func PodNetworkDuplicationChaos(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails) error { + + args := "duplicate " + strconv.Itoa(experimentsDetails.NetworkPacketDuplicationPercentage) + err = network_chaos.PrepareAndInjectChaos(experimentsDetails, clients, resultDetails, eventsDetails, chaosDetails, args) + if err != nil { + return err + } + + return nil +} diff --git a/chaoslib/litmus/network-chaos/lib/latency/latency.go b/chaoslib/litmus/network-chaos/lib/latency/latency.go new file mode 100644 index 000000000..7ae39f3dd --- /dev/null +++ b/chaoslib/litmus/network-chaos/lib/latency/latency.go @@ -0,0 +1,24 @@ +package latency + +import ( + "strconv" + + network_chaos "github.com/litmuschaos/litmus-go/chaoslib/litmus/network-chaos/lib" + clients "github.com/litmuschaos/litmus-go/pkg/clients" + experimentTypes "github.com/litmuschaos/litmus-go/pkg/generic/network-chaos/types" + "github.com/litmuschaos/litmus-go/pkg/types" +) + +var err error + +//PodNetworkLatencyChaos contains the steps to prepare and inject chaos +func PodNetworkLatencyChaos(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails) error { + + args := "delay " + strconv.Itoa(experimentsDetails.NetworkLatency) + "ms" + err = network_chaos.PrepareAndInjectChaos(experimentsDetails, clients, resultDetails, eventsDetails, chaosDetails, args) + if err != nil { + return err + } + + return nil +} diff --git a/chaoslib/litmus/network-chaos/lib/loss/loss.go b/chaoslib/litmus/network-chaos/lib/loss/loss.go new file mode 100644 index 000000000..6454a7202 --- /dev/null +++ b/chaoslib/litmus/network-chaos/lib/loss/loss.go @@ -0,0 +1,24 @@ +package loss + +import ( + "strconv" + + network_chaos "github.com/litmuschaos/litmus-go/chaoslib/litmus/network-chaos/lib" + clients "github.com/litmuschaos/litmus-go/pkg/clients" + experimentTypes "github.com/litmuschaos/litmus-go/pkg/generic/network-chaos/types" + "github.com/litmuschaos/litmus-go/pkg/types" +) + +var err error + +//PodNetworkLossChaos contains the steps to prepare and inject chaos +func PodNetworkLossChaos(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails) error { + + args := "loss " + strconv.Itoa(experimentsDetails.NetworkPacketLossPercentage) + err = network_chaos.PrepareAndInjectChaos(experimentsDetails, clients, resultDetails, eventsDetails, chaosDetails, args) + if err != nil { + return err + } + + return nil +} diff --git a/chaoslib/litmus/network-chaos/lib/network-chaos.go b/chaoslib/litmus/network-chaos/lib/network-chaos.go index 12a019865..e1fce2d69 100644 --- a/chaoslib/litmus/network-chaos/lib/network-chaos.go +++ b/chaoslib/litmus/network-chaos/lib/network-chaos.go @@ -16,8 +16,8 @@ import ( var err error -//PreparePodNetworkChaos contains the prepration steps before chaos injection -func PreparePodNetworkChaos(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails) error { +//PrepareAndInjectChaos contains the prepration & injection steps +func PrepareAndInjectChaos(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails, args string) error { // Get the target pod details for the chaos execution // if the target pod is not defined it will derive the random target pod list using pod affected percentage @@ -57,7 +57,7 @@ func PreparePodNetworkChaos(experimentsDetails *experimentTypes.ExperimentDetail // creating the helper pod to perform network chaos for _, pod := range targetPodList.Items { runID := common.GetRunID() - err = CreateHelperPod(experimentsDetails, clients, pod.Name, pod.Spec.NodeName, runID) + err = CreateHelperPod(experimentsDetails, clients, pod.Name, pod.Spec.NodeName, runID, args) if err != nil { return errors.Errorf("Unable to create the helper pod, err: %v", err) } @@ -110,7 +110,7 @@ func GetTargetContainer(experimentsDetails *experimentTypes.ExperimentDetails, a } // CreateHelperPod derive the attributes for helper pod and create the helper pod -func CreateHelperPod(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, podName, nodeName, runID string) error { +func CreateHelperPod(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, podName, nodeName, runID string, args string) error { privilegedEnable := false if experimentsDetails.ContainerRuntime == "crio" { @@ -138,7 +138,7 @@ func CreateHelperPod(experimentsDetails *experimentTypes.ExperimentDetails, clie Name: "cri-socket", VolumeSource: apiv1.VolumeSource{ HostPath: &apiv1.HostPathVolumeSource{ - Path: experimentsDetails.ContainerPath, + Path: experimentsDetails.SocketPath, }, }, }, @@ -158,17 +158,17 @@ func CreateHelperPod(experimentsDetails *experimentTypes.ExperimentDetails, clie Image: experimentsDetails.LIBImage, ImagePullPolicy: apiv1.PullAlways, Command: []string{ - "bin/bash", + "/bin/bash", }, Args: []string{ "-c", "./experiments/network-chaos", }, - Env: GetPodEnv(experimentsDetails, podName), + Env: GetPodEnv(experimentsDetails, podName, args), VolumeMounts: []apiv1.VolumeMount{ { Name: "cri-socket", - MountPath: experimentsDetails.ContainerPath, + MountPath: experimentsDetails.SocketPath, }, { Name: "cri-config", @@ -195,7 +195,7 @@ func CreateHelperPod(experimentsDetails *experimentTypes.ExperimentDetails, clie } // GetPodEnv derive all the env required for the helper pod -func GetPodEnv(experimentsDetails *experimentTypes.ExperimentDetails, podName string) []apiv1.EnvVar { +func GetPodEnv(experimentsDetails *experimentTypes.ExperimentDetails, podName, args string) []apiv1.EnvVar { var envVar []apiv1.EnvVar ENVList := map[string]string{ @@ -207,7 +207,7 @@ func GetPodEnv(experimentsDetails *experimentTypes.ExperimentDetails, podName st "CHAOS_ENGINE": experimentsDetails.EngineName, "CHAOS_UID": string(experimentsDetails.ChaosUID), "CONTAINER_RUNTIME": experimentsDetails.ContainerRuntime, - "NETEM_COMMAND": GetNetemCommand(experimentsDetails), + "NETEM_COMMAND": args, "NETWORK_INTERFACE": experimentsDetails.NetworkInterface, "EXPERIMENT_NAME": experimentsDetails.ExperimentName, } @@ -237,18 +237,3 @@ func GetValueFromDownwardAPI(apiVersion string, fieldPath string) apiv1.EnvVarSo } return downwardENV } - -// GetNetemCommand generate the netem command based on the experiment name -func GetNetemCommand(experimentDetails *experimentTypes.ExperimentDetails) string { - var cmd string - if experimentDetails.ExperimentName == "pod-network-loss" { - cmd = "loss " + strconv.Itoa(experimentDetails.NetworkPacketLossPercentage) - } else if experimentDetails.ExperimentName == "pod-network-latency" { - cmd = "delay " + strconv.Itoa(experimentDetails.NetworkLatency) + "ms" - } else if experimentDetails.ExperimentName == "pod-network-corruption" { - cmd = "corrupt " + strconv.Itoa(experimentDetails.NetworkPacketCorruptionPercentage) - } else { - cmd = "duplicate " + strconv.Itoa(experimentDetails.NetworkPacketDuplicationPercentage) - } - return cmd -} diff --git a/chaoslib/pumba/network-chaos/lib/corruption/corruption.go b/chaoslib/pumba/network-chaos/lib/corruption/corruption.go new file mode 100644 index 000000000..ec23e7852 --- /dev/null +++ b/chaoslib/pumba/network-chaos/lib/corruption/corruption.go @@ -0,0 +1,44 @@ +package corruption + +import ( + "strconv" + + network_chaos "github.com/litmuschaos/litmus-go/chaoslib/pumba/network-chaos/lib" + clients "github.com/litmuschaos/litmus-go/pkg/clients" + experimentTypes "github.com/litmuschaos/litmus-go/pkg/generic/network-chaos/types" + "github.com/litmuschaos/litmus-go/pkg/types" +) + +var err error + +//PodNetworkCorruptionChaos contains the steps to prepare and inject chaos +func PodNetworkCorruptionChaos(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails) error { + + args := GetContainerArguments(experimentsDetails) + err = network_chaos.PrepareAndInjectChaos(experimentsDetails, clients, resultDetails, eventsDetails, chaosDetails, args) + if err != nil { + return err + } + + return nil +} + +// GetContainerArguments derives the args for the pumba pod +func GetContainerArguments(experimentsDetails *experimentTypes.ExperimentDetails) []string { + baseArgs := []string{ + "netem", + "--tc-image", + experimentsDetails.TCImage, + "--interface", + experimentsDetails.NetworkInterface, + "--duration", + strconv.Itoa(experimentsDetails.ChaosDuration) + "s", + } + + args := baseArgs + args = network_chaos.AddTargetIpsArgs(experimentsDetails.TargetIPs, args) + args = network_chaos.AddTargetIpsArgs(network_chaos.GetIpsForTargetHosts(experimentsDetails.TargetHosts), args) + args = append(args, "corrupt", "--percent", strconv.Itoa(experimentsDetails.NetworkPacketCorruptionPercentage)) + + return args +} diff --git a/chaoslib/pumba/network-chaos/lib/duplication/duplication.go b/chaoslib/pumba/network-chaos/lib/duplication/duplication.go new file mode 100644 index 000000000..692a5a139 --- /dev/null +++ b/chaoslib/pumba/network-chaos/lib/duplication/duplication.go @@ -0,0 +1,44 @@ +package duplication + +import ( + "strconv" + + network_chaos "github.com/litmuschaos/litmus-go/chaoslib/pumba/network-chaos/lib" + clients "github.com/litmuschaos/litmus-go/pkg/clients" + experimentTypes "github.com/litmuschaos/litmus-go/pkg/generic/network-chaos/types" + "github.com/litmuschaos/litmus-go/pkg/types" +) + +var err error + +//PodNetworkDuplicationChaos contains the steps to prepare and inject chaos +func PodNetworkDuplicationChaos(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails) error { + + args := GetContainerArguments(experimentsDetails) + err = network_chaos.PrepareAndInjectChaos(experimentsDetails, clients, resultDetails, eventsDetails, chaosDetails, args) + if err != nil { + return err + } + + return nil +} + +// GetContainerArguments derives the args for the pumba pod +func GetContainerArguments(experimentsDetails *experimentTypes.ExperimentDetails) []string { + baseArgs := []string{ + "netem", + "--tc-image", + experimentsDetails.TCImage, + "--interface", + experimentsDetails.NetworkInterface, + "--duration", + strconv.Itoa(experimentsDetails.ChaosDuration) + "s", + } + + args := baseArgs + args = network_chaos.AddTargetIpsArgs(experimentsDetails.TargetIPs, args) + args = network_chaos.AddTargetIpsArgs(network_chaos.GetIpsForTargetHosts(experimentsDetails.TargetHosts), args) + args = append(args, "duplicate", "--percent", strconv.Itoa(experimentsDetails.NetworkPacketDuplicationPercentage)) + + return args +} diff --git a/chaoslib/pumba/network-chaos/lib/latency/latency.go b/chaoslib/pumba/network-chaos/lib/latency/latency.go new file mode 100644 index 000000000..6ea06163b --- /dev/null +++ b/chaoslib/pumba/network-chaos/lib/latency/latency.go @@ -0,0 +1,44 @@ +package latency + +import ( + "strconv" + + network_chaos "github.com/litmuschaos/litmus-go/chaoslib/pumba/network-chaos/lib" + clients "github.com/litmuschaos/litmus-go/pkg/clients" + experimentTypes "github.com/litmuschaos/litmus-go/pkg/generic/network-chaos/types" + "github.com/litmuschaos/litmus-go/pkg/types" +) + +var err error + +//PodNetworkLatencyChaos contains the steps to prepare and inject chaos +func PodNetworkLatencyChaos(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails) error { + + args := GetContainerArguments(experimentsDetails) + err = network_chaos.PrepareAndInjectChaos(experimentsDetails, clients, resultDetails, eventsDetails, chaosDetails, args) + if err != nil { + return err + } + + return nil +} + +// GetContainerArguments derives the args for the pumba pod +func GetContainerArguments(experimentsDetails *experimentTypes.ExperimentDetails) []string { + baseArgs := []string{ + "netem", + "--tc-image", + experimentsDetails.TCImage, + "--interface", + experimentsDetails.NetworkInterface, + "--duration", + strconv.Itoa(experimentsDetails.ChaosDuration) + "s", + } + + args := baseArgs + args = network_chaos.AddTargetIpsArgs(experimentsDetails.TargetIPs, args) + args = network_chaos.AddTargetIpsArgs(network_chaos.GetIpsForTargetHosts(experimentsDetails.TargetHosts), args) + args = append(args, "delay", "--time", strconv.Itoa(experimentsDetails.NetworkLatency)) + + return args +} diff --git a/chaoslib/pumba/network-chaos/lib/loss/loss.go b/chaoslib/pumba/network-chaos/lib/loss/loss.go new file mode 100644 index 000000000..9988372fd --- /dev/null +++ b/chaoslib/pumba/network-chaos/lib/loss/loss.go @@ -0,0 +1,44 @@ +package loss + +import ( + "strconv" + + network_chaos "github.com/litmuschaos/litmus-go/chaoslib/pumba/network-chaos/lib" + clients "github.com/litmuschaos/litmus-go/pkg/clients" + experimentTypes "github.com/litmuschaos/litmus-go/pkg/generic/network-chaos/types" + "github.com/litmuschaos/litmus-go/pkg/types" +) + +var err error + +//PodNetworkLossChaos contains the steps to prepare and inject chaos +func PodNetworkLossChaos(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails) error { + + args := GetContainerArguments(experimentsDetails) + err = network_chaos.PrepareAndInjectChaos(experimentsDetails, clients, resultDetails, eventsDetails, chaosDetails, args) + if err != nil { + return err + } + + return nil +} + +// GetContainerArguments derives the args for the pumba pod +func GetContainerArguments(experimentsDetails *experimentTypes.ExperimentDetails) []string { + baseArgs := []string{ + "netem", + "--tc-image", + experimentsDetails.TCImage, + "--interface", + experimentsDetails.NetworkInterface, + "--duration", + strconv.Itoa(experimentsDetails.ChaosDuration) + "s", + } + + args := baseArgs + args = network_chaos.AddTargetIpsArgs(experimentsDetails.TargetIPs, args) + args = network_chaos.AddTargetIpsArgs(network_chaos.GetIpsForTargetHosts(experimentsDetails.TargetHosts), args) + args = append(args, "loss", "--percent", strconv.Itoa(experimentsDetails.NetworkPacketLossPercentage)) + + return args +} diff --git a/chaoslib/pumba/network-chaos/lib/network-chaos.go b/chaoslib/pumba/network-chaos/lib/network-chaos.go index 74fa8d5bf..a0ec6efd4 100644 --- a/chaoslib/pumba/network-chaos/lib/network-chaos.go +++ b/chaoslib/pumba/network-chaos/lib/network-chaos.go @@ -20,8 +20,8 @@ import ( var err error -//PreparePodNetworkChaos contains the prepration steps before chaos injection -func PreparePodNetworkChaos(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails) error { +//PrepareAndInjectChaos contains the prepration and chaos injection steps +func PrepareAndInjectChaos(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails, args []string) error { // Get the target pod details for the chaos execution // if the target pod is not defined it will derive the random target pod list using pod affected percentage @@ -36,14 +36,6 @@ func PreparePodNetworkChaos(experimentsDetails *experimentTypes.ExperimentDetail common.WaitForDuration(experimentsDetails.RampTime) } - //Get the target container name of the application pod - if experimentsDetails.TargetContainer == "" { - experimentsDetails.TargetContainer, err = GetTargetContainer(experimentsDetails, targetPodList.Items[0].Name, clients) - if err != nil { - return errors.Errorf("Unable to get the target container name due to, err: %v", err) - } - } - // Get Chaos Pod Annotation experimentsDetails.Annotations, err = common.GetChaosPodAnnotation(experimentsDetails.ChaosPodName, experimentsDetails.ChaosNamespace, clients) if err != nil { @@ -62,12 +54,13 @@ func PreparePodNetworkChaos(experimentsDetails *experimentTypes.ExperimentDetail runID := common.GetRunID() log.InfoWithValues("[Info]: Details of application under chaos injection", logrus.Fields{ - "PodName": pod.Name, - "NodeName": pod.Spec.NodeName, - "ContainerName": experimentsDetails.TargetContainer, + "PodName": pod.Name, + "NodeName": pod.Spec.NodeName, }) - err = CreateHelperPod(experimentsDetails, clients, pod.Name, pod.Spec.NodeName, runID) + args = append(args, "re2:k8s_POD_"+pod.Name+"_"+experimentsDetails.AppNS) + log.Infof("Arguments for running %v are %v", experimentsDetails.ExperimentName, args) + err = CreateHelperPod(experimentsDetails, clients, pod.Spec.NodeName, runID, args) if err != nil { return errors.Errorf("Unable to create the helper pod, err: %v", err) } @@ -102,19 +95,8 @@ func PreparePodNetworkChaos(experimentsDetails *experimentTypes.ExperimentDetail return nil } -//GetTargetContainer will fetch the container name from application pod -//This container will be used as target container -func GetTargetContainer(experimentsDetails *experimentTypes.ExperimentDetails, appName string, clients clients.ClientSets) (string, error) { - pod, err := clients.KubeClient.CoreV1().Pods(experimentsDetails.AppNS).Get(appName, v1.GetOptions{}) - if err != nil { - return "", errors.Wrapf(err, "Fail to get the application pod status, due to:%v", err) - } - - return pod.Spec.Containers[0].Name, nil -} - // CreateHelperPod derive the attributes for helper pod and create the helper pod -func CreateHelperPod(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, appName, appNodeName, runID string) error { +func CreateHelperPod(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, appNodeName, runID string, args []string) error { helperPod := &apiv1.Pod{ ObjectMeta: v1.ObjectMeta{ @@ -148,7 +130,7 @@ func CreateHelperPod(experimentsDetails *experimentTypes.ExperimentDetails, clie Command: []string{ "pumba", }, - Args: GetContainerArguments(experimentsDetails, appName), + Args: args, VolumeMounts: []apiv1.VolumeMount{ { Name: "dockersocket", @@ -164,35 +146,6 @@ func CreateHelperPod(experimentsDetails *experimentTypes.ExperimentDetails, clie return err } -// GetContainerArguments derives the args for the pumba pod -func GetContainerArguments(experimentsDetails *experimentTypes.ExperimentDetails, appName string) []string { - baseArgs := []string{ - "netem", - "--tc-image", - experimentsDetails.TCImage, - "--interface", - experimentsDetails.NetworkInterface, - "--duration", - strconv.Itoa(experimentsDetails.ChaosDuration) + "s", - } - - args := baseArgs - args = AddTargetIpsArgs(experimentsDetails.TargetIPs, args) - args = AddTargetIpsArgs(GetIpsForTargetHosts(experimentsDetails.TargetHosts), args) - if experimentsDetails.ExperimentName == "pod-network-duplication" { - args = append(args, "duplicate", "--percent", strconv.Itoa(experimentsDetails.NetworkPacketDuplicationPercentage)) - } else if experimentsDetails.ExperimentName == "pod-network-latency" { - args = append(args, "delay", "--time", strconv.Itoa(experimentsDetails.NetworkLatency)) - } else if experimentsDetails.ExperimentName == "pod-network-loss" { - args = append(args, "loss", "--percent", strconv.Itoa(experimentsDetails.NetworkPacketLossPercentage)) - } else if experimentsDetails.ExperimentName == "pod-network-corruption" { - args = append(args, "corrupt", "--percent", strconv.Itoa(experimentsDetails.NetworkPacketCorruptionPercentage)) - } - args = append(args, "re2:k8s_"+experimentsDetails.TargetContainer+"_"+appName) - log.Infof("Arguments for running %v are %v", experimentsDetails.ExperimentName, args) - return args -} - // AddTargetIpsArgs inserts a comma-separated list of targetIPs (if provided by the user) into the pumba command/args func AddTargetIpsArgs(targetIPs string, args []string) []string { if targetIPs == "" { @@ -213,12 +166,12 @@ func GetIpsForTargetHosts(targetHosts string) string { hosts := strings.Split(targetHosts, ",") var commaSeparatedIPs []string for i := range hosts { - ips,err := net.LookupIP(hosts[i]) + ips, err := net.LookupIP(hosts[i]) if err != nil { log.Infof("Unknown host") } else { for j := range ips { - log.Infof("IP address: ", ips[j]) + log.Infof("IP address: %v", ips[j]) commaSeparatedIPs = append(commaSeparatedIPs, ips[j].String()) } } diff --git a/experiments/generic/container-kill/test/test.yml b/experiments/generic/container-kill/test/test.yml index 48ce557dc..ac5d12bd2 100644 --- a/experiments/generic/container-kill/test/test.yml +++ b/experiments/generic/container-kill/test/test.yml @@ -49,7 +49,22 @@ spec: value: '' - name: LIB - value: 'pumba' + value: 'litmus' + + # provide the container runtime path + # applicable only for containerd and crio runtime + - name: SOCKET_PATH + value: '/run/containerd/containerd.sock' + + # provide the name of container runtime + # it supports docker, containerd, crio + # default to docker + - name: CONTAINER_RUNTIME + value: 'docker' + + ## percentage of total pods to target + - name: PODS_AFFECTED_PERC + value: '' - name: TARGET_POD value: '' diff --git a/experiments/generic/pod-network-corruption/pod-network-corruption.go b/experiments/generic/pod-network-corruption/pod-network-corruption.go index bbe939cb8..ca1de885b 100644 --- a/experiments/generic/pod-network-corruption/pod-network-corruption.go +++ b/experiments/generic/pod-network-corruption/pod-network-corruption.go @@ -1,8 +1,8 @@ package main import ( - litmusLIB "github.com/litmuschaos/litmus-go/chaoslib/litmus/network-chaos/lib" - pumbaLIB "github.com/litmuschaos/litmus-go/chaoslib/pumba/network-chaos/lib" + litmusLIB "github.com/litmuschaos/litmus-go/chaoslib/litmus/network-chaos/lib/corruption" + pumbaLIB "github.com/litmuschaos/litmus-go/chaoslib/pumba/network-chaos/lib/corruption" clients "github.com/litmuschaos/litmus-go/pkg/clients" "github.com/litmuschaos/litmus-go/pkg/events" experimentEnv "github.com/litmuschaos/litmus-go/pkg/generic/network-chaos/environment" @@ -114,7 +114,7 @@ func main() { // Including the pumba lib for pod-network-corruption if experimentsDetails.ChaosLib == "litmus" && experimentsDetails.ContainerRuntime == "docker" { - err = pumbaLIB.PreparePodNetworkChaos(&experimentsDetails, clients, &resultDetails, &eventsDetails, &chaosDetails) + err = pumbaLIB.PodNetworkCorruptionChaos(&experimentsDetails, clients, &resultDetails, &eventsDetails, &chaosDetails) if err != nil { log.Errorf("Chaos injection failed due to %v\n", err) failStep := "Including the pumba lib for pod-network-corruption" @@ -124,7 +124,7 @@ func main() { log.Info("[Confirmation]: The pod network corruption chaos has been applied") resultDetails.Verdict = "Pass" } else if experimentsDetails.ChaosLib == "litmus" && (experimentsDetails.ContainerRuntime == "containerd" || experimentsDetails.ContainerRuntime == "crio") { - err = litmusLIB.PreparePodNetworkChaos(&experimentsDetails, clients, &resultDetails, &eventsDetails, &chaosDetails) + err = litmusLIB.PodNetworkCorruptionChaos(&experimentsDetails, clients, &resultDetails, &eventsDetails, &chaosDetails) if err != nil { log.Errorf("Chaos injection failed due to %v\n", err) failStep := "Including the pumba lib for pod-network-corruption" diff --git a/experiments/generic/pod-network-corruption/test/test.yml b/experiments/generic/pod-network-corruption/test/test.yml index 17dcf57e0..02cad706a 100644 --- a/experiments/generic/pod-network-corruption/test/test.yml +++ b/experiments/generic/pod-network-corruption/test/test.yml @@ -46,7 +46,7 @@ spec: value: '60' - name: LIB - value: 'pumba' + value: 'litmus' - name: TARGET_POD value: '' @@ -60,6 +60,21 @@ spec: - name: RAMP_TIME value: '' + ## percentage of total pods to target + - name: PODS_AFFECTED_PERC + value: '' + + # provide the name of container runtime + # it supports docker, containerd, crio + # default to docker + - name: CONTAINER_RUNTIME + value: 'docker' + + # provide the container runtime path + # applicable only for containerd and crio runtime + - name: SOCKET_PATH + value: '/run/containerd/containerd.sock' + - name: CHAOS_SERVICE_ACCOUNT valueFrom: fieldRef: diff --git a/experiments/generic/pod-network-duplication/pod-network-duplication.go b/experiments/generic/pod-network-duplication/pod-network-duplication.go index 95841fee9..37f6b694f 100644 --- a/experiments/generic/pod-network-duplication/pod-network-duplication.go +++ b/experiments/generic/pod-network-duplication/pod-network-duplication.go @@ -1,8 +1,8 @@ package main import ( - litmusLIB "github.com/litmuschaos/litmus-go/chaoslib/litmus/network-chaos/lib" - pumbaLIB "github.com/litmuschaos/litmus-go/chaoslib/pumba/network-chaos/lib" + litmusLIB "github.com/litmuschaos/litmus-go/chaoslib/litmus/network-chaos/lib/duplication" + pumbaLIB "github.com/litmuschaos/litmus-go/chaoslib/pumba/network-chaos/lib/duplication" clients "github.com/litmuschaos/litmus-go/pkg/clients" "github.com/litmuschaos/litmus-go/pkg/events" experimentEnv "github.com/litmuschaos/litmus-go/pkg/generic/network-chaos/environment" @@ -114,7 +114,7 @@ func main() { // Including the pumba lib for pod-network-duplication if experimentsDetails.ChaosLib == "litmus" && experimentsDetails.ContainerRuntime == "docker" { - err = pumbaLIB.PreparePodNetworkChaos(&experimentsDetails, clients, &resultDetails, &eventsDetails, &chaosDetails) + err = pumbaLIB.PodNetworkDuplicationChaos(&experimentsDetails, clients, &resultDetails, &eventsDetails, &chaosDetails) if err != nil { log.Errorf("Chaos injection failed due to %v\n", err) failStep := "Including the pumba lib for pod-network-duplication" @@ -124,7 +124,7 @@ func main() { log.Info("[Confirmation]: The pod network duplication chaos has been applied") resultDetails.Verdict = "Pass" } else if experimentsDetails.ChaosLib == "litmus" && (experimentsDetails.ContainerRuntime == "containerd" || experimentsDetails.ContainerRuntime == "crio") { - err = litmusLIB.PreparePodNetworkChaos(&experimentsDetails, clients, &resultDetails, &eventsDetails, &chaosDetails) + err = litmusLIB.PodNetworkDuplicationChaos(&experimentsDetails, clients, &resultDetails, &eventsDetails, &chaosDetails) if err != nil { log.Errorf("Chaos injection failed due to %v\n", err) failStep := "Including the pumba lib for pod-network-duplication" diff --git a/experiments/generic/pod-network-duplication/test/test.yml b/experiments/generic/pod-network-duplication/test/test.yml index 632530c57..9d871d4a5 100644 --- a/experiments/generic/pod-network-duplication/test/test.yml +++ b/experiments/generic/pod-network-duplication/test/test.yml @@ -46,7 +46,7 @@ spec: value: '60' - name: LIB - value: 'pumba' + value: 'litmus' - name: TARGET_POD value: '' @@ -60,6 +60,21 @@ spec: - name: RAMP_TIME value: '' + ## percentage of total pods to target + - name: PODS_AFFECTED_PERC + value: '' + + # provide the name of container runtime + # it supports docker, containerd, crio + # default to docker + - name: CONTAINER_RUNTIME + value: 'docker' + + # provide the container runtime path + # applicable only for containerd and crio runtime + - name: SOCKET_PATH + value: '/run/containerd/containerd.sock' + - name: CHAOS_SERVICE_ACCOUNT valueFrom: fieldRef: diff --git a/experiments/generic/pod-network-latency/pod-network-latency.go b/experiments/generic/pod-network-latency/pod-network-latency.go index a25c38d62..139a13a73 100644 --- a/experiments/generic/pod-network-latency/pod-network-latency.go +++ b/experiments/generic/pod-network-latency/pod-network-latency.go @@ -1,8 +1,8 @@ package main import ( - litmusLIB "github.com/litmuschaos/litmus-go/chaoslib/litmus/network-chaos/lib" - pumbaLIB "github.com/litmuschaos/litmus-go/chaoslib/pumba/network-chaos/lib" + litmusLIB "github.com/litmuschaos/litmus-go/chaoslib/litmus/network-chaos/lib/latency" + pumbaLIB "github.com/litmuschaos/litmus-go/chaoslib/pumba/network-chaos/lib/latency" clients "github.com/litmuschaos/litmus-go/pkg/clients" "github.com/litmuschaos/litmus-go/pkg/events" experimentEnv "github.com/litmuschaos/litmus-go/pkg/generic/network-chaos/environment" @@ -113,7 +113,7 @@ func main() { // Including the pumba lib for pod-network-latency if experimentsDetails.ChaosLib == "litmus" && experimentsDetails.ContainerRuntime == "docker" { - err = pumbaLIB.PreparePodNetworkChaos(&experimentsDetails, clients, &resultDetails, &eventsDetails, &chaosDetails) + err = pumbaLIB.PodNetworkLatencyChaos(&experimentsDetails, clients, &resultDetails, &eventsDetails, &chaosDetails) if err != nil { log.Errorf("Chaos injection failed due to %v\n", err) failStep := "Including the pumba lib for pod-network-latency" @@ -123,7 +123,7 @@ func main() { log.Info("[Confirmation]: The pod network latency chaos has been applied") resultDetails.Verdict = "Pass" } else if experimentsDetails.ChaosLib == "litmus" && (experimentsDetails.ContainerRuntime == "containerd" || experimentsDetails.ContainerRuntime == "crio") { - err = litmusLIB.PreparePodNetworkChaos(&experimentsDetails, clients, &resultDetails, &eventsDetails, &chaosDetails) + err = litmusLIB.PodNetworkLatencyChaos(&experimentsDetails, clients, &resultDetails, &eventsDetails, &chaosDetails) if err != nil { log.Errorf("Chaos injection failed due to %v\n", err) failStep := "Including the pumba lib for pod-network-latency" diff --git a/experiments/generic/pod-network-latency/test/test.yml b/experiments/generic/pod-network-latency/test/test.yml index 89e1bdc57..d7236ef4e 100644 --- a/experiments/generic/pod-network-latency/test/test.yml +++ b/experiments/generic/pod-network-latency/test/test.yml @@ -49,7 +49,7 @@ spec: value: '60' - name: LIB - value: 'pumba' + value: 'litmus' - name: TARGET_POD value: '' @@ -64,6 +64,21 @@ spec: - name: RAMP_TIME value: '' + ## percentage of total pods to target + - name: PODS_AFFECTED_PERC + value: '' + + # provide the name of container runtime + # it supports docker, containerd, crio + # default to docker + - name: CONTAINER_RUNTIME + value: 'docker' + + # provide the container runtime path + # applicable only for containerd and crio runtime + - name: SOCKET_PATH + value: '/run/containerd/containerd.sock' + - name: CHAOS_SERVICE_ACCOUNT valueFrom: fieldRef: diff --git a/experiments/generic/pod-network-loss/pod-network-loss.go b/experiments/generic/pod-network-loss/pod-network-loss.go index aa9b19663..a0d9f72f5 100644 --- a/experiments/generic/pod-network-loss/pod-network-loss.go +++ b/experiments/generic/pod-network-loss/pod-network-loss.go @@ -1,8 +1,8 @@ package main import ( - litmusLIB "github.com/litmuschaos/litmus-go/chaoslib/litmus/network-chaos/lib" - pumbaLIB "github.com/litmuschaos/litmus-go/chaoslib/pumba/network-chaos/lib" + litmusLIB "github.com/litmuschaos/litmus-go/chaoslib/litmus/network-chaos/lib/loss" + pumbaLIB "github.com/litmuschaos/litmus-go/chaoslib/pumba/network-chaos/lib/loss" clients "github.com/litmuschaos/litmus-go/pkg/clients" "github.com/litmuschaos/litmus-go/pkg/events" experimentEnv "github.com/litmuschaos/litmus-go/pkg/generic/network-chaos/environment" @@ -114,7 +114,7 @@ func main() { // Including the pumba lib for pod-network-loss if experimentsDetails.ChaosLib == "litmus" && experimentsDetails.ContainerRuntime == "docker" { - err = pumbaLIB.PreparePodNetworkChaos(&experimentsDetails, clients, &resultDetails, &eventsDetails, &chaosDetails) + err = pumbaLIB.PodNetworkLossChaos(&experimentsDetails, clients, &resultDetails, &eventsDetails, &chaosDetails) if err != nil { log.Errorf("Chaos injection failed due to %v\n", err) failStep := "Including the pumba lib for pod-network-loss" @@ -124,7 +124,7 @@ func main() { log.Info("[Confirmation]: The pod network loss chaos has been applied") resultDetails.Verdict = "Pass" } else if experimentsDetails.ChaosLib == "litmus" && (experimentsDetails.ContainerRuntime == "containerd" || experimentsDetails.ContainerRuntime == "crio") { - err = litmusLIB.PreparePodNetworkChaos(&experimentsDetails, clients, &resultDetails, &eventsDetails, &chaosDetails) + err = litmusLIB.PodNetworkLossChaos(&experimentsDetails, clients, &resultDetails, &eventsDetails, &chaosDetails) if err != nil { log.Errorf("Chaos injection failed due to %v\n", err) failStep := "Including the pumba lib for pod-network-loss" diff --git a/experiments/generic/pod-network-loss/test/test.yml b/experiments/generic/pod-network-loss/test/test.yml index ed126a7ec..d56fc2aec 100644 --- a/experiments/generic/pod-network-loss/test/test.yml +++ b/experiments/generic/pod-network-loss/test/test.yml @@ -46,7 +46,7 @@ spec: value: '60' - name: LIB - value: 'pumba' + value: 'litmus' - name: TARGET_POD value: '' @@ -60,6 +60,21 @@ spec: - name: RAMP_TIME value: '' + ## percentage of total pods to target + - name: PODS_AFFECTED_PERC + value: '' + + # provide the name of container runtime + # it supports docker, containerd, crio + # default to docker + - name: CONTAINER_RUNTIME + value: 'docker' + + # provide the container runtime path + # applicable only for containerd and crio runtime + - name: SOCKET_PATH + value: '/run/containerd/containerd.sock' + - name: CHAOS_SERVICE_ACCOUNT valueFrom: fieldRef: diff --git a/go.mod b/go.mod index 30f49f775..500e5634d 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/imdario/mergo v0.3.9 // indirect github.com/kr/pretty v0.2.0 // indirect github.com/kyokomi/emoji v2.2.4+incompatible - github.com/litmuschaos/chaos-operator v0.0.0-20200903123231-7ac84ddd0bcd + github.com/litmuschaos/chaos-operator v0.0.0-20200917035646-2633098da932 github.com/mailru/easyjson v0.7.1 // indirect github.com/openebs/maya v0.0.0-20200411140727-1c81f9e017b0 github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index 7df02d862..b64be82a4 100644 --- a/go.sum +++ b/go.sum @@ -68,12 +68,14 @@ github.com/bazelbuild/buildtools v0.0.0-20180226164855-80c7f0d45d7e/go.mod h1:5J github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bifurcation/mint v0.0.0-20180715133206-93c51c6ce115 h1:fUjoj2bT6dG8LoEe+uNsKk8J+sLkDbQkJnB6Z1F02Bc= github.com/bifurcation/mint v0.0.0-20180715133206-93c51c6ce115/go.mod h1:zVt7zX3K/aDCk9Tj+VM7YymsX66ERvzCJzw8rFCX2JU= github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= @@ -88,7 +90,9 @@ github.com/cenkalti/backoff v2.1.1+incompatible h1:tKJnvO2kl0zmb/jA5UKAt4VoEVw1q github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/prettybench v0.0.0-20150116022406-03b8cfe5406c/go.mod h1:Xe6ZsFhtM8HrDku0pxJ3/Lr51rwykrzgFwpmTzleatY= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.0 h1:yTUvW7Vhb89inJ+8irsUqiWjh8iT6sQPZiQzI6ReGkA= github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= github.com/checkpoint-restore/go-criu v0.0.0-20190109184317-bdb7599cd87b/go.mod h1:TrMrLQfeENAPYPRsJuq3jsqdlRh3lvi6trTZJG8+tho= @@ -113,6 +117,7 @@ github.com/coredns/corefile-migration v1.0.2/go.mod h1:OFwBp/Wc9dJt5cAZzHWMNhK1r github.com/coreos/bbolt v1.3.1-coreos.6/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/etcd v3.3.15+incompatible h1:+9RjdC18gMxNQVvSiXvObLu29mOFmkgdsB4cRTlV+EE= github.com/coreos/etcd v3.3.15+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= @@ -120,8 +125,10 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a h1:W8b4lQ4tFF21aspRGoBuCNV6V2fFJBF+pm1J6OY8Lys= github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/prometheus-operator v0.34.0/go.mod h1:Li6rMllG/hYIyXfMuvUwhyC+hqwJVHdsDdP21hypT1M= github.com/coreos/rkt v1.30.0/go.mod h1:O634mlH6U7qk87poQifK6M2rsFNt+FyUTWNMnP1hF1U= @@ -151,6 +158,7 @@ github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyG github.com/docker/cli v0.0.0-20190506213505-d88565df0c2d/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.7.0+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker-credential-helpers v0.6.1/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= github.com/docker/go-connections v0.3.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= @@ -448,8 +456,8 @@ github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/libopenstorage/openstorage v1.0.0/go.mod h1:Sp1sIObHjat1BeXhfMqLZ14wnOzEhNx2YQedreMcUyc= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= -github.com/litmuschaos/chaos-operator v0.0.0-20200903123231-7ac84ddd0bcd h1:1YGUsjAYsbjfMUatUFJefA0TZIxAUPWazEm/6NYdbyU= -github.com/litmuschaos/chaos-operator v0.0.0-20200903123231-7ac84ddd0bcd/go.mod h1:QHmeCgV1yDMBnNk5tz0c9OVGUUC7MWrVIAlrPWMRhK4= +github.com/litmuschaos/chaos-operator v0.0.0-20200917035646-2633098da932 h1:hYL8VZ+40N3TKBPiEwFxbfhzzTLXU1Qvr6yc2u3lA60= +github.com/litmuschaos/chaos-operator v0.0.0-20200917035646-2633098da932/go.mod h1:QHmeCgV1yDMBnNk5tz0c9OVGUUC7MWrVIAlrPWMRhK4= github.com/litmuschaos/elves v0.0.0-20200502084504-13be0e6937ee/go.mod h1:DsbHGNUq/78NZozWVVI9Q6eBei4I+JjlkkD5aibJ3MQ= github.com/lpabon/godbc v0.1.1/go.mod h1:Jo9QV0cf3U6jZABgiJ2skINAXb9j8m51r07g4KI92ZA= github.com/lucas-clemente/aes12 v0.0.0-20171027163421-cd47fb39b79f h1:sSeNEkJrs+0F9TUau0CgWTTNEwF23HST3Eq0A+QIx+A= @@ -541,6 +549,7 @@ github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= @@ -589,11 +598,13 @@ github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDf github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= +github.com/prometheus/client_golang v1.2.1 h1:JnMpQc6ppsNgw9QPAGF6Dod479itz7lvlsMzzNayLOI= github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= @@ -602,6 +613,7 @@ github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.4.1 h1:K0MGApIoQvMw27RTdJkPbr3JZ7DNbtxQNyi5STVM6Kw= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= +github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -611,6 +623,7 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= +github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8= github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/prometheus v2.3.2+incompatible/go.mod h1:oAIUtOny2rjMX0OWN5vPR5/q/twIROJvdqnQKDdil/s= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= @@ -706,11 +719,14 @@ go.opencensus.io v0.21.0 h1:mU6zScU4U1YAFPHEHYk+3JC4SY7JxgkqS10ZOSyksNg= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.uber.org/atomic v0.0.0-20181018215023-8dc6146f7569/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v0.0.0-20180122172545-ddea229ff1df/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v0.0.0-20180814183419-67bc79d13d15/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180426230345-b49d69b5da94/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -853,6 +869,7 @@ golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDq golang.org/x/tools v0.0.0-20190828213141-aed303cbaa74/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191018212557-ed542cd5b28a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= @@ -869,6 +886,7 @@ google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190128161407-8ac453e89fca/go.mod h1:L3J43x8/uS+qIUoksaLKe6OS3nUKxOKuIFz1sl2/jx4= @@ -888,6 +906,7 @@ google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiq google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= +google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -902,8 +921,10 @@ gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4 gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.0/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= @@ -918,6 +939,7 @@ gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v1 v1.1.2/go.mod h1:QpYS+a4WhS+DTlyQIi6Ka7MS3SuR9a055rgXNEe6EiA= gopkg.in/square/go-jose.v2 v2.2.2 h1:orlkJ3myw8CN1nVQHBFfloD+L3egixIa4FvUP6RosSA= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.1/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= @@ -940,35 +962,25 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.2/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -k8s.io/api v0.0.0-20190918195907-bd6ac527cfd2 h1:bkwe5LsuANqyOwsBng5Qc4S91D2Tv0JHctAztt3YTQs= -k8s.io/api v0.0.0-20190918195907-bd6ac527cfd2/go.mod h1:AOxZTnaXR/xiarlQL0JUfwQPxjmKDvVYoRp58cA7lUo= k8s.io/api v0.0.0-20191016110408-35e52d86657a h1:VVUE9xTCXP6KUPMf92cQmN88orz600ebexcRRaBTepQ= k8s.io/api v0.0.0-20191016110408-35e52d86657a/go.mod h1:/L5qH+AD540e7Cetbui1tuJeXdmNhO8jM6VkXeDdDhQ= -k8s.io/api v0.18.5 h1:fKbCxr+U3fu7k6jB+QeYPD/c6xKYeSJ2KVWmyUypuWM= -k8s.io/apiextensions-apiserver v0.0.0-20190918201827-3de75813f604 h1:Kl/sh+wWzYK2hWFZtwvuFECup1SbE2kXfMnhGZsoO5M= -k8s.io/apiextensions-apiserver v0.0.0-20190918201827-3de75813f604/go.mod h1:7H8sjDlWQu89yWB3FhZfsLyRCRLuoXoCoY5qtwW1q6I= +k8s.io/apiextensions-apiserver v0.0.0-20191016113550-5357c4baaf65 h1:kThoiqgMsSwBdMK/lPgjtYTsEjbUU9nXCA9DyU3feok= k8s.io/apiextensions-apiserver v0.0.0-20191016113550-5357c4baaf65/go.mod h1:5BINdGqggRXXKnDgpwoJ7PyQH8f+Ypp02fvVNcIFy9s= -k8s.io/apimachinery v0.0.0-20190817020851-f2f3a405f61d h1:7Kns6qqhMAQWvGkxYOLSLRZ5hJO0/5pcE5lPGP2fxUw= -k8s.io/apimachinery v0.0.0-20190817020851-f2f3a405f61d/go.mod h1:3jediapYqJ2w1BFw7lAZPCx7scubsTfosqHkhXCWJKw= k8s.io/apimachinery v0.0.0-20191004115801-a2eda9f80ab8 h1:Iieh/ZEgT3BWwbLD5qEKcY06jKuPEl6zC7gPSehoLw4= k8s.io/apimachinery v0.0.0-20191004115801-a2eda9f80ab8/go.mod h1:llRdnznGEAqC3DcNm6yEj472xaFVfLM7hnYofMb12tQ= -k8s.io/apiserver v0.0.0-20190918200908-1e17798da8c1/go.mod h1:4FuDU+iKPjdsdQSN3GsEKZLB/feQsj1y9dhhBDVV2Ns= +k8s.io/apiserver v0.0.0-20191016112112-5190913f932d h1:leksCBKKBrPJmW1jV4dZUvwqmVtXpKdzpHsqXfFS094= k8s.io/apiserver v0.0.0-20191016112112-5190913f932d/go.mod h1:7OqfAolfWxUM/jJ/HBLyE+cdaWFBUoo5Q5pHgJVj2ws= k8s.io/autoscaler v0.0.0-20190607113959-1b4f1855cb8e/go.mod h1:QEXezc9uKPT91dwqhSJq3GNI3B1HxFRQHiku9kmrsSA= k8s.io/cli-runtime v0.0.0-20191016114015-74ad18325ed5/go.mod h1:sDl6WKSQkDM6zS1u9F49a0VooQ3ycYFBFLqd2jf2Xfo= -k8s.io/client-go v0.0.0-20190918200256-06eb1244587a h1:huOvPq1vO7dkuw9rZPYsLGpFmyGvy6L8q6mDItgkdQ4= -k8s.io/client-go v0.0.0-20190918200256-06eb1244587a/go.mod h1:3YAcTbI2ArBRmhHns5vlHRX8YQqvkVYpz+U/N5i1mVU= k8s.io/client-go v0.0.0-20191016111102-bec269661e48 h1:C2XVy2z0dV94q9hSSoCuTPp1KOG7IegvbdXuz9VGxoU= k8s.io/client-go v0.0.0-20191016111102-bec269661e48/go.mod h1:hrwktSwYGI4JK+TJA3dMaFyyvHVi/aLarVHpbs8bgCU= k8s.io/cloud-provider v0.0.0-20191016115326-20453efc2458/go.mod h1:O5SO5xcgxrjJV9EC9R/47RuBpbk5YX9URDBlg++FA5o= k8s.io/cluster-bootstrap v0.0.0-20191016115129-c07a134afb42/go.mod h1:MzCL6kLExQuHruGaqibd8cugC8nw8QRxm3+lzR5l8SI= -k8s.io/code-generator v0.0.0-20190612205613-18da4a14b22b/go.mod h1:G8bQwmHm2eafm5bgtX67XDZQ8CWKSGu9DekI+yN4Y5I= k8s.io/code-generator v0.0.0-20191004115455-8e001e5d1894/go.mod h1:mJUgkl06XV4kstAnLHAIzJPVCOzVR+ZcfPIv4fUsFCY= -k8s.io/component-base v0.0.0-20190918200425-ed2f0867c778/go.mod h1:DFWQCXgXVLiWtzFaS17KxHdlUeUymP7FLxZSkmL9/jU= +k8s.io/component-base v0.0.0-20191016111319-039242c015a9 h1:2D+G/CCNVdYc0h9D+tX+0SmtcyQmby6uzNityrps1s0= k8s.io/component-base v0.0.0-20191016111319-039242c015a9/go.mod h1:SuWowIgd/dtU/m/iv8OD9eOxp3QZBBhTIiWMsBQvKjI= k8s.io/cri-api v0.0.0-20190828162817-608eb1dad4ac/go.mod h1:BvtUaNBr0fEpzb11OfrQiJLsLPtqbmulpo1fPwcpP6Q= k8s.io/csi-translation-lib v0.0.0-20191016115521-756ffa5af0bd/go.mod h1:lf1VBseeLanBpSXD0N9tuPx1ylI8sA0j6f+rckCKiIk= -k8s.io/gengo v0.0.0-20190116091435-f8a0810f38af/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20191010091904-7fa3014cb28f/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= @@ -980,6 +992,7 @@ k8s.io/klog v0.3.3/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.4.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= +k8s.io/klog/v2 v2.0.0 h1:Foj74zO6RbjjP4hBEKjnYtjjAhGg4jNynUdYF6fJrok= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/kube-aggregator v0.0.0-20191016112429-9587704a8ad4/go.mod h1:+aW0UZgSXdTSHTIFnWnueEuXjOqerDUxGIw6Ygr+vYY= k8s.io/kube-controller-manager v0.0.0-20191016114939-2b2b218dc1df/go.mod h1:WgrTcPKYAfNa9C0LV1UeK+XqfbSOUH1WGq/vX5UiW40= diff --git a/pkg/generic/container-kill/environment/environment.go b/pkg/generic/container-kill/environment/environment.go index 6fc2f8e74..035462487 100644 --- a/pkg/generic/container-kill/environment/environment.go +++ b/pkg/generic/container-kill/environment/environment.go @@ -28,7 +28,7 @@ func GetENV(experimentDetails *experimentTypes.ExperimentDetails) { experimentDetails.ChaosServiceAccount = Getenv("CHAOS_SERVICE_ACCOUNT", "") experimentDetails.LIBImage = Getenv("LIB_IMAGE", "litmuschaos/go-runner:latest") experimentDetails.TargetContainer = Getenv("TARGET_CONTAINER", "") - experimentDetails.ContainerPath = Getenv("CONTAINER_PATH", "/run/containerd/containerd.sock") + experimentDetails.SocketPath = Getenv("SOCKET_PATH", "/run/containerd/containerd.sock") experimentDetails.Delay, _ = strconv.Atoi(Getenv("STATUS_CHECK_DELAY", "2")) experimentDetails.Timeout, _ = strconv.Atoi(Getenv("STATUS_CHECK_TIMEOUT", "180")) experimentDetails.TargetPod = Getenv("TARGET_POD", "") diff --git a/pkg/generic/container-kill/types/types.go b/pkg/generic/container-kill/types/types.go index 25c5e0469..b649bf015 100644 --- a/pkg/generic/container-kill/types/types.go +++ b/pkg/generic/container-kill/types/types.go @@ -21,7 +21,7 @@ type ExperimentDetails struct { ChaosPodName string LIBImage string TargetContainer string - ContainerPath string + SocketPath string Iterations int ChaosServiceAccount string RunID string diff --git a/pkg/generic/network-chaos/environment/environment.go b/pkg/generic/network-chaos/environment/environment.go index 2590156fd..cfb96f88e 100644 --- a/pkg/generic/network-chaos/environment/environment.go +++ b/pkg/generic/network-chaos/environment/environment.go @@ -39,7 +39,7 @@ func GetENV(experimentDetails *experimentTypes.ExperimentDetails) { experimentDetails.TargetHosts = Getenv("TARGET_HOSTS", "") experimentDetails.ContainerRuntime = Getenv("CONTAINER_RUNTIME", "docker") experimentDetails.ChaosServiceAccount = Getenv("CHAOS_SERVICE_ACCOUNT", "") - experimentDetails.ContainerPath = Getenv("CONTAINER_PATH", "/run/containerd/containerd.sock") + experimentDetails.SocketPath = Getenv("SOCKET_PATH", "/run/containerd/containerd.sock") } // Getenv fetch the env and set the default value, if any diff --git a/pkg/generic/network-chaos/types/types.go b/pkg/generic/network-chaos/types/types.go index 6cc8b62fb..7ebd9f35b 100644 --- a/pkg/generic/network-chaos/types/types.go +++ b/pkg/generic/network-chaos/types/types.go @@ -36,5 +36,5 @@ type ExperimentDetails struct { TargetHosts string ContainerRuntime string ChaosServiceAccount string - ContainerPath string + SocketPath string } diff --git a/pkg/probe/k8sprobe.go b/pkg/probe/k8sprobe.go index 5daceae43..0505afb09 100644 --- a/pkg/probe/k8sprobe.go +++ b/pkg/probe/k8sprobe.go @@ -85,7 +85,10 @@ func TriggerK8sProbe(probe v1alpha1.K8sProbeAttributes, cmd v1alpha1.K8sCommand, } // using dynamic client to get the resource - resourceList, err := clients.DynamicClient.Resource(gvr).Namespace(cmd.Namespace).List(v1.ListOptions{FieldSelector: cmd.FieldSelector}) + resourceList, err := clients.DynamicClient.Resource(gvr).Namespace(cmd.Namespace).List(v1.ListOptions{ + FieldSelector: cmd.FieldSelector, + LabelSelector: cmd.LabelSelector, + }) if err != nil || len(resourceList.Items) == 0 { return fmt.Errorf("unable to list the resources with matching selector, err: %v", err) } diff --git a/vendor/github.com/litmuschaos/chaos-operator/pkg/apis/litmuschaos/v1alpha1/chaosengine_types.go b/vendor/github.com/litmuschaos/chaos-operator/pkg/apis/litmuschaos/v1alpha1/chaosengine_types.go index 3daffcfce..9e783cb96 100644 --- a/vendor/github.com/litmuschaos/chaos-operator/pkg/apis/litmuschaos/v1alpha1/chaosengine_types.go +++ b/vendor/github.com/litmuschaos/chaos-operator/pkg/apis/litmuschaos/v1alpha1/chaosengine_types.go @@ -56,15 +56,22 @@ const ( EngineStateStop EngineState = "stop" ) +// ExperimentStatus is typecasted to string for supporting the values below. type ExperimentStatus string const ( - ExperimentStatusRunning ExperimentStatus = "Running" - ExperimentStatusCompleted ExperimentStatus = "Completed" - ExperimentStatusWaiting ExperimentStatus = "Waiting for Job Creation" - ExperimentStatusNotFound ExperimentStatus = "ChaosExperiment Not Found" + // ExperimentStatusRunning is status of Experiment which is currently running + ExperimentStatusRunning ExperimentStatus = "Running" + // ExperimentStatusCompleted is status of Experiment which has been completed + ExperimentStatusCompleted ExperimentStatus = "Completed" + // ExperimentStatusWaiting is status of Experiment which will be executed via a Job + ExperimentStatusWaiting ExperimentStatus = "Waiting for Job Creation" + // ExperimentStatusNotFound is status of Experiment which is not found inside ChaosNamespace + ExperimentStatusNotFound ExperimentStatus = "ChaosExperiment Not Found" + // ExperimentStatusSuccessful is status of a Successful experiment execution ExperimentStatusSuccessful ExperimentStatus = "Execution Successful" - ExperimentStatusAborted ExperimentStatus = "Forcefully Aborted" + // ExperimentStatusAborted is status of a Experiment is forcefully aborted + ExperimentStatusAborted ExperimentStatus = "Forcefully Aborted" ) // EngineStatus provides interface for all supported strings in status.EngineStatus @@ -95,7 +102,7 @@ const ( // ChaosEngineStatus derives information about status of individual experiments type ChaosEngineStatus struct { - // + //EngineStatus is a typed string to support limited values for ChaosEngine Status EngineStatus EngineStatus `json:"engineStatus"` //Detailed status of individual experiments Experiments []ExperimentStatuses `json:"experiments"` @@ -130,6 +137,8 @@ type RunnerInfo struct { Command []string `json:"command,omitempty"` //ImagePullPolicy for runner pod ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"` + // Runner Annotations that needs to be provided in the pod for pod that is getting created + RunnerAnnotation map[string]string `json:"runnerannotation,omitempty"` } // ExperimentList defines information about chaos experiments defined in the chaos engine @@ -145,7 +154,8 @@ type ExperimentList struct { type ExperimentAttributes struct { //Execution priority of the chaos experiment Rank uint32 `json:"rank"` - //Environment Varibles to override the default values in chaos-experiments + // It contains env, configmaps, secrets, experimentImage, node selector, custom experiment annotation + // which can be provided or overridden from the chaos engine Components ExperimentComponents `json:"components,omitempty"` // K8sProbe contains details of k8s probe, which can be applied on the experiments K8sProbe []K8sProbeAttributes `json:"k8sProbe,omitempty"` @@ -212,8 +222,10 @@ type K8sCommand struct { Resource string `json:"resource,omitempty"` // namespace of the resource Namespace string `json:"namespace,omitempty"` - // fieldselector to get the details + // fieldselector to get the resource using fields selector FieldSelector string `json:"fieldSelector,omitempty"` + // labelselector to get the resource using labels selector + LabelSelector string `json:"labelSelector,omitempty"` } //CmdProbeInputs contains all the inputs required for cmd probe diff --git a/vendor/modules.txt b/vendor/modules.txt index 3d074b9f5..c88af81f7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -43,7 +43,7 @@ github.com/json-iterator/go github.com/konsorten/go-windows-terminal-sequences # github.com/kyokomi/emoji v2.2.4+incompatible github.com/kyokomi/emoji -# github.com/litmuschaos/chaos-operator v0.0.0-20200903123231-7ac84ddd0bcd +# github.com/litmuschaos/chaos-operator v0.0.0-20200917035646-2633098da932 github.com/litmuschaos/chaos-operator/pkg/apis/litmuschaos/v1alpha1 github.com/litmuschaos/chaos-operator/pkg/client/clientset/versioned/scheme github.com/litmuschaos/chaos-operator/pkg/client/clientset/versioned/typed/litmuschaos/v1alpha1