From 72ad051dd627212d0d3545391b2a1e5c5059a46a Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Fri, 17 Jun 2022 22:13:21 +0000 Subject: [PATCH] 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. --- pkg/util/helpers.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/util/helpers.go b/pkg/util/helpers.go index d58e88cd..41e9153c 100644 --- a/pkg/util/helpers.go +++ b/pkg/util/helpers.go @@ -24,8 +24,12 @@ import ( // GenerateConditionChangeEvent generates an event for condition change. func GenerateConditionChangeEvent(t string, status types.ConditionStatus, reason, message string, timestamp time.Time) types.Event { + severity := types.Info + if status == types.True { + severity = types.Warn + } return types.Event{ - Severity: types.Info, + Severity: severity, Timestamp: timestamp, Reason: reason, Message: fmt.Sprintf("Node condition %s is now: %s, reason: %s, message: %q", t, status, reason, message),