Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,6 @@ name = "linkerd-app"
version = "0.1.0"
dependencies = [
"futures",
"indexmap",
"ipnet",
"linkerd-app-admin",
"linkerd-app-core",
Expand Down Expand Up @@ -670,7 +669,6 @@ dependencies = [
"http",
"http-body",
"hyper",
"indexmap",
"ipnet",
"linkerd-addr",
"linkerd-cache",
Expand Down Expand Up @@ -730,7 +728,6 @@ version = "0.1.0"
dependencies = [
"futures",
"http",
"indexmap",
"linkerd-app-core",
"linkerd-app-inbound",
"linkerd-app-outbound",
Expand All @@ -752,7 +749,6 @@ dependencies = [
"futures",
"http",
"hyper",
"indexmap",
"libfuzzer-sys",
"linkerd-app-core",
"linkerd-app-test",
Expand Down Expand Up @@ -803,7 +799,6 @@ dependencies = [
"futures",
"http",
"hyper",
"indexmap",
"ipnet",
"linkerd-app-core",
"linkerd-app-test",
Expand Down Expand Up @@ -938,7 +933,6 @@ name = "linkerd-error-metrics"
version = "0.1.0"
dependencies = [
"futures",
"indexmap",
"linkerd-metrics",
"pin-project",
"tower",
Expand Down Expand Up @@ -999,7 +993,6 @@ dependencies = [
"http",
"http-body",
"hyper",
"indexmap",
"linkerd-error",
"linkerd-http-classify",
"linkerd-metrics",
Expand Down Expand Up @@ -1063,7 +1056,6 @@ dependencies = [
"hdrhistogram",
"http",
"hyper",
"indexmap",
"parking_lot",
"quickcheck",
"tokio",
Expand Down Expand Up @@ -1095,7 +1087,6 @@ dependencies = [
"futures",
"http",
"http-body",
"indexmap",
"linkerd-addr",
"linkerd-error",
"linkerd-proxy-core",
Expand Down Expand Up @@ -1165,7 +1156,6 @@ dependencies = [
"httparse",
"hyper",
"hyper-balance",
"indexmap",
"linkerd-detect",
"linkerd-duplex",
"linkerd-error",
Expand Down Expand Up @@ -1223,7 +1213,6 @@ dependencies = [
"futures",
"http",
"hyper",
"indexmap",
"ipnet",
"linkerd-conditional",
"linkerd-error",
Expand Down Expand Up @@ -1364,7 +1353,6 @@ dependencies = [
name = "linkerd-stack-metrics"
version = "0.1.0"
dependencies = [
"indexmap",
"linkerd-metrics",
"tokio",
"tower",
Expand Down
1 change: 0 additions & 1 deletion linkerd/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ allow-loopback = ["linkerd-app-outbound/allow-loopback"]

[dependencies]
futures = { version = "0.3", default-features = false }
indexmap = "1.6"
ipnet = "2.3"
linkerd-app-admin = { path = "./admin" }
linkerd-app-core = { path = "./core" }
Expand Down
1 change: 0 additions & 1 deletion linkerd/app/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ http = "0.2"
http-body = "0.4"
hyper = { version = "0.14.2", features = ["http1", "http2"] }
futures = { version = "0.3", default-features = false }
indexmap = "1.6"
ipnet = "2.3"
linkerd-addr = { path = "../../addr" }
linkerd-cache = { path = "../../cache" }
Expand Down
1 change: 0 additions & 1 deletion linkerd/app/gateway/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ publish = false
[dependencies]
http = "0.2"
futures = { version = "0.3", default-features = false }
indexmap = "1.6"
linkerd-app-core = { path = "../core" }
linkerd-app-inbound = { path = "../inbound" }
linkerd-app-outbound = { path = "../outbound" }
Expand Down
1 change: 0 additions & 1 deletion linkerd/app/inbound/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Configures and runs the inbound proxy
bytes = "1"
http = "0.2"
futures = { version = "0.3", default-features = false }
indexmap = "1.6"
linkerd-app-core = { path = "../core" }
thiserror = "1.0"
tokio = { version = "1", features = ["sync"] }
Expand Down
5 changes: 2 additions & 3 deletions linkerd/app/inbound/src/require_identity.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
use crate::target::TcpAccept;
use indexmap::IndexSet;
use linkerd_app_core::{svc::stack::Predicate, tls, Conditional, Error};
use std::sync::Arc;
use std::{collections::HashSet, sync::Arc};
use thiserror::Error;

/// A connection policy that fails connections that don't have a client identity
/// if they target one of the configured local ports.
#[derive(Clone, Debug)]
pub struct RequireIdentityForPorts {
ports: Arc<IndexSet<u16>>,
ports: Arc<HashSet<u16>>,
}

#[derive(Debug, Error)]
Expand Down
5 changes: 2 additions & 3 deletions linkerd/app/inbound/src/target.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use indexmap::IndexMap;
use linkerd_app_core::{
classify, dst, http_request_authority_addr, http_request_host_addr, identity, metrics,
profiles,
Expand Down Expand Up @@ -279,15 +278,15 @@ impl tap::Inspect for Target {
Some(self.target_addr)
}

fn dst_labels<B>(&self, _: &http::Request<B>) -> Option<&IndexMap<String, String>> {
fn dst_labels<B>(&self, _: &http::Request<B>) -> Option<&tap::Labels> {
None
}

fn dst_tls<B>(&self, _: &http::Request<B>) -> tls::ConditionalClientTls {
Conditional::None(tls::NoClientTls::Loopback)
}

fn route_labels<B>(&self, req: &http::Request<B>) -> Option<Arc<IndexMap<String, String>>> {
fn route_labels<B>(&self, req: &http::Request<B>) -> Option<Arc<tap::Labels>> {
req.extensions()
.get::<dst::Route>()
.map(|r| r.route.labels().clone())
Expand Down
1 change: 0 additions & 1 deletion linkerd/app/outbound/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ test-subscriber = []
bytes = "1"
http = "0.2"
futures = { version = "0.3", default-features = false }
indexmap = "1.6"
linkerd-app-core = { path = "../core" }
linkerd-http-retry = { path = "../../http-retry" }
linkerd-identity = { path = "../../identity" }
Expand Down
4 changes: 2 additions & 2 deletions linkerd/app/outbound/src/http/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ mod test {
opaque_protocol: false,
tls: tls::ConditionalClientTls::None(tls::NoClientTls::Disabled),
metadata: Metadata::new(
Default::default(),
None,
support::resolver::ProtocolHint::Http2,
None,
None,
Expand Down Expand Up @@ -230,7 +230,7 @@ mod test {
opaque_protocol: false,
tls: tls::ConditionalClientTls::None(tls::NoClientTls::Disabled),
metadata: Metadata::new(
Default::default(),
None,
support::resolver::ProtocolHint::Http2,
None,
None,
Expand Down
5 changes: 2 additions & 3 deletions linkerd/app/outbound/src/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ mod require_id_header;
mod server;

use crate::tcp;
use indexmap::IndexMap;
pub use linkerd_app_core::proxy::http::*;
use linkerd_app_core::{
dst,
Expand Down Expand Up @@ -173,15 +172,15 @@ impl tap::Inspect for Endpoint {
Some(self.addr.into())
}

fn dst_labels<B>(&self, _: &Request<B>) -> Option<&IndexMap<String, String>> {
fn dst_labels<B>(&self, _: &Request<B>) -> Option<&tap::Labels> {
Some(self.metadata.labels())
}

fn dst_tls<B>(&self, _: &Request<B>) -> tls::ConditionalClientTls {
self.tls.clone()
}

fn route_labels<B>(&self, req: &Request<B>) -> Option<Arc<IndexMap<String, String>>> {
fn route_labels<B>(&self, req: &Request<B>) -> Option<Arc<tap::Labels>> {
req.extensions()
.get::<dst::Route>()
.map(|r| r.route.labels().clone())
Expand Down
6 changes: 3 additions & 3 deletions linkerd/app/outbound/src/tcp/opaque_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ mod test {
};

let e = ep(Metadata::new(
Default::default(),
None,
ProtocolHint::Unknown,
Some(4143),
Some(tls::ServerId(
Expand Down Expand Up @@ -249,7 +249,7 @@ mod test {
};

let e = ep(Metadata::new(
Default::default(),
None,
ProtocolHint::Unknown,
Some(4143),
Some(tls::ServerId(
Expand Down Expand Up @@ -287,7 +287,7 @@ mod test {
};

let e = ep(Metadata::new(
Default::default(),
None,
ProtocolHint::Unknown,
Some(4143),
Some(tls::ServerId(
Expand Down
30 changes: 18 additions & 12 deletions linkerd/app/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ use crate::core::{
Addr, AddrMatch, Conditional, NameMatch,
};
use crate::{dns, gateway, identity, inbound, oc_collector, outbound};
use indexmap::IndexSet;
use std::{collections::HashMap, fs, net::SocketAddr, path::PathBuf, str::FromStr, time::Duration};
use std::{
collections::{HashMap, HashSet},
fs,
net::SocketAddr,
path::PathBuf,
str::FromStr,
time::Duration,
};
use thiserror::Error;
use tracing::{debug, error, warn};

Expand Down Expand Up @@ -703,7 +709,7 @@ impl Env {
fn parse_tap_config(
strings: &dyn Strings,
id_disabled: bool,
) -> Result<Option<(SocketAddr, IndexSet<tls::server::ClientId>)>, EnvError> {
) -> Result<Option<(SocketAddr, HashSet<tls::server::ClientId>)>, EnvError> {
let tap_identity = parse(strings, ENV_TAP_SVC_NAME, parse_identity)?;
if id_disabled {
if tap_identity.is_some() {
Expand Down Expand Up @@ -773,8 +779,8 @@ fn parse_addr(s: &str) -> Result<Addr, ParseError> {
})
}

fn parse_port_set(s: &str) -> Result<IndexSet<u16>, ParseError> {
let mut set = IndexSet::new();
fn parse_port_set(s: &str) -> Result<HashSet<u16>, ParseError> {
let mut set = HashSet::new();
for num in s.split(',') {
set.insert(parse_number::<u16>(num)?);
}
Expand Down Expand Up @@ -831,8 +837,8 @@ where
}
}

fn parse_dns_suffixes(list: &str) -> Result<IndexSet<dns::Suffix>, ParseError> {
let mut suffixes = IndexSet::new();
fn parse_dns_suffixes(list: &str) -> Result<HashSet<dns::Suffix>, ParseError> {
let mut suffixes = HashSet::new();
for item in list.split(',') {
let item = item.trim();
if !item.is_empty() {
Expand All @@ -852,8 +858,8 @@ fn parse_dns_suffix(s: &str) -> Result<dns::Suffix, ParseError> {
dns::Suffix::from_str(s).map_err(|_| ParseError::NotADomainSuffix)
}

fn parse_networks(list: &str) -> Result<IndexSet<ipnet::IpNet>, ParseError> {
let mut nets = IndexSet::new();
fn parse_networks(list: &str) -> Result<HashSet<ipnet::IpNet>, ParseError> {
let mut nets = HashSet::new();
for input in list.split(',') {
let input = input.trim();
if !input.is_empty() {
Expand Down Expand Up @@ -1186,11 +1192,11 @@ mod tests {
#[test]
fn dns_suffixes() {
fn p(s: &str) -> Result<Vec<String>, ParseError> {
let sfxs = parse_dns_suffixes(s)?
let mut sfxs = parse_dns_suffixes(s)?
.into_iter()
.map(|s| format!("{}", s))
.collect();

.collect::<Vec<_>>();
sfxs.sort();
Ok(sfxs)
}

Expand Down
5 changes: 2 additions & 3 deletions linkerd/app/src/tap.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use futures::prelude::*;
use indexmap::IndexSet;
use linkerd_app_core::{
config::ServerConfig,
drain,
Expand All @@ -11,15 +10,15 @@ use linkerd_app_core::{
transport::{listen::Bind, ClientAddr, Local, Remote, ServerAddr},
Error,
};
use std::pin::Pin;
use std::{collections::HashSet, pin::Pin};
use tower::util::{service_fn, ServiceExt};

#[derive(Clone, Debug)]
pub enum Config {
Disabled,
Enabled {
config: ServerConfig,
permitted_client_ids: IndexSet<tls::server::ClientId>,
permitted_client_ids: HashSet<tls::server::ClientId>,
},
}

Expand Down
1 change: 0 additions & 1 deletion linkerd/error-metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ publish = false

[dependencies]
futures = { version = "0.3", default-features = false }
indexmap = "1.6"
linkerd-metrics = { path = "../metrics" }
tower = { version = "0.4.7", default-features = false }
pin-project = "1"
12 changes: 7 additions & 5 deletions linkerd/error-metrics/src/layer.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
use crate::RecordError;
use indexmap::IndexMap;
use linkerd_metrics::Counter;
use std::hash::Hash;
use std::sync::{Arc, Mutex};
use std::{
collections::HashMap,
hash::Hash,
sync::{Arc, Mutex},
};

#[derive(Debug)]
pub struct RecordErrorLayer<L, K: Hash + Eq> {
label: L,
errors: Arc<Mutex<IndexMap<K, Counter>>>,
errors: Arc<Mutex<HashMap<K, Counter>>>,
}

impl<L, K: Hash + Eq> RecordErrorLayer<L, K> {
pub(crate) fn new(label: L, errors: Arc<Mutex<IndexMap<K, Counter>>>) -> Self {
pub(crate) fn new(label: L, errors: Arc<Mutex<HashMap<K, Counter>>>) -> Self {
Self { label, errors }
}
}
Expand Down
Loading