Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unused variables in the k6 chaos fault #725

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions chaoslib/litmus/k6-loadgen/lib/k6-loadgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package lib
import (
"context"
"fmt"
"strconv"

"github.com/litmuschaos/litmus-go/pkg/cerrors"
"github.com/litmuschaos/litmus-go/pkg/clients"
Expand Down Expand Up @@ -125,8 +124,6 @@ func createHelperPod(ctx context.Context, experimentsDetails *experimentTypes.Ex
Args: []string{
mountPath + "/" + experimentsDetails.ScriptSecretKey,
"-q",
"--duration",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This duration field is not required?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we can specify duration on the k6 script (fyi: Order of Precedence)

strconv.Itoa(experimentsDetails.ChaosDuration) + "s",
},
Resources: chaosDetails.Resources,
VolumeMounts: []corev1.VolumeMount{
Expand Down
2 changes: 0 additions & 2 deletions experiments/load/k6-loadgen/experiment/k6-loadgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ func Experiment(ctx context.Context, clients clients.ClientSets) {

//DISPLAY THE APP INFORMATION
log.InfoWithValues("[Info]: The application information is as follows", logrus.Fields{
"Namespace": experimentsDetails.AppNS,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove //PRE-CHAOS APPLICATION STATUS CHECK and //PRE-CHAOS APPLICATION STATUS CHECK as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

"Label": experimentsDetails.AppLabel,
"Chaos Duration": experimentsDetails.ChaosDuration,
})

Expand Down
5 changes: 0 additions & 5 deletions pkg/load/k6-loadgen/environment/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,9 @@ func GetENV(experimentDetails *experimentTypes.ExperimentDetails) {
experimentDetails.ChaosNamespace = types.Getenv("CHAOS_NAMESPACE", "litmus")
experimentDetails.EngineName = types.Getenv("CHAOSENGINE", "")
experimentDetails.ChaosDuration, _ = strconv.Atoi(types.Getenv("TOTAL_CHAOS_DURATION", "30"))
experimentDetails.ChaosInterval, _ = strconv.Atoi(types.Getenv("CHAOS_INTERVAL", "10"))
experimentDetails.RampTime, _ = strconv.Atoi(types.Getenv("RAMP_TIME", "0"))
experimentDetails.AppNS = types.Getenv("APP_NAMESPACE", "")
experimentDetails.AppLabel = types.Getenv("APP_LABEL", "")
experimentDetails.AppKind = types.Getenv("APP_KIND", "")
experimentDetails.Delay, _ = strconv.Atoi(types.Getenv("STATUS_CHECK_DELAY", "2"))
experimentDetails.Timeout, _ = strconv.Atoi(types.Getenv("STATUS_CHECK_TIMEOUT", "180"))
experimentDetails.PodsAffectedPerc, _ = strconv.Atoi(types.Getenv("PODS_AFFECTED_PERC", "0"))
experimentDetails.LIBImagePullPolicy = types.Getenv("LIB_IMAGE_PULL_POLICY", "Always")
experimentDetails.LIBImage = types.Getenv("LIB_IMAGE", "ghcr.io/grafana/k6-operator:latest-runner")
experimentDetails.ScriptSecretName = types.Getenv("SCRIPT_SECRET_NAME", "k6-script")
Expand Down
5 changes: 0 additions & 5 deletions pkg/load/k6-loadgen/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@ type ExperimentDetails struct {
ExperimentName string
EngineName string
ChaosDuration int
ChaosInterval int
RampTime int
AppNS string
AppLabel string
AppKind string
ChaosNamespace string
Timeout int
Delay int
PodsAffectedPerc int
LIBImagePullPolicy string
LIBImage string
ScriptSecretName string
Expand Down
Loading