diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index dbd343c52..3d7cd082b 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -29,7 +29,7 @@ body: description: | What type of kubernetes cluster you are running aginst (k3s/eks/aks/gke/other) and what is OS in your `Dockerfile`? placeholder: | - Output of `kubectl version --short` + Output of `kubectl version` Dockerfile OS validations: required: true diff --git a/kube-runtime/src/utils/watch_ext.rs b/kube-runtime/src/utils/watch_ext.rs index 67ebf0d0a..7ed636201 100644 --- a/kube-runtime/src/utils/watch_ext.rs +++ b/kube-runtime/src/utils/watch_ext.rs @@ -214,10 +214,10 @@ pub trait WatchStreamExt: Stream { /// [`ReflectHandle`]: crate::reflector::dispatcher::ReflectHandle /// ## Usage /// ```no_run - /// # use futures::{pin_mut, Stream, StreamExt, TryStreamExt}; + /// # use futures::StreamExt; /// # use std::time::Duration; /// # use tracing::{info, warn}; - /// use kube::{Api, Client, ResourceExt}; + /// use kube::{Api, ResourceExt}; /// use kube_runtime::{watcher, WatchStreamExt, reflector}; /// use k8s_openapi::api::apps::v1::Deployment; /// # async fn wrapper() -> Result<(), Box> { @@ -226,7 +226,7 @@ pub trait WatchStreamExt: Stream { /// let deploys: Api = Api::default_namespaced(client); /// let subscriber_buf_sz = 100; /// let (reader, writer) = reflector::store_shared::(subscriber_buf_sz); - /// let subscriber = &writer.subscribe().unwrap(); + /// let subscriber = writer.subscribe().unwrap(); /// /// tokio::spawn(async move { /// // start polling the store once the reader is ready @@ -238,6 +238,13 @@ pub trait WatchStreamExt: Stream { /// } /// }); /// + /// tokio::spawn(async move { + /// // subscriber can be used to receive applied_objects + /// subscriber.for_each(|obj| async move { + /// info!("saw in subscriber {}", &obj.name_any()) + /// }).await; + /// }); + /// /// // configure the watcher stream and populate the store while polling /// watcher(deploys, watcher::Config::default()) /// .reflect_shared(writer) @@ -250,11 +257,6 @@ pub trait WatchStreamExt: Stream { /// }) /// .await; /// - /// // subscriber can be used to receive applied_objects - /// subscriber.for_each(|obj| async move { - /// info!("saw in subscriber {}", &obj.name_any()) - /// }).await; - /// /// # Ok(()) /// # } /// ```