You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pkg/cache/v3/cache.go
+13-6Lines changed: 13 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -36,12 +36,12 @@ type Request = discovery.DiscoveryRequest
36
36
// DeltaRequest is an alias for the delta discovery request type.
37
37
typeDeltaRequest= discovery.DeltaDiscoveryRequest
38
38
39
-
// ClientState provides additional data on the client knowledge for the type matching the request
39
+
// SubscriptionState provides additional data on the client knowledge for the type matching the request
40
40
// This allows proper implementation of stateful aspects of the protocol (e.g. returning only some updated resources)
41
41
// Though the methods may return mutable parts of the state for performance reasons,
42
42
// the cache is expected to consider this state as immutable and thread safe between a watch creation and its cancellation
43
-
typeClientStateinterface {
44
-
// GetKnownResources returns the list of resources the clients has ACKed and their associated version.
43
+
typeSubscriptionStateinterface {
44
+
// GetKnownResources returns a list of resources that the client has ACK'd and their associated version.
45
45
// The versions are:
46
46
// - delta protocol: version of the specific resource set in the response
47
47
// - sotw protocol: version of the global response when the resource was last ACKed
@@ -53,8 +53,15 @@ type ClientState interface {
53
53
GetSubscribedResources() map[string]struct{}
54
54
55
55
// IsWildcard returns whether the client has a wildcard watch.
56
-
// This considers subtilities related to the current migration of wildcard definition within the protocol.
56
+
// This considers subtleties related to the current migration of wildcard definitions within the protocol.
57
+
// More details on the behavior of wildcard are present at https://www.envoyproxy.io/docs/envoy/latest/api-docs/xds_protocol#how-the-client-specifies-what-resources-to-return
57
58
IsWildcard() bool
59
+
60
+
// WatchesResources returns whether at least one of the resources provided is currently being watched by the subscription.
61
+
// It is currently only applicable to delta-xds.
62
+
// If the request is wildcard, it will always return true,
63
+
// otherwise it will compare the provided resources to the list of resources currently subscribed
0 commit comments