Skip to content

Commit

Permalink
feat: Add node name to silencer comment
Browse files Browse the repository at this point in the history
  • Loading branch information
pando85 committed Oct 7, 2024
1 parent b9489cb commit 7ee1cde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/silence/silence.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func SilenceAlerts(alertmanager *client.AlertmanagerAPI, matchersJSON string, no
StartsAt: startsAt,
EndsAt: endsAt,
CreatedBy: ptr.String("kured-alert-silencer"),
Comment: ptr.String("Silencing during node reboot"),
Comment: ptr.String("Silencing during node reboot: " + nodeName),
},
},
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/silence/silence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestSilenceExistsUntil(t *testing.T) {
StartsAt: (*strfmt.DateTime)(ptr.Time(time.Now().Add(-1 * time.Hour))),
EndsAt: (*strfmt.DateTime)(ptr.Time(time.Now().Add(1 * time.Hour))),
CreatedBy: ptr.String("kured-alert-silencer"),
Comment: ptr.String("Silencing during node reboot"),
Comment: ptr.String("Silencing during node reboot: node1"),
},
},
}
Expand Down Expand Up @@ -153,7 +153,7 @@ func TestSilenceAlerts(t *testing.T) {
StartsAt: (*strfmt.DateTime)(ptr.Time(time.Now().Add(-1 * time.Hour))),
EndsAt: (*strfmt.DateTime)(ptr.Time(time.Now().Add(1 * time.Hour))),
CreatedBy: ptr.String("kured-alert-silencer"),
Comment: ptr.String("Silencing during node reboot"),
Comment: ptr.String("Silencing during node reboot: node1"),
},
},
}
Expand Down

0 comments on commit 7ee1cde

Please sign in to comment.