Skip to content

Commit

Permalink
Improve PR documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
co42 committed Mar 23, 2023
1 parent c5f3fef commit 0ecfcd3
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions kube-runtime/src/controller/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -769,17 +769,16 @@ where
/// # async {
/// use futures::{StreamExt, TryStreamExt};
/// use k8s_openapi::api::core::v1::{ConfigMap, Pod};
/// use kube::api::ListParams;
/// use kube::runtime::controller::Action;
/// use kube::runtime::reflector::ObjectRef;
/// use kube::runtime::{reflector, watcher, Controller, WatchStreamExt};
/// use kube::ResourceExt;
/// use kube::{Api, Client};
/// # use kube::api::{Api, ListParams};
/// # use kube::runtime::controller::Action;
/// # use kube::runtime::reflector::ObjectRef;
/// # use kube::runtime::{reflector, watcher, Controller, WatchStreamExt};
/// # use kube::{Client, ResourceExt};
/// use std::convert::Infallible;
/// use std::future;
/// use std::sync::Arc;
///
/// // let client = Client::try_default().await.unwrap();
/// # let client: Client = todo!();
///
/// // Store can be used in the reconciler instead of querying Kube
/// let (pod_store, writer) = reflector::store();
Expand All @@ -793,14 +792,8 @@ where
///
/// Controller::new(Api::<ConfigMap>::all(client), ListParams::default())
/// .reconcile_on(pod_stream)
/// .run(
/// |_obj, _pod_store| async move {
/// // `pod_store` can be used there instead of querying Kubernetes
/// Ok(Action::await_change())
/// },
/// |_object: Arc<ConfigMap>, err: &Infallible, _| Err(err).unwrap(),
/// Arc::new(pod_store),
/// )
/// // The store can be re-used between controllers and even inspected from the reconciler through [Context]
/// .run(reconcile, error_policy, Arc::new(pod_store))
/// .for_each(|_| future::ready(()))
/// .await;
/// # };
Expand Down

0 comments on commit 0ecfcd3

Please sign in to comment.