Skip to content

Commit ad1b358

Browse files
authored
Remove weights from endpoint metadata (#784)
Endpoint weights are unused. This change removes weights from the metadata struct.
1 parent 104ff6c commit ad1b358

File tree

4 files changed

+1
-27
lines changed

4 files changed

+1
-27
lines changed

linkerd/app/outbound/src/http/tests.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ async fn profile_endpoint_propagates_conn_errors() {
158158
Default::default(),
159159
support::resolver::ProtocolHint::Unknown,
160160
Some(id_name.clone()),
161-
10_000,
162161
None,
163162
);
164163

@@ -268,7 +267,6 @@ async fn meshed_hello_world() {
268267
Default::default(),
269268
support::resolver::ProtocolHint::Http2,
270269
Some(id_name.clone()),
271-
10_000,
272270
None,
273271
);
274272

@@ -330,7 +328,6 @@ async fn stacks_idle_out() {
330328
Default::default(),
331329
support::resolver::ProtocolHint::Http2,
332330
Some(id_name.clone()),
333-
10_000,
334331
None,
335332
);
336333

@@ -402,7 +399,6 @@ async fn active_stacks_dont_idle_out() {
402399
Default::default(),
403400
support::resolver::ProtocolHint::Http2,
404401
Some(id_name.clone()),
405-
10_000,
406402
None,
407403
);
408404

linkerd/app/outbound/src/tcp/tests.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ async fn tls_when_hinted() {
132132
Default::default(),
133133
support::resolver::ProtocolHint::Unknown,
134134
Some(id_name),
135-
10_000,
136135
None,
137136
);
138137

@@ -190,7 +189,6 @@ async fn resolutions_are_reused() {
190189
Default::default(),
191190
support::resolver::ProtocolHint::Unknown,
192191
Some(id_name),
193-
10_000,
194192
None,
195193
);
196194

@@ -290,7 +288,6 @@ async fn load_balances() {
290288
Default::default(),
291289
support::resolver::ProtocolHint::Unknown,
292290
Some(id_name),
293-
10_000,
294291
None,
295292
);
296293

@@ -385,7 +382,6 @@ async fn load_balancer_add_endpoints() {
385382
Default::default(),
386383
support::resolver::ProtocolHint::Unknown,
387384
Some(id_name),
388-
10_000,
389385
None,
390386
);
391387

@@ -500,7 +496,6 @@ async fn load_balancer_remove_endpoints() {
500496
Default::default(),
501497
support::resolver::ProtocolHint::Unknown,
502498
Some(id_name),
503-
10_000,
504499
None,
505500
);
506501

@@ -601,7 +596,6 @@ async fn no_profiles_when_outside_search_nets() {
601596
Default::default(),
602597
support::resolver::ProtocolHint::Unknown,
603598
Some(id_name),
604-
10_000,
605599
None,
606600
);
607601

@@ -656,7 +650,6 @@ async fn no_discovery_when_profile_has_an_endpoint() {
656650
Default::default(),
657651
support::resolver::ProtocolHint::Unknown,
658652
Some(id_name.clone()),
659-
10_000,
660653
None,
661654
);
662655

@@ -710,7 +703,6 @@ async fn profile_endpoint_propagates_conn_errors() {
710703
Default::default(),
711704
support::resolver::ProtocolHint::Unknown,
712705
Some(id_name.clone()),
713-
10_000,
714706
None,
715707
);
716708

linkerd/proxy/api-resolve/src/metadata.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,6 @@ use indexmap::IndexMap;
55
/// Metadata describing an endpoint.
66
#[derive(Clone, Debug, Eq, PartialEq)]
77
pub struct Metadata {
8-
/// An endpoint's relative weight.
9-
///
10-
/// A weight of 0 means that the endpoint should never be preferred over a
11-
/// non 0-weighted endpoint.
12-
///
13-
/// The default weight, corresponding to 1.0, is 10,000. This enables us to
14-
/// specify weights as small as 0.0001 and as large as 400,000+.
15-
///
16-
/// A float is not used so that this type can implement `Eq`.
17-
weight: u32,
18-
198
/// Arbitrary endpoint labels. Primarily used for telemetry.
209
labels: IndexMap<String, String>,
2110

@@ -47,7 +36,6 @@ impl Default for Metadata {
4736
labels: IndexMap::default(),
4837
protocol_hint: ProtocolHint::Unknown,
4938
identity: None,
50-
weight: 10_000,
5139
authority_override: None,
5240
}
5341
}
@@ -58,14 +46,12 @@ impl Metadata {
5846
labels: IndexMap<String, String>,
5947
protocol_hint: ProtocolHint,
6048
identity: Option<identity::Name>,
61-
weight: u32,
6249
authority_override: Option<Authority>,
6350
) -> Self {
6451
Self {
6552
labels,
6653
protocol_hint,
6754
identity,
68-
weight,
6955
authority_override,
7056
}
7157
}

linkerd/proxy/api-resolve/src/pb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub fn to_addr_meta(
4343
}
4444

4545
let tls_id = pb.tls_identity.and_then(to_id);
46-
let meta = Metadata::new(meta, proto_hint, tls_id, pb.weight, authority_override);
46+
let meta = Metadata::new(meta, proto_hint, tls_id, authority_override);
4747
Some((addr, meta))
4848
}
4949

0 commit comments

Comments
 (0)