Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport of Fix namespaced peer service updates / deletes. into release/1.15.x #17458

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/17456.txt
Original file line number Diff line number Diff line change
@@ -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.
```
6 changes: 4 additions & 2 deletions agent/grpc-external/services/peerstream/replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 2 additions & 1 deletion agent/grpc-external/services/peerstream/stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -2038,6 +2038,7 @@ func processResponse_ExportedServiceUpdates(
run(t, tc)
})
}
return mst
}

func Test_processResponse_ExportedServiceUpdates(t *testing.T) {
Expand Down