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 <[email protected]>
  • Loading branch information
valerian-roche committed Jun 7, 2023
1 parent bae7684 commit 57978c5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 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
1 change: 0 additions & 1 deletion pkg/cache/v3/delta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ func TestDeltaRemoveResources(t *testing.T) {
})
require.NoError(t, c.SetSnapshot(context.Background(), key, snapshot))

snapshot := fixture.snapshot()
for _, typ := range testTypes {
t.Run(typ, func(t *testing.T) {
select {
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 57978c5

Please sign in to comment.