mirror of https://github.com/hashicorp/consul
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>.*"pull/7678/head
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…
Reference in New Issue