Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime: Remove deprecated util try_flatten_ helpers #1019

Merged
merged 1 commit into from Sep 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 0 additions & 26 deletions kube-runtime/src/utils/mod.rs
Expand Up @@ -10,7 +10,6 @@ pub use event_flatten::EventFlatten;
pub use stream_backoff::StreamBackoff;
pub use watch_ext::WatchStreamExt;

use crate::watcher;
use futures::{
pin_mut,
stream::{self, Peekable},
Expand All @@ -26,31 +25,6 @@ use std::{
use stream::IntoStream;
use tokio::{runtime::Handle, task::JoinHandle};

/// Flattens each item in the list following the rules of [`watcher::Event::into_iter_applied`].
#[deprecated(
since = "0.72.0",
note = "fn replaced with the WatchStreamExt::applied_objects which can be chained onto watcher. Add `use kube::runtime::WatchStreamExt;` and call `stream.applied_objects()` instead. This function will be removed in 0.75.0."
)]
pub fn try_flatten_applied<K, S: TryStream<Ok = watcher::Event<K>>>(
stream: S,
) -> impl Stream<Item = Result<K, S::Error>> {
stream
.map_ok(|event| stream::iter(event.into_iter_applied().map(Ok)))
.try_flatten()
}

/// Flattens each item in the list following the rules of [`watcher::Event::into_iter_touched`].
#[deprecated(
since = "0.72.0",
note = "fn replaced with the WatchStreamExt::touched_objects which can be chained onto watcher. Add `use kube::runtime::WatchStreamExt;` and call `stream.touched_objects()` instead. This function will be removed in 0.75.0."
)]
pub fn try_flatten_touched<K, S: TryStream<Ok = watcher::Event<K>>>(
stream: S,
) -> impl Stream<Item = Result<K, S::Error>> {
stream
.map_ok(|event| stream::iter(event.into_iter_touched().map(Ok)))
.try_flatten()
}

/// Allows splitting a `Stream` into several streams that each emit a disjoint subset of the input stream's items,
/// like a streaming variant of pattern matching.
Expand Down