Skip to content

Commit f66ca52

Browse files
committed
chore(app/inbound): remove Default bounds
see linkerd/linkerd2#8733 for more information. see also, #3651 #3653, and #3654 for some related pull requests. in hyper 1.x, `Incoming` bodies do not provide a `Default` implementation. compare the trait implementations here: * https://docs.rs/hyper/0.14.31/hyper/body/struct.Body.html#impl-Default-for-Body * https://docs.rs/hyper/latest/hyper/body/struct.Incoming.html#trait-implementations this commit removes `Default` bounds from policy lookup in the outbound proxy. this means that in `linkerd-app`, we can invoke `Outbound::build_policies()` when using hyper 1.x (_see #3504_) Signed-off-by: katelyn martin <[email protected]>
1 parent ea8a970 commit f66ca52

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

linkerd/app/outbound/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ impl Outbound<()> {
148148
C: tonic::client::GrpcService<tonic::body::BoxBody, Error = Error>,
149149
C: Clone + Unpin + Send + Sync + 'static,
150150
C::ResponseBody: proxy::http::Body<Data = tonic::codegen::Bytes, Error = Error>,
151-
C::ResponseBody: Default + Send + 'static,
151+
C::ResponseBody: Send + 'static,
152152
C::Future: Send,
153153
{
154154
policy::Api::new(workload, limits, Duration::from_secs(10), client)

linkerd/app/outbound/src/policy/api.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ static INVALID_POLICY: once_cell::sync::OnceCell<ClientPolicy> = once_cell::sync
3333
impl<S> Api<S>
3434
where
3535
S: tonic::client::GrpcService<tonic::body::BoxBody, Error = Error> + Clone,
36-
S::ResponseBody:
37-
http::Body<Data = tonic::codegen::Bytes, Error = Error> + Default + Send + 'static,
36+
S::ResponseBody: http::Body<Data = tonic::codegen::Bytes, Error = Error> + Send + 'static,
3837
{
3938
pub(crate) fn new(
4039
workload: Arc<str>,
@@ -59,8 +58,7 @@ impl<S> Service<Addr> for Api<S>
5958
where
6059
S: tonic::client::GrpcService<tonic::body::BoxBody, Error = Error>,
6160
S: Clone + Send + Sync + 'static,
62-
S::ResponseBody:
63-
http::Body<Data = tonic::codegen::Bytes, Error = Error> + Default + Send + 'static,
61+
S::ResponseBody: http::Body<Data = tonic::codegen::Bytes, Error = Error> + Send + 'static,
6462
S::Future: Send + 'static,
6563
{
6664
type Response =

0 commit comments

Comments
 (0)