@@ -769,17 +769,16 @@ where
769
769
/// # async {
770
770
/// use futures::{StreamExt, TryStreamExt};
771
771
/// use k8s_openapi::api::core::v1::{ConfigMap, Pod};
772
- /// use kube::api::ListParams;
773
- /// use kube::runtime::controller::Action;
774
- /// use kube::runtime::reflector::ObjectRef;
775
- /// use kube::runtime::{reflector, watcher, Controller, WatchStreamExt};
776
- /// use kube::ResourceExt;
777
- /// use kube::{Api, Client};
772
+ /// # use kube::api::{Api, ListParams};
773
+ /// # use kube::runtime::controller::Action;
774
+ /// # use kube::runtime::reflector::ObjectRef;
775
+ /// # use kube::runtime::{reflector, watcher, Controller, WatchStreamExt};
776
+ /// # use kube::{Client, ResourceExt};
778
777
/// use std::convert::Infallible;
779
778
/// use std::future;
780
779
/// use std::sync::Arc;
781
780
///
782
- /// // let client = Client::try_default().await.unwrap ();
781
+ /// # let client: Client = todo! ();
783
782
///
784
783
/// // Store can be used in the reconciler instead of querying Kube
785
784
/// let (pod_store, writer) = reflector::store();
@@ -793,14 +792,8 @@ where
793
792
///
794
793
/// Controller::new(Api::<ConfigMap>::all(client), ListParams::default())
795
794
/// .reconcile_on(pod_stream)
796
- /// .run(
797
- /// |_obj, _pod_store| async move {
798
- /// // `pod_store` can be used there instead of querying Kubernetes
799
- /// Ok(Action::await_change())
800
- /// },
801
- /// |_object: Arc<ConfigMap>, err: &Infallible, _| Err(err).unwrap(),
802
- /// Arc::new(pod_store),
803
- /// )
795
+ /// // The store can be re-used between controllers and even inspected from the reconciler through [Context]
796
+ /// .run(reconcile, error_policy, Arc::new(pod_store))
804
797
/// .for_each(|_| future::ready(()))
805
798
/// .await;
806
799
/// # };
0 commit comments