Skip to content

Commit

Permalink
reflector: Fix replacement with transform function
Browse files Browse the repository at this point in the history
The transform function wasn't used when replacing all items.

Signed-off-by: Jussi Maki <[email protected]>
  • Loading branch information
joamaki committed Mar 15, 2024
1 parent b091c1f commit 0bf81f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion reflector/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ func (s *k8sReflector[Obj]) run(ctx context.Context, health cell.Health) error {
table.Delete(txn, obj)
}
for _, item := range buf.replaceItems {
table.Insert(txn, item.(Obj))
if obj, ok := transform(item); ok {
table.Insert(txn, obj)
}
}
}

Expand Down

0 comments on commit 0bf81f7

Please sign in to comment.