Skip to content

Commit b357329

Browse files
committed
chore(probe): Fix the probe description on failure
Signed-off-by: Shubham Chaudhary <[email protected]>
1 parent b5a24b4 commit b357329

File tree

6 files changed

+10
-2
lines changed

6 files changed

+10
-2
lines changed

go.mod

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ require (
6060
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 // indirect
6161
github.com/pmezard/go-difflib v1.0.0 // indirect
6262
github.com/spf13/pflag v1.0.5 // indirect
63-
github.com/stretchr/objx v0.2.0 // indirect
6463
go.opencensus.io v0.23.0 // indirect
6564
golang.org/x/crypto v0.16.0 // indirect
6665
golang.org/x/net v0.19.0 // indirect

go.sum

-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,6 @@ github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5q
482482
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
483483
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
484484
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
485-
github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=
486485
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
487486
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
488487
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=

pkg/probe/cmdprobe.go

+4
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ loop:
352352
for index := range chaosresult.ProbeDetails {
353353
if chaosresult.ProbeDetails[index].Name == probe.Name {
354354
chaosresult.ProbeDetails[index].IsProbeFailedWithError = err
355+
chaosresult.ProbeDetails[index].HasProbeCompleted = true
355356
chaosresult.ProbeDetails[index].Status.Description = getDescription(err)
356357
log.Errorf("The %v cmd probe has been Failed, err: %v", probe.Name, err)
357358
isExperimentFailed = true
@@ -410,6 +411,7 @@ loop:
410411
for index := range chaosresult.ProbeDetails {
411412
if chaosresult.ProbeDetails[index].Name == probe.Name {
412413
chaosresult.ProbeDetails[index].IsProbeFailedWithError = err
414+
chaosresult.ProbeDetails[index].HasProbeCompleted = true
413415
chaosresult.ProbeDetails[index].Status.Description = getDescription(err)
414416
log.Errorf("The %v cmd probe has been Failed, err: %v", probe.Name, err)
415417
isExperimentFailed = true
@@ -478,6 +480,7 @@ loop:
478480
for index := range chaosresult.ProbeDetails {
479481
if chaosresult.ProbeDetails[index].Name == probe.Name {
480482
chaosresult.ProbeDetails[index].IsProbeFailedWithError = err
483+
chaosresult.ProbeDetails[index].HasProbeCompleted = true
481484
chaosresult.ProbeDetails[index].Status.Description = getDescription(err)
482485
log.Errorf("The %v cmd probe has been Failed, err: %v", probe.Name, err)
483486
isExperimentFailed = true
@@ -546,6 +549,7 @@ loop:
546549
for index := range chaosresult.ProbeDetails {
547550
if chaosresult.ProbeDetails[index].Name == probe.Name {
548551
chaosresult.ProbeDetails[index].IsProbeFailedWithError = err
552+
chaosresult.ProbeDetails[index].HasProbeCompleted = true
549553
chaosresult.ProbeDetails[index].Status.Description = getDescription(err)
550554
log.Errorf("The %v cmd probe has been Failed, err: %v", probe.Name, err)
551555
isExperimentFailed = true

pkg/probe/httpprobe.go

+2
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ loop:
244244
for index := range chaosresult.ProbeDetails {
245245
if chaosresult.ProbeDetails[index].Name == probe.Name {
246246
chaosresult.ProbeDetails[index].IsProbeFailedWithError = err
247+
chaosresult.ProbeDetails[index].HasProbeCompleted = true
247248
chaosresult.ProbeDetails[index].Status.Description = getDescription(err)
248249
log.Errorf("The %v http probe has been Failed, err: %v", probe.Name, err)
249250
isExperimentFailed = true
@@ -395,6 +396,7 @@ loop:
395396
for index := range chaosresult.ProbeDetails {
396397
if chaosresult.ProbeDetails[index].Name == probe.Name {
397398
chaosresult.ProbeDetails[index].IsProbeFailedWithError = err
399+
chaosresult.ProbeDetails[index].HasProbeCompleted = true
398400
chaosresult.ProbeDetails[index].Status.Description = getDescription(err)
399401
isExperimentFailed = true
400402
break loop

pkg/probe/k8sprobe.go

+2
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ loop:
156156
for index := range chaosresult.ProbeDetails {
157157
if chaosresult.ProbeDetails[index].Name == probe.Name {
158158
chaosresult.ProbeDetails[index].IsProbeFailedWithError = err
159+
chaosresult.ProbeDetails[index].HasProbeCompleted = true
159160
chaosresult.ProbeDetails[index].Status.Description = getDescription(err)
160161
log.Errorf("the %v k8s probe has been Failed, err: %v", probe.Name, err)
161162
isExperimentFailed = true
@@ -435,6 +436,7 @@ loop:
435436
for index := range chaosresult.ProbeDetails {
436437
if chaosresult.ProbeDetails[index].Name == probe.Name {
437438
chaosresult.ProbeDetails[index].IsProbeFailedWithError = err
439+
chaosresult.ProbeDetails[index].HasProbeCompleted = true
438440
chaosresult.ProbeDetails[index].Status.Description = getDescription(err)
439441
log.Errorf("The %v k8s probe has been Failed, err: %v", probe.Name, err)
440442
isExperimentFailed = true

pkg/probe/promProbe.go

+2
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ loop:
262262
for index := range chaosresult.ProbeDetails {
263263
if chaosresult.ProbeDetails[index].Name == probe.Name {
264264
chaosresult.ProbeDetails[index].IsProbeFailedWithError = err
265+
chaosresult.ProbeDetails[index].HasProbeCompleted = true
265266
chaosresult.ProbeDetails[index].Status.Description = getDescription(err)
266267
log.Errorf("The %v prom probe has been Failed, err: %v", probe.Name, err)
267268
isExperimentFailed = true
@@ -319,6 +320,7 @@ loop:
319320
for index := range chaosresult.ProbeDetails {
320321
if chaosresult.ProbeDetails[index].Name == probe.Name {
321322
chaosresult.ProbeDetails[index].IsProbeFailedWithError = err
323+
chaosresult.ProbeDetails[index].HasProbeCompleted = true
322324
chaosresult.ProbeDetails[index].Status.Description = getDescription(err)
323325
log.Errorf("The %v prom probe has been Failed, err: %v", probe.Name, err)
324326
isExperimentFailed = true

0 commit comments

Comments
 (0)