Skip to content

Commit 1303d0a

Browse files
committed
fix: change log line for check error
1 parent 6e71129 commit 1303d0a

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

extkafka/check_brokers.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,9 @@ func BrokerCheckStatus(ctx context.Context, state *CheckBrokersState) (*action_k
225225
for _, c := range keys {
226226
if !slices.Contains(state.ExpectedChanges, c) {
227227
checkError = extutil.Ptr(action_kit_api.ActionKitError{
228-
Title: fmt.Sprintf("Brokers got an unexpected change '%s' whereas '%s' is expected. Change(s) : %v",
228+
Title: fmt.Sprintf("Brokers got an unexpected change '%s' whereas '%s' is expected.",
229229
c,
230-
state.ExpectedChanges,
231-
changes),
230+
state.ExpectedChanges),
232231
Status: extutil.Ptr(action_kit_api.Failed),
233232
})
234233
}
@@ -242,9 +241,8 @@ func BrokerCheckStatus(ctx context.Context, state *CheckBrokersState) (*action_k
242241

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

282+
state = "success"
284283
for _, change := range changesNames {
285-
if slices.Contains(expectedChanges, change) {
286-
state = "success"
287-
} else {
284+
if !slices.Contains(expectedChanges, change) {
288285
state = "danger"
289286
}
290287
}

0 commit comments

Comments
 (0)