From 36c5f7c05cff28b6b9b46101f49aaeaf48dadcf8 Mon Sep 17 00:00:00 2001 From: Jonada Hoxha Date: Tue, 17 Dec 2024 15:15:50 +0100 Subject: [PATCH] Add Services multiplexing support in EventsMultiplexers interface --- internal/cache/v1/multiplexers.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/internal/cache/v1/multiplexers.go b/internal/cache/v1/multiplexers.go index 21ad783..8765be8 100644 --- a/internal/cache/v1/multiplexers.go +++ b/internal/cache/v1/multiplexers.go @@ -18,6 +18,7 @@ type EventsMultiplexers interface { Nodes() EventsMultiplexer Pods() EventsMultiplexer ReplicaSets() EventsMultiplexer + Services() EventsMultiplexer StatefulSets() EventsMultiplexer Run(context.Context) error } @@ -59,6 +60,7 @@ type multiplexers struct { nodes events pods events replicaSets events + services events statefulSets events } @@ -82,6 +84,10 @@ func (m multiplexers) ReplicaSets() EventsMultiplexer { return m.replicaSets } +func (m multiplexers) Services() EventsMultiplexer { + return m.services +} + func (m multiplexers) StatefulSets() EventsMultiplexer { return m.statefulSets } @@ -109,6 +115,10 @@ func (m multiplexers) Run(ctx context.Context) error { return m.replicaSets.Run(ctx) }) + g.Go(func() error { + return m.services.Run(ctx) + }) + g.Go(func() error { return m.statefulSets.Run(ctx) }) @@ -140,6 +150,10 @@ func init() { upsertEvents: internal.NewChannelMux[any](), deleteEvents: internal.NewChannelMux[any](), }, + services: events{ + upsertEvents: internal.NewChannelMux[any](), + deleteEvents: internal.NewChannelMux[any](), + }, statefulSets: events{ upsertEvents: internal.NewChannelMux[any](), deleteEvents: internal.NewChannelMux[any](),