mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
[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:
@@ -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
|
||||
|
||||
@@ -46,7 +46,7 @@ func NewRegisteredRateLimiter(resources map[schema.GroupVersionResource]struct{}
|
||||
return &RegisteredRateLimiter{rateLimiters: rateLimiters}
|
||||
}
|
||||
|
||||
func (r *RegisteredRateLimiter) registerIfNotPresent(gv schema.GroupVersion, client *dynamic.Client, prefix string) {
|
||||
func (r *RegisteredRateLimiter) registerIfNotPresent(gv schema.GroupVersion, client dynamic.Interface, prefix string) {
|
||||
once, found := r.rateLimiters[gv]
|
||||
if !found {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user