|
|
@@ -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
|
|
|
}
|