mirror of https://github.com/hashicorp/consul
Backport of Fix namespaced peer service updates / deletes. into release/1.15.x (#17458)
* backport of commitpull/17432/headdc995c18fd
* backport of commit169a3279b6
--------- Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
parent
58806aa0a8
commit
6c7c0cf66d
|
@ -0,0 +1,3 @@
|
|||
```release-note:bug
|
||||
peering: Fix issue where modifying the list of exported services did not correctly replicate changes for services that exist in a non-default namespace.
|
||||
```
|
|
@ -282,9 +282,11 @@ func (s *Server) handleUpsertExportedServiceList(
|
|||
exportedServices[snSidecarProxy] = struct{}{}
|
||||
serviceNames = append(serviceNames, sn)
|
||||
}
|
||||
entMeta := structs.NodeEnterpriseMetaInPartition(partition)
|
||||
|
||||
_, serviceList, err := s.GetStore().ServiceList(nil, entMeta, peerName)
|
||||
// Ensure we query services from all namespaces in this partition when we perform
|
||||
// this query or else we may not propagate updates / deletes correctly.
|
||||
entMeta := acl.NewEnterpriseMetaWithPartition(partition, acl.WildcardName)
|
||||
_, serviceList, err := s.GetStore().ServiceList(nil, &entMeta, peerName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1957,7 +1957,7 @@ func processResponse_ExportedServiceUpdates(
|
|||
localEntMeta acl.EnterpriseMeta,
|
||||
peerName string,
|
||||
tests []PeeringProcessResponse_testCase,
|
||||
) {
|
||||
) *MutableStatus {
|
||||
// create a peering in the state store
|
||||
peerID := "1fabcd52-1d46-49b0-b1d8-71559aee47f5"
|
||||
require.NoError(t, store.PeeringWrite(31, &pbpeering.PeeringWriteRequest{
|
||||
|
@ -2038,6 +2038,7 @@ func processResponse_ExportedServiceUpdates(
|
|||
run(t, tc)
|
||||
})
|
||||
}
|
||||
return mst
|
||||
}
|
||||
|
||||
func Test_processResponse_ExportedServiceUpdates(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue