Commit Graph

19 Commits

Author SHA1 Message Date
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
Sean Sullivan
e2cae23444 Update gofmt 2019-08-01 13:14:06 -07:00
Sean Sullivan
acece3c296 Update import statements to reflect code move 2019-08-01 11:15:39 -07:00
Sean Sullivan
67140f13fe Updated dependencies: BUILD/modules.txt 2019-07-18 15:43:26 -07:00
Sean Sullivan
140c62cd4c Update all imports to scheme in staging 2019-07-18 15:32:27 -07:00
WanLinghao
d4f5228b81 Add kubectl auth can-i --list option which could help users know what actions they can do in specific namespace. 2019-01-19 15:58:44 +08:00
Sean Sullivan
a20ba98b87 kubectl replace legacyscheme with kubectl scheme in two tests 2018-09-27 13:58:31 -07:00
David Eads
c85e69aeb9
remove unnecessary factory delegation for RESTClientGetter method 2018-05-28 15:12:41 +02:00
juanvallejo
5a34e4f594 remove printer helpers 2018-05-07 15:37:55 -04:00
juanvallejo
8d35f94d51
use temp kubeconfig for fake factory 2018-03-09 15:53:19 -05:00
David Eads
6047ead2e5 simplify kubectl testing factory 2018-02-23 08:02:53 -05:00
David Eads
d8a5420b7c remove unneeded factory codec methods 2018-02-21 15:20:20 -05:00
ymqytw
4487cc5e15 switch some commands to use its own scheme 2017-10-27 18:31:42 -07:00
Solly Ross
eac2049fc9 [client-go] avoid Registry in fake REST client
Previously, the fake RESTClient in client-go required a Registry.  It
used the Registry to fetch the GroupVersion for the fake client.
However, the way it did so was dubious in some cases (it hard-coded the
default API group in places), and not strictly necssary.

This updates the fake client to just recieve the GroupVersion and
internal group name directly, instead of requiring a Registry, so that
it can be consumed in unit tests where a Registry isn't necessarily
readily available (e.g. elsewhere in client-go).
2017-10-19 11:01:44 -04:00
Dr. Stefan Schimanski
7773a30f67 pkg/api/legacyscheme: fixup imports 2017-10-18 17:23:55 +02:00
yuexiao-wang
142c2dd67b Adjust the validating messages
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2017-09-21 09:58:50 +08:00
Cao Shufeng
3bf3a031e8 This change add nonResourceURL to kubectl auth cani 2017-05-31 11:25:29 +08:00
Cao Shufeng
de3db1eec3 add subresource support to kube auth can-i
Eg:
    kubectl auth can-i get pods --subresource=log
2017-05-02 12:08:20 +08:00
deads2k
5b4a611fd7 add kubectl can-i to see if you can perform an action 2017-02-23 09:12:35 -05:00