Skip to content

Commit

Permalink
Add message , type in EventStatus struct
Browse files Browse the repository at this point in the history
  • Loading branch information
Neha Manjunath committed Jul 17, 2023
1 parent 7787f68 commit 2102ff9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ type EventStatus struct {
Name string // name of event
UID types.UID
Namespace string
Message string
Type string
Event corev1.Event // copy of the raw event
}

Expand Down Expand Up @@ -110,5 +112,7 @@ func EventToStatus(event *corev1.Event) *EventStatus {
}
event.DeepCopyInto(&s.Event)
event = &s.Event
s.Type = event.DeepCopy().Type
s.Message = event.DeepCopy().Message
return &s
}
9 changes: 5 additions & 4 deletions events/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,12 @@ func (w *Watcher) display(format string, v ...any) {
}

func (w *Watcher) displayEvent(s *EventStatus) bool {
if w.progress {
log.Info(timeNow() + s.Event.String() + "\n")
}
w.display("NS: %s", s.Namespace)
w.display("Event: %s", s.Name)
w.display("EventType: %s", s.Type)
w.display("Event message: %s", s.Message)

message := s.Event.Message
message := s.Message
for _, m := range errorMsgs {
// Error out if namespace is currentnamesapce and message contains predefinedcheck namespace
if w.currentNamespace == s.Namespace && strings.Contains(message, m) {
Expand Down

0 comments on commit 2102ff9

Please sign in to comment.