Skip to content

Commit

Permalink
Merge pull request #2323 from vincepri/fix-comment
Browse files Browse the repository at this point in the history
🌱 Fix comment on MultiNamespaceCache
  • Loading branch information
k8s-ci-robot authored May 11, 2023
2 parents 0d8b064 + 2c59445 commit 7415ca7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 3 additions & 0 deletions pkg/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ type ByObject struct {
UnsafeDisableDeepCopy *bool
}

// NewCacheFunc - Function for creating a new cache from the options and a rest config.
type NewCacheFunc func(config *rest.Config, opts Options) (Cache, error)

// New initializes and returns a new Cache.
func New(config *rest.Config, opts Options) (Cache, error) {
if len(opts.Namespaces) == 0 {
Expand Down
5 changes: 1 addition & 4 deletions pkg/cache/multi_namespace_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client/apiutil"
)

// NewCacheFunc - Function for creating a new cache from the options and a rest config.
type NewCacheFunc func(config *rest.Config, opts Options) (Cache, error)

// a new global namespaced cache to handle cluster scoped resources.
const globalCache = "_cluster-scope"

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

0 comments on commit 7415ca7

Please sign in to comment.