Skip to content

Commit a440615

Browse files
authored
Fix gofmt issues (#695)
1 parent 78eec36 commit a440615

File tree

50 files changed

+106
-103
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+106
-103
lines changed

chaoslib/litmus/container-kill/helper/container-kill.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func validate(t targetDetails, timeout, delay int, clients clients.ClientSets) e
171171
return verifyRestartCount(t, timeout, delay, clients, t.RestartCountBefore)
172172
}
173173

174-
//stopContainerdContainer kill the application container
174+
// stopContainerdContainer kill the application container
175175
func stopContainerdContainer(containerIDs []string, socketPath, signal, source string) error {
176176
if signal != "SIGKILL" && signal != "SIGTERM" {
177177
return cerrors.Error{ErrorCode: cerrors.ErrorTypeHelper, Source: source, Reason: fmt.Sprintf("unsupported signal %s, use either SIGTERM or SIGKILL", signal)}
@@ -192,7 +192,7 @@ func stopContainerdContainer(containerIDs []string, socketPath, signal, source s
192192
return nil
193193
}
194194

195-
//stopDockerContainer kill the application container
195+
// stopDockerContainer kill the application container
196196
func stopDockerContainer(containerIDs []string, socketPath, signal, source string) error {
197197
var errOut, out bytes.Buffer
198198
cmd := exec.Command("sudo", "docker", "--host", fmt.Sprintf("unix://%s", socketPath), "kill", "--signal", signal)
@@ -205,7 +205,7 @@ func stopDockerContainer(containerIDs []string, socketPath, signal, source strin
205205
return nil
206206
}
207207

208-
//getRestartCount return the restart count of target container
208+
// getRestartCount return the restart count of target container
209209
func getRestartCount(target targetDetails, clients clients.ClientSets) (int, error) {
210210
pod, err := clients.KubeClient.CoreV1().Pods(target.Namespace).Get(context.Background(), target.Name, v1.GetOptions{})
211211
if err != nil {
@@ -221,7 +221,7 @@ func getRestartCount(target targetDetails, clients clients.ClientSets) (int, err
221221
return restartCount, nil
222222
}
223223

224-
//verifyRestartCount verify the restart count of target container that it is restarted or not after chaos injection
224+
// verifyRestartCount verify the restart count of target container that it is restarted or not after chaos injection
225225
func verifyRestartCount(t targetDetails, timeout, delay int, clients clients.ClientSets, restartCountBefore int) error {
226226

227227
restartCountAfter := 0
@@ -247,7 +247,7 @@ func verifyRestartCount(t targetDetails, timeout, delay int, clients clients.Cli
247247
})
248248
}
249249

250-
//getENV fetches all the env variables from the runner pod
250+
// getENV fetches all the env variables from the runner pod
251251
func getENV(experimentDetails *experimentTypes.ExperimentDetails) {
252252
experimentDetails.ExperimentName = types.Getenv("EXPERIMENT_NAME", "")
253253
experimentDetails.InstanceID = types.Getenv("INSTANCE_ID", "")

chaoslib/litmus/container-kill/lib/container-kill.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2323
)
2424

25-
//PrepareContainerKill contains the preparation steps before chaos injection
25+
// PrepareContainerKill contains the preparation steps before chaos injection
2626
func PrepareContainerKill(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails) error {
2727

2828
var err error
@@ -280,8 +280,8 @@ func getPodEnv(experimentsDetails *experimentTypes.ExperimentDetails, targets st
280280
return envDetails.ENV
281281
}
282282

283-
//SetChaosTunables will setup a random value within a given range of values
284-
//If the value is not provided in range it'll setup the initial provided value.
283+
// SetChaosTunables will setup a random value within a given range of values
284+
// If the value is not provided in range it'll setup the initial provided value.
285285
func SetChaosTunables(experimentsDetails *experimentTypes.ExperimentDetails) {
286286
experimentsDetails.PodsAffectedPerc = common.ValidateRange(experimentsDetails.PodsAffectedPerc)
287287
experimentsDetails.Sequence = common.GetRandomSequence(experimentsDetails.Sequence)

chaoslib/litmus/disk-fill/lib/disk-fill.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2424
)
2525

26-
//PrepareDiskFill contains the preparation steps before chaos injection
26+
// PrepareDiskFill contains the preparation steps before chaos injection
2727
func PrepareDiskFill(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails) error {
2828

2929
var err error

chaoslib/litmus/http-chaos/lib/header/header.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/sirupsen/logrus"
1010
)
1111

12-
//PodHttpModifyHeaderChaos contains the steps to prepare and inject http modify header chaos
12+
// PodHttpModifyHeaderChaos contains the steps to prepare and inject http modify header chaos
1313
func PodHttpModifyHeaderChaos(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails) error {
1414

1515
log.InfoWithValues("[Info]: The chaos tunables are:", logrus.Fields{

chaoslib/litmus/http-chaos/lib/http-chaos.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2323
)
2424

25-
//PrepareAndInjectChaos contains the preparation & injection steps
25+
// PrepareAndInjectChaos contains the preparation & injection steps
2626
func PrepareAndInjectChaos(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails, args string) error {
2727

2828
var err error
@@ -284,8 +284,8 @@ func getPodEnv(experimentsDetails *experimentTypes.ExperimentDetails, targets, a
284284
return envDetails.ENV
285285
}
286286

287-
//SetChaosTunables will set up a random value within a given range of values
288-
//If the value is not provided in range it'll set up the initial provided value.
287+
// SetChaosTunables will set up a random value within a given range of values
288+
// If the value is not provided in range it'll set up the initial provided value.
289289
func SetChaosTunables(experimentsDetails *experimentTypes.ExperimentDetails) {
290290
experimentsDetails.PodsAffectedPerc = common.ValidateRange(experimentsDetails.PodsAffectedPerc)
291291
experimentsDetails.Sequence = common.GetRandomSequence(experimentsDetails.Sequence)

chaoslib/litmus/http-chaos/lib/latency/latency.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/sirupsen/logrus"
1212
)
1313

14-
//PodHttpLatencyChaos contains the steps to prepare and inject http latency chaos
14+
// PodHttpLatencyChaos contains the steps to prepare and inject http latency chaos
1515
func PodHttpLatencyChaos(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails) error {
1616

1717
log.InfoWithValues("[Info]: The chaos tunables are:", logrus.Fields{

chaoslib/litmus/http-chaos/lib/reset/reset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/sirupsen/logrus"
1212
)
1313

14-
//PodHttpResetPeerChaos contains the steps to prepare and inject http reset peer chaos
14+
// PodHttpResetPeerChaos contains the steps to prepare and inject http reset peer chaos
1515
func PodHttpResetPeerChaos(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails) error {
1616

1717
log.InfoWithValues("[Info]: The chaos tunables are:", logrus.Fields{

chaoslib/litmus/network-chaos/helper/netem.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func Helper(clients clients.ClientSets) {
7676

7777
}
7878

79-
//preparePodNetworkChaos contains the prepration steps before chaos injection
79+
// preparePodNetworkChaos contains the prepration steps before chaos injection
8080
func preparePodNetworkChaos(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails, resultDetails *types.ResultDetails) error {
8181

8282
targetEnv := os.Getenv("TARGETS")
@@ -295,7 +295,7 @@ type targetDetails struct {
295295
Source string
296296
}
297297

298-
//getENV fetches all the env variables from the runner pod
298+
// getENV fetches all the env variables from the runner pod
299299
func getENV(experimentDetails *experimentTypes.ExperimentDetails) {
300300
experimentDetails.ExperimentName = types.Getenv("EXPERIMENT_NAME", "")
301301
experimentDetails.InstanceID = types.Getenv("INSTANCE_ID", "")

chaoslib/litmus/network-chaos/lib/corruption/corruption.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/litmuschaos/litmus-go/pkg/types"
88
)
99

10-
//PodNetworkCorruptionChaos contains the steps to prepare and inject chaos
10+
// PodNetworkCorruptionChaos contains the steps to prepare and inject chaos
1111
func PodNetworkCorruptionChaos(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails) error {
1212

1313
args := "corrupt " + experimentsDetails.NetworkPacketCorruptionPercentage

chaoslib/litmus/network-chaos/lib/duplication/duplication.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/litmuschaos/litmus-go/pkg/types"
88
)
99

10-
//PodNetworkDuplicationChaos contains the steps to prepare and inject chaos
10+
// PodNetworkDuplicationChaos contains the steps to prepare and inject chaos
1111
func PodNetworkDuplicationChaos(experimentsDetails *experimentTypes.ExperimentDetails, clients clients.ClientSets, resultDetails *types.ResultDetails, eventsDetails *types.EventDetails, chaosDetails *types.ChaosDetails) error {
1212

1313
args := "duplicate " + experimentsDetails.NetworkPacketDuplicationPercentage

0 commit comments

Comments
 (0)