Skip to content

Commit 7415ca7

Browse files
authored
Merge pull request #2323 from vincepri/fix-comment
🌱 Fix comment on MultiNamespaceCache
2 parents 0d8b064 + 2c59445 commit 7415ca7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/cache/cache.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ type ByObject struct {
191191
UnsafeDisableDeepCopy *bool
192192
}
193193

194+
// NewCacheFunc - Function for creating a new cache from the options and a rest config.
195+
type NewCacheFunc func(config *rest.Config, opts Options) (Cache, error)
196+
194197
// New initializes and returns a new Cache.
195198
func New(config *rest.Config, opts Options) (Cache, error) {
196199
if len(opts.Namespaces) == 0 {

pkg/cache/multi_namespace_cache.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ import (
3131
"sigs.k8s.io/controller-runtime/pkg/client/apiutil"
3232
)
3333

34-
// NewCacheFunc - Function for creating a new cache from the options and a rest config.
35-
type NewCacheFunc func(config *rest.Config, opts Options) (Cache, error)
36-
3734
// a new global namespaced cache to handle cluster scoped resources.
3835
const globalCache = "_cluster-scope"
3936

@@ -44,7 +41,7 @@ const globalCache = "_cluster-scope"
4441
// to be used for excluding namespaces, this is better done via a Predicate. Also note that
4542
// you may face performance issues when using this with a high number of namespaces.
4643
//
47-
// Deprecated: Use cache.Options.View.Namespaces instead.
44+
// Deprecated: Use cache.Options.Namespaces instead.
4845
func MultiNamespacedCacheBuilder(namespaces []string) NewCacheFunc {
4946
return func(config *rest.Config, opts Options) (Cache, error) {
5047
opts.Namespaces = namespaces

0 commit comments

Comments
 (0)