Skip to content

Commit

Permalink
fix(logs): fix the rank warning in logs (#4682)
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Chaudhary <[email protected]>
  • Loading branch information
ispeakc0de committed Jun 1, 2024
1 parent 5e74572 commit 720214c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion chaoscenter/graphql/server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/gorilla/websocket v1.5.1
github.com/jinzhu/copier v0.4.0
github.com/kelseyhightower/envconfig v1.4.0
github.com/litmuschaos/chaos-operator v0.0.0-20230718113617-6819a4be12e4
github.com/litmuschaos/chaos-operator v0.0.0-20240601063404-e96a7ee7f1f7
github.com/litmuschaos/chaos-scheduler v0.0.0-20220714173615-d7513d616a71
github.com/mrz1836/go-sanitize v1.3.2
github.com/pkg/errors v0.9.1
Expand Down
4 changes: 2 additions & 2 deletions chaoscenter/graphql/server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -778,8 +778,8 @@ github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9
github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc=
github.com/litmuschaos/chaos-operator v0.0.0-20210610071657-a58dbd939e73/go.mod h1:QMjfAVIfwcpj/P1jikyz5+C5vWICiUXsFZMR7Ihnzro=
github.com/litmuschaos/chaos-operator v0.0.0-20220714075136-66fee1fb7ef7/go.mod h1:m8jQuijmZ9PxCbrvWy0QXL0ji558hUCuD9Q5JAKB12Q=
github.com/litmuschaos/chaos-operator v0.0.0-20230718113617-6819a4be12e4 h1:GVU1jK8Gb9OaYuU3iDyU/FE3uZYmBwAEB95VY41SYJ8=
github.com/litmuschaos/chaos-operator v0.0.0-20230718113617-6819a4be12e4/go.mod h1:i6wMEZRQoHjUy4bhq6ePuA2FChX1b7WBR2lH09iM0tU=
github.com/litmuschaos/chaos-operator v0.0.0-20240601063404-e96a7ee7f1f7 h1:W4+NpHoBJnbPL4x9WTDJWIg219ElfQjjjs4V7VfDBKM=
github.com/litmuschaos/chaos-operator v0.0.0-20240601063404-e96a7ee7f1f7/go.mod h1:7aAslOjCI8sens0OA3gtQDDa7PO0af3n9U15PXGhpXI=
github.com/litmuschaos/chaos-scheduler v0.0.0-20220714173615-d7513d616a71 h1:V9/txTSub+FzFE+h48mlQgJ427vaYqKqvzGmzt6XSfw=
github.com/litmuschaos/chaos-scheduler v0.0.0-20220714173615-d7513d616a71/go.mod h1:Edc10opZte1DHcKt0mxyqt64XKPVFAtQ8cghBltZTjs=
github.com/litmuschaos/elves v0.0.0-20201107015738-552d74669e3c/go.mod h1:DsbHGNUq/78NZozWVVI9Q6eBei4I+JjlkkD5aibJ3MQ=
Expand Down
2 changes: 1 addition & 1 deletion chaoscenter/subscriber/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/golang/mock v1.6.0
github.com/gorilla/websocket v1.5.1
github.com/kelseyhightower/envconfig v1.4.0
github.com/litmuschaos/chaos-operator v0.0.0-20230718113617-6819a4be12e4
github.com/litmuschaos/chaos-operator v0.0.0-20240601063404-e96a7ee7f1f7
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.9.0
gopkg.in/yaml.v2 v2.4.0
Expand Down
4 changes: 2 additions & 2 deletions chaoscenter/subscriber/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/litmuschaos/chaos-operator v0.0.0-20230718113617-6819a4be12e4 h1:GVU1jK8Gb9OaYuU3iDyU/FE3uZYmBwAEB95VY41SYJ8=
github.com/litmuschaos/chaos-operator v0.0.0-20230718113617-6819a4be12e4/go.mod h1:i6wMEZRQoHjUy4bhq6ePuA2FChX1b7WBR2lH09iM0tU=
github.com/litmuschaos/chaos-operator v0.0.0-20240601063404-e96a7ee7f1f7 h1:W4+NpHoBJnbPL4x9WTDJWIg219ElfQjjjs4V7VfDBKM=
github.com/litmuschaos/chaos-operator v0.0.0-20240601063404-e96a7ee7f1f7/go.mod h1:7aAslOjCI8sens0OA3gtQDDa7PO0af3n9U15PXGhpXI=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
Expand Down
12 changes: 4 additions & 8 deletions chaoscenter/subscriber/pkg/events/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,12 @@ func (ev *subscriberEvents) CheckChaosData(nodeStatus v1alpha13.NodeStatus, work
}

func getNameFromLog(log string) string {
s := regexp.MustCompile(`\n\nChaosEngine Name : .*\n\n`).FindString(log)
if s == "" {
re := regexp.MustCompile(`ChaosEngine Name : ([\w-]+)`)
match := re.FindStringSubmatch(log)
if len(match) < 2 {
return ""
}
s = strings.TrimSpace(s)
name := strings.Split(s, ": ")
if len(name) != 2 {
return ""
}
return name[1]
return match[1]
}

// StrConvTime converts unix timestamp to string
Expand Down

0 comments on commit 720214c

Please sign in to comment.