Browse Source

Fix peered service protocols using proxy-defaults.

pull/15251/head
Derek Menteer 2 years ago committed by Derek Menteer
parent
commit
1483c94531
  1. 10
      agent/configentry/merge_service_config.go

10
agent/configentry/merge_service_config.go

@ -173,11 +173,21 @@ func MergeServiceConfig(defaults *structs.ServiceConfigResponse, service *struct
us.MeshGateway.Mode = remoteCfg.MeshGateway.Mode
}
preMergeProtocol, found := us.Config["protocol"]
// Merge in everything else that is read from the map
if err := mergo.Merge(&us.Config, remoteCfg.Config); err != nil {
return nil, err
}
// Reset the protocol to its pre-merged version for peering upstreams.
if us.DestinationPeer != "" {
if found {
us.Config["protocol"] = preMergeProtocol
} else {
delete(us.Config, "protocol")
}
}
// Delete the mesh gateway key from opaque config since this is the value that was resolved from
// the servers and NOT the final merged value for this upstream.
// Note that we use the "mesh_gateway" key and not other variants like "MeshGateway" because

Loading…
Cancel
Save