diff --git a/kube-runtime/src/reflector/store.rs b/kube-runtime/src/reflector/store.rs index d6d264dea..94686955e 100644 --- a/kube-runtime/src/reflector/store.rs +++ b/kube-runtime/src/reflector/store.rs @@ -257,6 +257,21 @@ where .cloned() } + /// Retrieve all `clone()` of the entries found by the given predicate + #[must_use] + pub fn find_all

(&self, predicate: P) -> Vec> + where + P: Fn(&K) -> bool, + { + self.store + .read() + .iter() + .map(|(_, k)| k) + .filter(|k| predicate(k.as_ref())) + .cloned() + .collect() + } + /// Return the number of elements in the store #[must_use] pub fn len(&self) -> usize {