From 6376141464d24d9f39d7b3d09e7aa6a6865735b4 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Fri, 4 Feb 2022 18:51:32 -0500 Subject: [PATCH] config-entry: fix a panic when registering a service or ingress gateway --- .changelog/12277.txt | 3 +++ agent/consul/state/catalog.go | 1 + 2 files changed, 4 insertions(+) create mode 100644 .changelog/12277.txt diff --git a/.changelog/12277.txt b/.changelog/12277.txt new file mode 100644 index 000000000..7435bbb37 --- /dev/null +++ b/.changelog/12277.txt @@ -0,0 +1,3 @@ +```release-note:bug +config-entry: fix a panic when creating an ingress gateway config-entry and a proxy service instance, where both provided the same upstream and downstream mapping. +``` diff --git a/agent/consul/state/catalog.go b/agent/consul/state/catalog.go index 90657d841..7ceb98caf 100644 --- a/agent/consul/state/catalog.go +++ b/agent/consul/state/catalog.go @@ -4016,6 +4016,7 @@ func insertGatewayServiceTopologyMapping(tx WriteTxn, idx uint64, gs *structs.Ga mapping := upstreamDownstream{ Upstream: gs.Service, Downstream: gs.Gateway, + Refs: make(map[string]struct{}), RaftIndex: gs.RaftIndex, } if err := tx.Insert(tableMeshTopology, &mapping); err != nil {