Skip to content

Commit

Permalink
revert to old labels for outboundhttplabels
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce-personio committed Sep 14, 2023
1 parent 5395783 commit 9dd14cc
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions linkerd/app/outbound/src/http/concrete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use linkerd_app_core::{
Error, Infallible, NameAddr,
};
use linkerd_proxy_client_policy::FailureAccrual;
use std::{collections::BTreeMap, fmt::Debug, net::SocketAddr, sync::Arc};
use std::{fmt::Debug, net::SocketAddr, sync::Arc};
use tracing::info_span;

mod metrics;
Expand Down Expand Up @@ -342,24 +342,8 @@ where
T: svc::Param<Option<http::uri::Authority>>,
{
fn param(&self) -> OutboundEndpointLabels {
let original_labels = self.metadata.labels().clone();
// self.metadata.labels() could return Err in some cases
// if that case the dst_labels won't carry any value
let mut dst_labels = match Arc::try_unwrap(self.metadata.labels()) {
Ok(result) => result,
Err(_e) => BTreeMap::new(),
};

dst_labels.remove("pod");
dst_labels.remove("pod_template_hash");

let label_iterator = match dst_labels.is_empty() {
true => dst_labels.iter(),
false => original_labels.iter()
};

OutboundEndpointLabels {
labels: prefix_labels("dst", label_iterator),
labels: prefix_labels("dst", self.metadata.labels().iter()),
server_id: self.param(),
}
}
Expand Down

0 comments on commit 9dd14cc

Please sign in to comment.