Skip to content

Commit

Permalink
Reword comments on new ClientState and watch methods
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 Jun 7, 2023
1 parent bae7684 commit adc9151
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/cache/v3/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ type ClientState interface {
GetKnownResources() map[string]string

// GetSubscribedResources returns the list of resources currently subscribed to by the client for the type.
// For delta it keeps track across requests
// For sotw it is a normalized view of the request resources
// For delta it keeps track of subscription updates across requests
// For sotw it is a normalized view of the last request resources
GetSubscribedResources() map[string]struct{}

// IsWildcard returns whether the client has a wildcard watch.
Expand Down
8 changes: 4 additions & 4 deletions pkg/cache/v3/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ type DeltaResponseWatch struct {
clientState ClientState
}

// WatchesResources returns whether at least one of the resource provided is currently watch by the stream
// It is currently only applicable to delta-xds
// If the request is wildcard, it will always return true
// Otherwise it will compare the provided resources to the list of resources currently subscribed
// WatchesResources returns whether at least one of the resources provided is currently being watched by the stream.
// It is currently only applicable to delta-xds.
// If the request is wildcard, it will always return true,
// otherwise it will compare the provided resources to the list of resources currently subscribed
func (w *DeltaResponseWatch) WatchesResources(resourceNames map[string]struct{}) bool {
if w.clientState.IsWildcard() {
return true
Expand Down

0 comments on commit adc9151

Please sign in to comment.