Skip to content

Commit 381dc18

Browse files
aaronschweigturkenh
authored andcommitted
chore: give the exported function a comment
Signed-off-by: aaronschweig <[email protected]>
1 parent f3f63fb commit 381dc18

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

pkg/cache/defaulting_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ func TestDefaultOpts(t *testing.T) {
427427
}
428428

429429
// We cannot reference kcp.NewInformerWithClusterIndexes due to import cycle.
430-
defaulted.NewInformerFunc = nil
430+
defaulted.NewInformer = nil
431431

432432
if diff := tc.verification(defaulted); diff != "" {
433433
t.Errorf("expected config differs from actual: %s", diff)

pkg/client/interfaces.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@ package client
1818

1919
import (
2020
"context"
21-
"time"
2221

2322
apierrors "k8s.io/apimachinery/pkg/api/errors"
24-
"k8s.io/apimachinery/pkg/runtime/schema"
25-
"k8s.io/client-go/tools/cache"
26-
2723
"k8s.io/apimachinery/pkg/api/meta"
2824
"k8s.io/apimachinery/pkg/runtime"
25+
"k8s.io/apimachinery/pkg/runtime/schema"
2926
"k8s.io/apimachinery/pkg/types"
3027
"k8s.io/apimachinery/pkg/watch"
3128
)
@@ -46,10 +43,6 @@ type Patch interface {
4643
Data(obj Object) ([]byte, error)
4744
}
4845

49-
// NewInformerFunc describes a function that creates SharedIndexInformers.
50-
// Its signature matches cache.NewSharedIndexInformer from client-go.
51-
type NewInformerFunc func(cache.ListerWatcher, runtime.Object, time.Duration, cache.Indexers) cache.SharedIndexInformer
52-
5346
// TODO(directxman12): is there a sane way to deal with get/delete options?
5447

5548
// Reader knows how to read and list Kubernetes objects.

pkg/kcp/wrappers.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func NewClusterAwareCache(config *rest.Config, opts cache.Options) (cache.Cache,
7979
c := rest.CopyConfig(config)
8080
c.Host = strings.TrimSuffix(c.Host, "/") + "/clusters/*"
8181

82-
opts.NewInformerFunc = NewInformerWithClusterIndexes
82+
opts.NewInformer = NewInformerWithClusterIndexes
8383
return cache.New(c, opts)
8484
}
8585

@@ -161,6 +161,7 @@ func NewClusterAwareHTTPClient(config *rest.Config) (*http.Client, error) {
161161
return httpClient, nil
162162
}
163163

164+
// NewClusterAwareClientWithWatch returns a new WithWatch with a cluster aware client underneath.
164165
func NewClusterAwareClientWithWatch(config *rest.Config, options client.Options) (client.WithWatch, error) {
165166
opts, err := applyClientOptions(config, options)
166167
if err != nil {

0 commit comments

Comments
 (0)