Update GatewayKeys deduplication

Federation states data is only keyed on datacenter, so it cannot be
directly compared against keys for gateway groups.
This commit is contained in:
freddygv 2021-11-01 11:23:55 -06:00
parent 90ce897456
commit e3666b0bc4
1 changed files with 5 additions and 4 deletions

View File

@ -303,12 +303,13 @@ func (c *configSnapshotMeshGateway) GatewayKeys() []GatewayKey {
}
keys := make([]GatewayKey, 0, sz)
for key := range c.GatewayGroups {
for key := range c.FedStateGateways {
keys = append(keys, gatewayKeyFromString(key))
}
for key := range c.FedStateGateways {
if _, ok := c.GatewayGroups[key]; !ok {
keys = append(keys, gatewayKeyFromString(key))
for key := range c.GatewayGroups {
gk := gatewayKeyFromString(key)
if _, ok := c.FedStateGateways[gk.Datacenter]; !ok {
keys = append(keys, gk)
}
}