Skip to content

Commit 0ecfcd3

Browse files
committed
Improve PR documentation
1 parent c5f3fef commit 0ecfcd3

File tree

1 file changed

+8
-15
lines changed
  • kube-runtime/src/controller

1 file changed

+8
-15
lines changed

kube-runtime/src/controller/mod.rs

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -769,17 +769,16 @@ where
769769
/// # async {
770770
/// use futures::{StreamExt, TryStreamExt};
771771
/// 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};
778777
/// use std::convert::Infallible;
779778
/// use std::future;
780779
/// use std::sync::Arc;
781780
///
782-
/// // let client = Client::try_default().await.unwrap();
781+
/// # let client: Client = todo!();
783782
///
784783
/// // Store can be used in the reconciler instead of querying Kube
785784
/// let (pod_store, writer) = reflector::store();
@@ -793,14 +792,8 @@ where
793792
///
794793
/// Controller::new(Api::<ConfigMap>::all(client), ListParams::default())
795794
/// .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))
804797
/// .for_each(|_| future::ready(()))
805798
/// .await;
806799
/// # };

0 commit comments

Comments
 (0)