bridge: make the cache-sync channel buffered to avoid a goroutine leak

On timeout the manager goroutine still finishes WaitForCacheSync and
closes the synced channel, but nobody reads it: on an unbuffered channel
that close blocks forever. A buffer of one lets the goroutine finish.
This commit is contained in:
lakshit verma 2026-08-08 00:57:43 +05:30
parent 2d74853196
commit c2661f7c75
No known key found for this signature in database

View file

@ -58,7 +58,7 @@ func NewManagerForClientWithTimeout(client kubernetes.Interface, timeout time.Du
m := runtimeclass.NewManager(client)
stop := make(chan struct{})
m.Start(stop)
synced := make(chan struct{})
synced := make(chan struct{}, 1)
go func() {
m.WaitForCacheSync(stop)
close(synced)