kubernetes/pkg/kubectl/cmd
Clayton Coleman 3b780c64b8
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.
2019-11-10 21:30:36 -05:00
..
auth Always negotiate a decoder using ClientNegotiator 2019-11-10 21:30:36 -05:00
convert Minor cleanup of jsonFallbackEncoder 2019-09-22 14:05:54 +02:00
cp Always negotiate a decoder using ClientNegotiator 2019-11-10 21:30:36 -05:00
plugin/testdata Update test data to reflect code move to staging 2019-08-01 15:17:53 -07:00
BUILD Moves kubectl get subcommand to staging 2019-10-29 15:51:00 -07:00
cmd_test.go Update test data to reflect code move to staging 2019-08-01 15:17:53 -07:00
cmd.go Moves kubectl get subcommand to staging 2019-10-29 15:51:00 -07:00
profiling.go Unexport kubectl cmd profiling 2019-08-02 12:45:15 -07:00