[client-go] Add dynamic.Interface

This adds an interface form of dynamic.Client and
dynamic.ResourceClient, making those two follow the general client
conventions: `Interface` is an interface, and `Client` is the concrete
implementation.  `ClientPool` retains it's interface status.

This allows us to create a fake implemenation of dyanmic.Interface,
dynamic.ResourceInterface, and dynamic.ClientPool for testing.

Kubernetes-commit: f78d61e7c263392f31560b90c08c57765ceae482
This commit is contained in:
Solly Ross
2017-05-05 14:25:26 -04:00
committed by Kubernetes Publisher
parent 54d90de185
commit cb42486a30
3 changed files with 44 additions and 10 deletions

View File

@@ -58,7 +58,7 @@ func getObject(version, kind, name string) *unstructured.Unstructured {
}
}
func getClientServer(gv *schema.GroupVersion, h func(http.ResponseWriter, *http.Request)) (*Client, *httptest.Server, error) {
func getClientServer(gv *schema.GroupVersion, h func(http.ResponseWriter, *http.Request)) (Interface, *httptest.Server, error) {
srv := httptest.NewServer(http.HandlerFunc(h))
cl, err := NewClient(&restclient.Config{
Host: srv.URL,