@@ -90,11 +90,18 @@ type CacheOptions struct {
90
90
type NewClientFunc func (config * rest.Config , options Options ) (Client , error )
91
91
92
92
// New returns a new Client using the provided config and Options.
93
- // The returned client reads *and* writes directly from the server
94
- // (it doesn't use object caches). It understands how to work with
95
- // normal types (both custom resources and aggregated/built-in resources),
96
- // as well as unstructured types.
97
93
//
94
+ // The client's read behavior is determined by Options.Cache.
95
+ // If either Options.Cache or Options.Cache.Reader is nil,
96
+ // the client reads directly from the API server.
97
+ // If both Options.Cache and Options.Cache.Reader are non-nil,
98
+ // the client reads from a local cache. However, specific
99
+ // resources can still be configured to bypass the cache based
100
+ // on Options.Cache.Unstructured and Options.Cache.DisableFor.
101
+ // Write operations are always performed directly on the API server.
102
+ //
103
+ // The client understands how to work with normal types (both custom resources
104
+ // and aggregated/built-in resources), as well as unstructured types.
98
105
// In the case of normal types, the scheme will be used to look up the
99
106
// corresponding group, version, and kind for the given type. In the
100
107
// case of unstructured types, the group, version, and kind will be extracted
@@ -210,7 +217,8 @@ func newClient(config *rest.Config, options Options) (*client, error) {
210
217
211
218
var _ Client = & client {}
212
219
213
- // client is a client.Client that reads and writes directly from/to an API server.
220
+ // client is a client.Client configured to either read from a local cache or directly from the API server.
221
+ // Write operations are always performed directly on the API server.
214
222
// It lazily initializes new clients at the time they are used.
215
223
type client struct {
216
224
typedClient typedClient
0 commit comments