Commit Graph

7 Commits

Author SHA1 Message Date
Jordan Liggitt
5883a775b1 client-go metadata: plumb context
Kubernetes-commit: cb4ee9334b744404e670ea2c28a3093a3cd67844
2020-03-06 10:42:18 -05:00
Mike Danese
b136e9eb2b refactor
Kubernetes-commit: d55d6175f8e2cfdab0b79aac72046a652c2eb515
2020-01-27 18:19:44 -08:00
Clayton Coleman
9bbcc2938d Always negotiate a decoder using ClientNegotiator
This commit performs two refactors and fixes a bug.

Refactor 1 changes the signature of Request to take a RESTClient, which
removes the extra copy of everything on RESTClient from Request. A pair
of optional constructors are added for testing. The major functional
change is that Request no longer has the shim HTTPClient interface and
so some test cases change slightly because we are now going through
http.Client code paths instead of direct to our test stubs.

Refactor 2 changes the signature of RESTClient to take a
ClientContentConfig instead of ContentConfig - the primary difference
being that ClientContentConfig uses ClientNegotiator instead of
NegotiatedSerializer and the old Serializers type. We also collapse
some redundancies (like the rate limiter can be created outside the
constructor).

The bug fix is to negotiate the streaming content type on a Watch()
like we do for requests. We stop caching the decoder and simply
resolve it on the request. We also clean up the dynamic client
and remove the extra WatchSpecificVersions() method by providing
a properly wrapped dynamic client.

Kubernetes-commit: 3b780c64b89606f4e6b21f48fb9c305d5998b9e5
2019-11-10 16:52:08 -05:00
wojtekt
aebe267284 Ensure conversions are registered for metainternalversion codecs
Kubernetes-commit: 54163527a69a8c868b87d301876559495220d1b0
2019-09-11 16:30:08 +02:00
Clayton Coleman
0f7aa3096b Rename metadata.NewConfigOrDie to be consistent
Updated name to match dynamic client

Kubernetes-commit: 98d87a4f03e22bb8e4d22460855913d23930685a
2019-07-10 18:35:45 -04:00
Clayton Coleman
cade5c0473 Add fake client, informer factory, and lister to metadata client
These will be used by the garbage collector controller and others that
use higher level primitives.

Kubernetes-commit: bc89c37f32aa6cfd0f9ca975d9221d0a89320623
2019-06-05 14:28:51 -04:00
Clayton Coleman
0eaec69666 Add a metadata client to client-go that can read PartialObjectMetadata
This client exposes operations on generic metadata (get, list, watch, delete)
and allows patch operations. The client always uses protobuf and requests
the server transform the response into the appropriate object. Using this
client simplifies the work of generic controllers by allowing them to treat
all objects the same, and also improves performance both in the amount of
data sent as well as allowing protobuf on CRD resources.

Kubernetes-commit: 21f5e643d9dbe6b65d21713dc16ab8888de5423e
2019-04-02 15:45:07 -04:00