Skip to content

Commit b21a4e5

Browse files
authored
Merge pull request #1716 from gdeleon2/make-exponential-backoff-pub
kube-runtime: make ExponentialBackoff public
2 parents 55e865c + a62f925 commit b21a4e5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

kube-runtime/src/watcher.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ pub fn watch_object<K: Resource + Clone + DeserializeOwned + Debug + Send + 'sta
883883
})
884884
}
885885

886-
struct ExponentialBackoff {
886+
pub struct ExponentialBackoff {
887887
inner: backon::ExponentialBackoff,
888888
builder: backon::ExponentialBuilder,
889889
}
@@ -921,6 +921,15 @@ impl Iterator for ExponentialBackoff {
921921
}
922922
}
923923

924+
impl From<backon::ExponentialBuilder> for ExponentialBackoff {
925+
fn from(builder: backon::ExponentialBuilder) -> Self {
926+
Self {
927+
inner: builder.build(),
928+
builder,
929+
}
930+
}
931+
}
932+
924933
/// Default watcher backoff inspired by Kubernetes' client-go.
925934
///
926935
/// The parameters currently optimize for being kind to struggling apiservers.

0 commit comments

Comments
 (0)