Skip to content

Commit

Permalink
fix: change log line for check error
Browse files Browse the repository at this point in the history
  • Loading branch information
achoimet committed Jan 31, 2025
1 parent 6e71129 commit 1303d0a
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions extkafka/check_brokers.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,9 @@ func BrokerCheckStatus(ctx context.Context, state *CheckBrokersState) (*action_k
for _, c := range keys {
if !slices.Contains(state.ExpectedChanges, c) {
checkError = extutil.Ptr(action_kit_api.ActionKitError{
Title: fmt.Sprintf("Brokers got an unexpected change '%s' whereas '%s' is expected. Change(s) : %v",
Title: fmt.Sprintf("Brokers got an unexpected change '%s' whereas '%s' is expected.",
c,
state.ExpectedChanges,
changes),
state.ExpectedChanges),
Status: extutil.Ptr(action_kit_api.Failed),
})
}
Expand All @@ -242,9 +241,8 @@ func BrokerCheckStatus(ctx context.Context, state *CheckBrokersState) (*action_k

if completed && state.StateCheckFailure {
checkError = extutil.Ptr(action_kit_api.ActionKitError{
Title: fmt.Sprintf("Brokers didn't get the expected changes '%s' at least once or got an unexpected change. Change(s) : %v",
state.ExpectedChanges,
changes),
Title: fmt.Sprintf("Brokers didn't get the expected changes '%s' at least once or got an unexpected change.",
state.ExpectedChanges),
Status: extutil.Ptr(action_kit_api.Failed),
})
}
Expand Down Expand Up @@ -281,10 +279,9 @@ func toBrokerChangeMetric(expectedChanges []string, changesNames []string, chang
sort.Strings(expectedChanges)
sort.Strings(changesNames)

state = "success"
for _, change := range changesNames {
if slices.Contains(expectedChanges, change) {
state = "success"
} else {
if !slices.Contains(expectedChanges, change) {
state = "danger"
}
}
Expand Down

0 comments on commit 1303d0a

Please sign in to comment.