From 1157865ea35eef623ba97ecf589beb255342d00d Mon Sep 17 00:00:00 2001 From: Tom Lebreux Date: Wed, 11 Jun 2025 09:57:48 -0600 Subject: [PATCH] Fix panic due to concurrent map writes (#669) The same object is given to many HTTP request and they proceed to modify that object. --- pkg/sqlcache/informer/listoption_indexer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/sqlcache/informer/listoption_indexer.go b/pkg/sqlcache/informer/listoption_indexer.go index 5549389b..5a00eb17 100644 --- a/pkg/sqlcache/informer/listoption_indexer.go +++ b/pkg/sqlcache/informer/listoption_indexer.go @@ -464,7 +464,7 @@ func (l *ListOptionIndexer) notifyEvent(eventType watch.EventType, oldObj any, o watcher.ch <- watch.Event{ Type: eventType, - Object: obj.(runtime.Object), + Object: obj.(runtime.Object).DeepCopyObject(), } } l.watchersLock.RUnlock()