Selaa lähdekoodia

Revert "fix duplicate labels error in emitted metrics" (#3097)

Signed-off-by: Ishaan Mittal <ishaanmittal123@gmail.com>
Ishaan Mittal 1 vuosi sitten
vanhempi
sitoutus
60845e9fa3
1 muutettua tiedostoa jossa 1 lisäystä ja 7 poistoa
  1. 1 7
      pkg/clustercache/store.go

+ 1 - 7
pkg/clustercache/store.go

@@ -8,7 +8,6 @@ import (
 	"k8s.io/apimachinery/pkg/types"
 	"k8s.io/client-go/rest"
 	"k8s.io/client-go/tools/cache"
-	rt "k8s.io/apimachinery/pkg/runtime"
 )
 
 // GenericStore is a generic store implementation. It converts objects to a different type using a transform function.
@@ -87,14 +86,9 @@ func (s *GenericStore[Input, Output]) Delete(obj any) error {
 func (s *GenericStore[Input, Output]) GetAll() []Output {
 	s.mutex.RLock()
 	defer s.mutex.RUnlock()
-
-	// Deep copy the stored items to ensure that callers do not modify
-	// the original objects in the store.
 	allItems := make([]Output, 0, len(s.items))
 	for _, item := range s.items {
-		if deepCopyable, ok := any(item).(rt.Object); ok {
-			allItems = append(allItems, deepCopyable.DeepCopyObject().(Output))
-		}
+		allItems = append(allItems, item)
 	}
 	return allItems
 }