diff --git a/kube-runtime/src/utils/predicate.rs b/kube-runtime/src/utils/predicate.rs index 893db0afb..3ed684a3c 100644 --- a/kube-runtime/src/utils/predicate.rs +++ b/kube-runtime/src/utils/predicate.rs @@ -11,7 +11,7 @@ use std::{ hash::{Hash, Hasher}, }; -fn hash(t: &T) -> u64 { +fn hash(t: &T) -> u64 { let mut hasher = DefaultHasher::new(); t.hash(&mut hasher); hasher.finish() @@ -191,6 +191,11 @@ pub mod predicates { pub fn annotations(obj: &K) -> Option { Some(hash(obj.annotations())) } + + /// Hash the finalizers of a Resource K + pub fn finalizers(obj: &K) -> Option { + Some(hash(obj.finalizers())) + } } #[cfg(test)]