Skip to content

Commit

Permalink
fix: unused code
Browse files Browse the repository at this point in the history
Signed-off-by: DongYoung Kim <[email protected]>
  • Loading branch information
kwx4957 committed Jan 20, 2025
1 parent 35c0bb0 commit 902d05b
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 25 deletions.
51 changes: 51 additions & 0 deletions contribute/developer-guide/attributes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: "locust-loadgen"
version: "0.1.0"
category: "load"
repository: "https://github.com/litmuschaos/litmus-go/tree/master/load/locust"
community: "https://kubernetes.slack.com/messages/CNXNB0ZTN"
description: "it execs inside target pods to run the chaos inject commands, waits for the chaos duration and reverts the chaos"
keywords:
- "pods"
- "kubernetes"
- "sample-category"
- "exec"
platforms:
- Minikube
scope: "Namespaced"
auxiliaryappcheck: false
permissions:
- apigroups:
- ""
- "batch"
- "apps"
- "litmuschaos.io"
resources:
- "jobs"
- "pods"
- "pods/log"
- "events"
- "deployments"
- "replicasets"
- "pods/exec"
- "chaosengines"
- "chaosexperiments"
- "chaosresults"
verbs:
- "create"
- "list"
- "get"
- "patch"
- "update"
- "delete"
- "deletecollection"
maturity: "alpha"
maintainers:
- name: "ispeakc0de"
email: "[email protected]"
provider:
name: "ChaosNative"
minkubernetesversion: "1.12.0"
references:
- name: Documentation
url: "https://docs.litmuschaos.io/docs/getstarted/"
Binary file added contribute/developer-guide/litmus-sdk
Binary file not shown.
25 changes: 0 additions & 25 deletions experiments/load/locust-loadgen/experiment/locust-loadgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/litmuschaos/litmus-go/pkg/log"
"github.com/litmuschaos/litmus-go/pkg/probe"
"github.com/litmuschaos/litmus-go/pkg/result"
"github.com/litmuschaos/litmus-go/pkg/status"
"github.com/litmuschaos/litmus-go/pkg/types"
"github.com/litmuschaos/litmus-go/pkg/utils/common"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -69,18 +68,6 @@ func Experiment(ctx context.Context, clients clients.ClientSets) {
// Calling AbortWatcher go routine, it will continuously watch for the abort signal and generate the required events and result
go common.AbortWatcher(experimentsDetails.ExperimentName, clients, &resultDetails, &chaosDetails, &eventsDetails)

//PRE-CHAOS APPLICATION STATUS CHECK
if chaosDetails.DefaultHealthCheck {
log.Info("[Status]: Verify that the AUT (Application Under Test) is running (pre-chaos)")
if err := status.AUTStatusCheck(clients, &chaosDetails); err != nil {
log.Errorf("Application status check failed, err: %v", err)
types.SetEngineEventAttributes(&eventsDetails, types.PreChaosCheck, "AUT: Not Running", "Warning", &chaosDetails)
events.GenerateEvents(&eventsDetails, clients, &chaosDetails, "ChaosEngine")
result.RecordAfterFailure(&chaosDetails, &resultDetails, err, clients, &eventsDetails)
return
}
}

if experimentsDetails.EngineName != "" {
// marking AUT as running, as we already checked the status of application under test
msg := "AUT: Running"
Expand Down Expand Up @@ -114,18 +101,6 @@ func Experiment(ctx context.Context, clients clients.ClientSets) {
resultDetails.Verdict = v1alpha1.ResultVerdictPassed
chaosDetails.Phase = types.PostChaosPhase

//POST-CHAOS APPLICATION STATUS CHECK
if chaosDetails.DefaultHealthCheck {
log.Info("[Status]: Verify that the AUT (Application Under Test) is running (post-chaos)")
if err := status.AUTStatusCheck(clients, &chaosDetails); err != nil {
log.Errorf("Application status check failed, err: %v", err)
types.SetEngineEventAttributes(&eventsDetails, types.PostChaosCheck, "AUT: Not Running", "Warning", &chaosDetails)
events.GenerateEvents(&eventsDetails, clients, &chaosDetails, "ChaosEngine")
result.RecordAfterFailure(&chaosDetails, &resultDetails, err, clients, &eventsDetails)
return
}
}

if experimentsDetails.EngineName != "" {
// marking AUT as running, as we already checked the status of application under test
msg := "AUT: Running"
Expand Down

0 comments on commit 902d05b

Please sign in to comment.