Skip to content

MultiNamespacedCacheBuilder is deprecated and can't be used to define the operator scope #6715

@snorwin

Description

@snorwin

What is the URL of the document?

https://sdk.operatorframework.io/docs/building-operators/golang/operator-scope/#watching-resources-in-a-set-of-namespaces

Which section(s) is the issue in?

Watching resources in a set of Namespaces

What needs fixing?

MultiNamespacedCacheBuilder is deprecated and removed since controller-runtiime v0.16.0 . It would be great if the example is updated using cache.Options.Namespace instead.

NewCache: func(config *rest.Config, opts cache.Options) (cache.Cache, error) {
	opts.DefaultNamespaces = map[string]cache.Config{
		"my-ns": cache.Config{},
	}
	return cache.New(config, opts)
},

Additional context

https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.3/pkg/cache#MultiNamespacedCacheBuilder

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/documentationCategorizes issue or PR as related to documentation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions