[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.
This commit is contained in:
Solly Ross
2017-05-05 14:25:26 -04:00
parent 6b78eeca84
commit f78d61e7c2
10 changed files with 57 additions and 23 deletions

View File

@@ -97,7 +97,7 @@ type GraphBuilder struct {
ignoredResources map[schema.GroupResource]struct{}
}
func listWatcher(client *dynamic.Client, resource schema.GroupVersionResource) *cache.ListWatch {
func listWatcher(client dynamic.Interface, resource schema.GroupVersionResource) *cache.ListWatch {
return &cache.ListWatch{
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
// APIResource.Kind is not used by the dynamic client, so