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

fix: detect changes without list/watch perms on namespaces #5934

Merged
merged 1 commit into from Sep 21, 2023

Conversation

simonpasquier
Copy link
Contributor

Description

This change implements a poll-based namespace lister/watcher when the operator's service account isn't granted the list & watch permissions on all namespaces. Instead of sending a watch request, the controller will get every configured namespace every 15 seconds and sends the expected watch events when a namespace is added/updated/deleted.

It still requires the service account to be granted the get permission on the configured namespaces.

Closes #3847

Type of change

What type of changes does your code introduce to the Prometheus operator? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Changelog entry

Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.

detect changes without list/watch perms on namespaces

This change implements a poll-based namespace lister/watcher when the
operator's service account isn't granted the list & watch permissions on
all namespaces. Instead of sending a watch request, the controller will
get every configured namespace every 15 seconds and sends the expected
watch events when a namespace is added/updated/deleted.

It still requires the service account to be granted the get permission
on the configured namespaces.

Closes prometheus-operator#3847

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
@ArthurSens
Copy link
Member

Thanks for splitting this up, this one was a lot easier to review :)

@simonpasquier simonpasquier merged commit 4262cd1 into prometheus-operator:main Sep 21, 2023
17 checks passed
@simonpasquier simonpasquier deleted the fix-3847 branch September 21, 2023 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

serviceMonitorNamespaceSelector not working correctly
2 participants