Skip to content

Commit 72ad051

Browse files
committed
Use Warn severity on K8s Event when Node condition is True
If temporary errors generate an Event with a Warn severity, then surely permanent errors should generate an Event with at least that high of a severity level.
1 parent 56122ce commit 72ad051

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: pkg/util/helpers.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@ import (
2424

2525
// GenerateConditionChangeEvent generates an event for condition change.
2626
func GenerateConditionChangeEvent(t string, status types.ConditionStatus, reason, message string, timestamp time.Time) types.Event {
27+
severity := types.Info
28+
if status == types.True {
29+
severity = types.Warn
30+
}
2731
return types.Event{
28-
Severity: types.Info,
32+
Severity: severity,
2933
Timestamp: timestamp,
3034
Reason: reason,
3135
Message: fmt.Sprintf("Node condition %s is now: %s, reason: %s, message: %q", t, status, reason, message),

0 commit comments

Comments
 (0)