Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow watching cluster-scoped resources when using the multi-namespace cache #3810

Merged
merged 1 commit into from
Oct 7, 2020

Conversation

sebgl
Copy link
Contributor

@sebgl sebgl commented Oct 7, 2020

When managing resources in a single namespace, we rely on the controller-runtime
opts.Namespace feature, which implicitly allows watching cluster-scoped resources.

When managing resources in more than one namespace, we rely on opts.NewCache,
which takes a function to setup a multi-namespace cache. This cache does not
allows watching cluster-scoped resources by default. Which leads to error
when it tries to get storage classes:

cannot retrieve storage class: unable to get: /standard because of unknown namespace for the cache

This commit fixes it by ensuring we always append the empty namespace ("") to the
multi-namespace cache, so we can retrieve cluster-scoped storage classes if allowed
by the --validate-storage-class flag.

…e cache

When managing resources in a single namespace, we rely on the controller-runtime
opts.Namespace feature, which implicitly allows watching cluster-scoped resources.

When managing resources in more than one namespace, we rely on opts.NewCache,
which takes a function to setup a multi-namespace cache. This cache does not
allows watching cluster-scoped resources by default. Which leads to error
when it tries to get storage classes:

```
cannot retrieve storage class: unable to get: /standard because of unknown namespace for the cache
```

This commit fixes it by ensuring we always append the empty namespace ("") to the
multi-namespace cache, so we can retrieve cluster-scoped storage classes if allowed
by the --validate-storage-class flag.
@sebgl sebgl added >bug Something isn't working v1.3.0 labels Oct 7, 2020
@sebgl sebgl merged commit 47e553c into elastic:master Oct 7, 2020
@david-kow david-kow changed the title Allow watching cluster-scoped resources when using the multi-namespac… Allow watching cluster-scoped resources when using the multi-namespace cache Oct 26, 2020
@david-kow david-kow added the exclude-from-release-notes Exclude this PR from appearing in the release notes label Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Something isn't working exclude-from-release-notes Exclude this PR from appearing in the release notes v1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants