MCPcopy
hub / github.com/grpc/grpc-go / determineTargetCSM

Function determineTargetCSM

stats/opentelemetry/csm/pluginoption.go:271–279  ·  view source on GitHub ↗
(parsedTarget *url.URL)

Source from the content-addressed store, hash-verified

269const metadataExchangeKey = "x-envoy-peer-metadata"
270
271func determineTargetCSM(parsedTarget *url.URL) bool {
272 // On the client-side, the channel target is used to determine if a channel is a
273 // CSM channel or not. CSM channels need to have an “xds” scheme and a
274 // "traffic-director-global.xds.googleapis.com" authority. In the cases where no
275 // authority is mentioned, the authority is assumed to be CSM. MetadataExchange
276 // is performed only for CSM channels. Non-metadata exchange labels are detected
277 // as described below.
278 return parsedTarget.Scheme == "xds" && (parsedTarget.Host == "" || parsedTarget.Host == "traffic-director-global.xds.googleapis.com")
279}

Callers 2

DialOptionForTargetMethod · 0.85

Calls

no outgoing calls

Tested by 1