open-consul/agent/structs/connect_proxy_config_oss.go
R.B. Boyer baf886c6f3
proxycfg: introduce explicit UpstreamID in lieu of bare string (#12125)
The gist here is that now we use a value-type struct proxycfg.UpstreamID
as the map key in ConfigSnapshot maps where we used to use "upstream
id-ish" strings. These are internal only and used just for bidirectional
trips through the agent cache keyspace (like the discovery chain target
struct).

For the few places where the upstream id needs to be projected into xDS,
that's what (proxycfg.UpstreamID).EnvoyID() is for. This lets us ALWAYS
inject the partition and namespace into these things without making
stuff like the golden testdata diverge.
2022-01-20 10:12:04 -06:00

19 lines
338 B
Go

//go:build !consulent
// +build !consulent
package structs
func (us *Upstream) GetEnterpriseMeta() *EnterpriseMeta {
return DefaultEnterpriseMetaInDefaultPartition()
}
func (us *Upstream) DestinationID() ServiceID {
return ServiceID{
ID: us.DestinationName,
}
}
func (us *Upstream) enterpriseStringPrefix() string {
return ""
}