From 484119656fe94fa6b64be000ca4f6f30691f0f12 Mon Sep 17 00:00:00 2001 From: hc-github-team-consul-core Date: Mon, 26 Feb 2024 13:36:57 -0500 Subject: [PATCH] Backport of Use correct enterprise meta on wildcard service update into release/1.16.x (#20727) * backport of commit 94a0aa2ea76384742fc39b24e0f0c9294673b4ef * backport of commit f0e1badd6f9be776f6efe5d5f80e1e52d8a8bf19 * backport of commit 183dd2fb126b1acf248f497a181db0d8f6d5ff84 --------- Co-authored-by: Sarah Alsmiller --- .changelog/_20721.txt | 3 +++ agent/consul/state/catalog.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .changelog/_20721.txt diff --git a/.changelog/_20721.txt b/.changelog/_20721.txt new file mode 100644 index 0000000000..e8f45bd280 --- /dev/null +++ b/.changelog/_20721.txt @@ -0,0 +1,3 @@ +```release-note:bug +ingress-gateway: **(Enterprise Only)** Fix a bug where on update, Ingress Gateways lost all upstreams for listeners with wildcard services in a different namespace. +``` \ No newline at end of file diff --git a/agent/consul/state/catalog.go b/agent/consul/state/catalog.go index e5778f5b61..aa11754c29 100644 --- a/agent/consul/state/catalog.go +++ b/agent/consul/state/catalog.go @@ -3557,7 +3557,7 @@ func updateGatewayServices(tx WriteTxn, idx uint64, conf structs.ConfigEntry, en for _, svc := range gatewayServices { // If the service is a wildcard we need to target all services within the namespace if svc.Service.Name == structs.WildcardSpecifier { - if err := updateGatewayNamespace(tx, idx, svc, entMeta); err != nil { + if err := updateGatewayNamespace(tx, idx, svc, &svc.Service.EnterpriseMeta); err != nil { return fmt.Errorf("failed to associate gateway %q with wildcard: %v", gateway.String(), err) } // Skip service-specific update below if there was a wildcard update