mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-08-23 22:26:27 +00:00
Merge pull request #679 from 2rs2ts/condition-change-event-severity
Use Warn severity on K8s Event when Node condition is True
This commit is contained in:
+5
-1
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user