Skip to content

Commit

Permalink
Add unittests for new wildcard subscription model
Browse files Browse the repository at this point in the history
Signed-off-by: Valerian Roche <valerian.roche@datadoghq.com>
  • Loading branch information
valerian-roche committed Apr 22, 2022
1 parent 4591277 commit f3652b0
Show file tree
Hide file tree
Showing 3 changed files with 245 additions and 132 deletions.
2 changes: 1 addition & 1 deletion pkg/server/delta/v3/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ func (s *server) unsubscribe(resources []string, streamState *stream.StreamState
streamState.SetWildcard(false)
continue
}
delete(sv, resource)
if _, ok := sv[resource]; ok && streamState.IsWildcard() {
// xds protocol specifically states that if a resource if unsubscribed while a wildcard watch is present,
// the control-plane must return a response with either the resource set as removed (if no longer present in the snapshot)
Expand All @@ -243,5 +242,6 @@ func (s *server) unsubscribe(resources []string, streamState *stream.StreamState
// or mark it as removed (done in createDeltaResponse)
streamState.GetResourceVersions()[resource] = ""
}
delete(sv, resource)
}
}

0 comments on commit f3652b0

Please sign in to comment.