Skip to content

Commit 20e4322

Browse files
committed
feat(tracing): Allow trace collector to be unmeshed
The proxy currently treats the trace collector endpoint as a control plane component, mostly to prevent a circular dependency in the service stack. This means that we've had to manually supply a mesh identity in the form of a service account name, usually through an extension's injector. However, this isn't strictly required as the control plane stack works just fine when the endpoint is unmeshed. This is realistically only useful for the trace collector which don't benefit much from being meshed, so this change only allows the collector to omit a mesh identity. Signed-off-by: Scott Fleener <scott@buoyant.io>
1 parent 3aa5359 commit 20e4322

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

linkerd/app/src/env.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ pub fn parse_config<S: Strings>(strings: &S) -> Result<super::Config, EnvError>
444444
let trace_protocol = strings.get(ENV_TRACE_PROTOCOL);
445445
let trace_service_name = strings.get(ENV_TRACE_SERVICE_NAME);
446446

447-
let trace_collector_addr = parse_control_addr(strings, ENV_TRACE_COLLECTOR_SVC_BASE);
447+
let trace_collector_addr = parse_optionally_named_control_addr(strings, ENV_TRACE_COLLECTOR_SVC_BASE);
448448

449449
let gateway_suffixes = parse(strings, ENV_INBOUND_GATEWAY_SUFFIXES, parse_dns_suffixes);
450450

@@ -1133,6 +1133,21 @@ pub fn parse_backoff<S: Strings>(
11331133
pub fn parse_control_addr<S: Strings>(
11341134
strings: &S,
11351135
base: &str,
1136+
) -> Result<Option<ControlAddr>, EnvError> {
1137+
parse_control_addr_inner(strings, base, false)
1138+
}
1139+
1140+
pub fn parse_optionally_named_control_addr<S: Strings>(
1141+
strings: &S,
1142+
base: &str,
1143+
) -> Result<Option<ControlAddr>, EnvError> {
1144+
parse_control_addr_inner(strings, base, true)
1145+
}
1146+
1147+
fn parse_control_addr_inner<S: Strings>(
1148+
strings: &S,
1149+
base: &str,
1150+
name_optional: bool,
11361151
) -> Result<Option<ControlAddr>, EnvError> {
11371152
let a = parse(strings, &format!("{base}_ADDR"), parse_addr)?;
11381153
let n = parse(strings, &format!("{base}_NAME"), parse_dns_name)?;
@@ -1142,6 +1157,10 @@ pub fn parse_control_addr<S: Strings>(
11421157
addr: addr.clone(),
11431158
identity: Conditional::None(tls::NoClientTls::Loopback),
11441159
})),
1160+
(Some(ref addr), None) if name_optional => Ok(Some(ControlAddr {
1161+
addr: addr.clone(),
1162+
identity: Conditional::None(tls::NoClientTls::Disabled),
1163+
})),
11451164
(Some(addr), Some(name)) => Ok(Some(ControlAddr {
11461165
addr,
11471166
identity: Conditional::Some(tls::ClientTls::new(

0 commit comments

Comments
 (0)