Implement a FakeClient interface

Kubernetes-commit: cf26825e3d9b89526e13bb53f74354593477205c
This commit is contained in:
Markus Thömmes
2021-03-15 14:47:24 +01:00
committed by Kubernetes Publisher
parent 2ed8b30810
commit 3579fb3012
3 changed files with 75 additions and 3 deletions

View File

@@ -115,12 +115,15 @@ type dynamicResourceClient struct {
listKind string
}
var (
_ dynamic.Interface = &FakeDynamicClient{}
_ testing.FakeClient = &FakeDynamicClient{}
)
func (c *FakeDynamicClient) Tracker() testing.ObjectTracker {
return c.tracker
}
var _ dynamic.Interface = &FakeDynamicClient{}
func (c *FakeDynamicClient) Resource(resource schema.GroupVersionResource) dynamic.NamespaceableResourceInterface {
return &dynamicResourceClient{client: c, resource: resource, listKind: c.gvrToListKind[resource]}
}