mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 22:06:20 +00:00
Correctly set a namespace label in the required domain for xds routes
If an upstream is not in the default namespace, we expect DNS requests to be served over "<service-name>.ingress.<namespace>.*"
This commit is contained in:
parent
114a18e890
commit
d498a0afc9
@ -98,6 +98,7 @@ func routesFromSnapshotIngressGateway(cfgSnap *proxycfg.ConfigSnapshot) ([]proto
|
||||
continue
|
||||
}
|
||||
|
||||
namespace := u.GetEnterpriseMeta().NamespaceOrDefault()
|
||||
var domains []string
|
||||
switch {
|
||||
case len(upstreams) == 1:
|
||||
@ -110,6 +111,8 @@ func routesFromSnapshotIngressGateway(cfgSnap *proxycfg.ConfigSnapshot) ([]proto
|
||||
// If a user has specified hosts, do not add the default
|
||||
// "<service-name>.*" prefix
|
||||
domains = u.IngressHosts
|
||||
case namespace != structs.IntentionDefaultNamespace:
|
||||
domains = []string{fmt.Sprintf("%s.ingress.%s.*", chain.ServiceName, namespace)}
|
||||
default:
|
||||
domains = []string{fmt.Sprintf("%s.*", chain.ServiceName)}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user