Skip to content

Commit

Permalink
easy parts of code review
Browse files Browse the repository at this point in the history
Signed-off-by: clux <[email protected]>
  • Loading branch information
clux committed Nov 16, 2021
1 parent f5063a7 commit ff2cfe4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
7 changes: 0 additions & 7 deletions examples/configmapgen_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,6 @@ async fn main() -> Result<()> {
}
});

//let w = kube::runtime::watcher(cmgs, Default::default());
//let mut ap = kube::runtime::utils::try_flatten_applied(w).boxed();
//use futures::TryStreamExt;
//while let Some(x) = ap.try_next().await? {
// println!("success {}", x.meta().clone().name.unwrap_or_default());
//}

Controller::new(cmgs, ListParams::default())
.owns(cms, ListParams::default())
.reconcile_all_on(reload_rx.map(|_| ()))
Expand Down
9 changes: 0 additions & 9 deletions kube-runtime/src/observer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ where
backoff: Option<ExponentialBackoff>,
}

impl<K> From<Api<K>> for Observer<K>
where
K: Clone + Resource + DeserializeOwned + Debug + Send + Sync + 'static,
{
fn from(api: Api<K>) -> Observer<K> {
Observer::new(api)
}
}

impl<K> Observer<K>
where
K: Clone + Resource + DeserializeOwned + Debug + Send + Sync + 'static,
Expand Down
4 changes: 2 additions & 2 deletions kube-runtime/src/watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@ pub fn watcher<K: Resource + Clone + DeserializeOwned + Debug + Send + 'static,
let (event, state) = step(&api, &list_params, state).await;
if event.is_err() {
if let Some(wait_time) = backoff.next_backoff() {
tracing::debug!("watch waiting {}ms until retrying", wait_time.as_millis()); // TODO: kind name here
tracing::debug!("watcher waiting {}ms until retrying", wait_time.as_millis()); // TODO: kind name here
tokio::time::sleep(wait_time).await;
Some((Err(Error::BackoffRetriable), (api, list_params, backoff, state)))
} else {
tracing::warn!("watch cancelled, strategy returned none");
tracing::warn!("watcher cancelled, strategy returned none");
None
}
} else {
Expand Down

0 comments on commit ff2cfe4

Please sign in to comment.