Skip to content

Commit 62f95cd

Browse files
authored
Stabilise runtime predicates (#1578)
* Stabilise runtime predicates These are unlikely to undergo much changes (and if they do they are completely separated). This should be an easy feature cleanup in runtime, and one less need for unstable-runtime for common setups (i use this all the time). Signed-off-by: clux <[email protected]> * clippy Signed-off-by: clux <[email protected]> * remove stray reference to unstable in docs for the entrypoint Signed-off-by: clux <[email protected]> --------- Signed-off-by: clux <[email protected]> Signed-off-by: Eirik A <[email protected]>
1 parent 6688421 commit 62f95cd

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

kube-runtime/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ keywords = ["kubernetes", "runtime", "reflector", "watcher", "controller"]
1212
categories = ["web-programming::http-client", "caching", "network-programming"]
1313

1414
[features]
15-
unstable-runtime = ["unstable-runtime-subscribe", "unstable-runtime-predicates", "unstable-runtime-stream-control", "unstable-runtime-reconcile-on"]
15+
unstable-runtime = ["unstable-runtime-subscribe", "unstable-runtime-stream-control", "unstable-runtime-reconcile-on"]
1616
unstable-runtime-subscribe = []
17-
unstable-runtime-predicates = []
1817
unstable-runtime-stream-control = []
1918
unstable-runtime-reconcile-on = []
2019

kube-runtime/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,5 @@ pub use scheduler::scheduler;
3737
pub use utils::WatchStreamExt;
3838
pub use watcher::{metadata_watcher, watcher};
3939

40-
#[cfg(feature = "unstable-runtime-predicates")]
4140
pub use utils::{predicates, Predicate};
4241
pub use wait::conditions;

kube-runtime/src/utils/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ mod backoff_reset_timer;
44
pub(crate) mod delayed_init;
55
mod event_decode;
66
mod event_modify;
7-
#[cfg(feature = "unstable-runtime-predicates")] mod predicate;
7+
mod predicate;
88
mod reflect;
99
mod stream_backoff;
1010
mod watch_ext;
1111

1212
pub use backoff_reset_timer::ResetTimerBackoff;
1313
pub use event_decode::EventDecode;
1414
pub use event_modify::EventModify;
15-
#[cfg(feature = "unstable-runtime-predicates")]
1615
pub use predicate::{predicates, Predicate, PredicateFilter};
1716
pub use reflect::Reflect;
1817
pub use stream_backoff::StreamBackoff;

kube-runtime/src/utils/watch_ext.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
#[cfg(feature = "unstable-runtime-predicates")]
2-
use crate::utils::predicate::{Predicate, PredicateFilter};
31
use crate::{
4-
utils::{event_decode::EventDecode, event_modify::EventModify, stream_backoff::StreamBackoff},
2+
utils::{
3+
event_decode::EventDecode,
4+
event_modify::EventModify,
5+
predicate::{Predicate, PredicateFilter},
6+
stream_backoff::StreamBackoff,
7+
},
58
watcher,
69
};
710
use kube_client::Resource;
@@ -94,8 +97,6 @@ pub trait WatchStreamExt: Stream {
9497
/// Common use case for this is to avoid repeat events for status updates
9598
/// by filtering on [`predicates::generation`](crate::predicates::generation).
9699
///
97-
/// **NB**: This is constructor requires an [`unstable`](https://github.com/kube-rs/kube/blob/main/kube-runtime/Cargo.toml#L17-L21) feature.
98-
///
99100
/// ## Usage
100101
/// ```no_run
101102
/// # use std::pin::pin;
@@ -116,7 +117,6 @@ pub trait WatchStreamExt: Stream {
116117
/// # Ok(())
117118
/// # }
118119
/// ```
119-
#[cfg(feature = "unstable-runtime-predicates")]
120120
fn predicate_filter<K, P>(self, predicate: P) -> PredicateFilter<Self, K, P>
121121
where
122122
Self: Stream<Item = Result<K, watcher::Error>> + Sized,
@@ -272,7 +272,6 @@ pub trait WatchStreamExt: Stream {
272272
impl<St: ?Sized> WatchStreamExt for St where St: Stream {}
273273

274274
// Compile tests
275-
#[cfg(feature = "unstable-runtime-predicates")]
276275
#[cfg(test)]
277276
pub(crate) mod tests {
278277
use super::watcher;

0 commit comments

Comments
 (0)