Skip to content

Commit

Permalink
fix(event:system-restore): combined from similar events
Browse files Browse the repository at this point in the history
Use unique reason to avoid events combined by the
K8s client-go `aggregator.EventAggregate`.

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
  • Loading branch information
c3y1huang authored and innobead committed Dec 19, 2022
1 parent 697e784 commit c6f4850
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions constant/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (
EventReasonFailedSnapshotPurge = "FailedSnapshotPurge"

EventReasonRestored = "Restored"
EventReasonRestoredFmt = "Restored %v"
EventReasonFailedRestore = "FailedRestore"

EventReasonFailedExpansion = "FailedExpansion"
Expand Down
2 changes: 1 addition & 1 deletion controller/system_rollout_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ func (c *SystemRolloutController) postRestoreHandle(kind string, restoreError er

restoredMessage := fmt.Sprintf(SystemRolloutMsgRestoredFmt, kind)
log.Info(restoredMessage)
c.eventRecorder.Eventf(systemRestore, corev1.EventTypeNormal, constant.EventReasonRestored, restoredMessage)
c.eventRecorder.Event(systemRestore, corev1.EventTypeNormal, fmt.Sprintf(constant.EventReasonRestoredFmt, kind), restoredMessage)
}

func (c *SystemRolloutController) restoreClusterRoles() (err error) {
Expand Down

0 comments on commit c6f4850

Please sign in to comment.