Skip to content

Commit

Permalink
fix: event syncer
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianKramm committed Jul 23, 2024
1 parent 8f287e2 commit 2563272
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion pkg/controllers/resources/events/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ func (s *eventSyncer) Sync(ctx *synccontext.SyncContext, pObj client.Object, vOb
if err != nil {
return ctrl.Result{}, fmt.Errorf("new syncer patcher: %w", err)
}

defer func() {
if err := patch.Patch(ctx, pEvent, vEvent); err != nil {
retErr = utilerrors.NewAggregate([]error{retErr, err})
Expand Down
4 changes: 2 additions & 2 deletions pkg/controllers/resources/events/translate.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func (s *eventSyncer) translateEvent(ctx *synccontext.SyncContext, pEvent, vEven
// retrieve involved object
involvedObject, err := resources.GetInvolvedObject(ctx, pEvent)
if err != nil {
return nil
return err
}
tempEvent := pEvent.DeepCopy()

Expand All @@ -25,7 +25,7 @@ func (s *eventSyncer) translateEvent(ctx *synccontext.SyncContext, pEvent, vEven

// rewrite name
namespace := involvedObject.GetNamespace()
name := hostEventNameToVirtual(vEvent.Name, pEvent.InvolvedObject.Name, vEvent.InvolvedObject.Name)
name := hostEventNameToVirtual(pEvent.Name, pEvent.InvolvedObject.Name, involvedObject.GetName())

// we replace namespace/name & name in messages so that it seems correct
tempEvent.Message = strings.ReplaceAll(tempEvent.Message, pEvent.InvolvedObject.Namespace+"/"+pEvent.InvolvedObject.Name, tempEvent.InvolvedObject.Namespace+"/"+tempEvent.InvolvedObject.Name)
Expand Down

0 comments on commit 2563272

Please sign in to comment.