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.
This commit is contained in:
Andrew Garrett
2022-06-17 22:13:21 +00:00
parent 56122ce0dd
commit 72ad051dd6
+5 -1
View File
@@ -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),