Skip to content

Commit

Permalink
Use Warn severity on K8s Event when Node condition is True
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
2rs2ts committed Jun 17, 2022
1 parent 56122ce commit 72ad051
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/util/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 72ad051

Please sign in to comment.