Skip to content

Conversation

@pepov
Copy link
Member

@pepov pepov commented Jul 24, 2023

  • Make logging.spec.watchNamespaces (explicit static list) and logging.spec.watchNamespaceSelector (label based dynamic list) additive instead of exclusive for hopefully better semantics.
  • Add tests for better coverage (looking into reusing the same thing for a different use case as well)
  • Add namespace watches and trigger reconcile on loggings with watchNamespaceSelector defined

Signed-off-by: Peter Wilcsinszky peter.wilcsinszky@axoflow.com

…tive instead of mutually exclusive

Signed-off-by: Peter Wilcsinszky <peter.wilcsinszky@axoflow.com>
@pepov
Copy link
Member Author

pepov commented Jul 24, 2023

@nak0f as we are preparing to build on top of these selectors I wanted to reconsider making the two different namespace lists additive instead of exclusive to reduce frustration of users as they have to debug through the logging resource.

also this adds a few tests to cover the behaviour

Signed-off-by: Peter Wilcsinszky <peter.wilcsinszky@axoflow.com>
@pepov pepov changed the title watchNamespaces: make the explicit and the selector based config additive instead of mutually exclusive watchNamespaces improvements Jul 24, 2023
@aslafy-z
Copy link
Collaborator

aslafy-z commented Jul 24, 2023

Another option would be to remove completely watchNamespaces and encourage users to use the kubernetes.io/metadata.name label (available since 1.22) to select by name. In this case, we may want to allow a list of selectors for watchNamespaceSelector instead of a single selector.

@pepov
Copy link
Member Author

pepov commented Jul 25, 2023

@aslafy-z sounds good (I wasn't aware of that label), but that would be a breaking change affecting lots of users, thus I would avoid it now.

Signed-off-by: Peter Wilcsinszky <peter.wilcsinszky@axoflow.com>
@aslafy-z
Copy link
Collaborator

I opened #1394 to track this enhancement proposal.

@pepov pepov requested review from ahma and siliconbrain July 25, 2023 09:01
Copy link
Contributor

@siliconbrain siliconbrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@pepov pepov merged commit a98426a into master Jul 25, 2023
@pepov pepov deleted the watch-namespaces-1 branch July 25, 2023 15:42
nak0f pushed a commit to nak0f/logging-operator that referenced this pull request Nov 22, 2023
Make logging.spec.watchNamespaces (explicit static list) and logging.spec.watchNamespaceSelector (label based dynamic list) additive instead of exclusive for hopefully better semantics.
Add tests for better coverage (looking into reusing the same thing for a different use case as well)
Add namespace watches and trigger reconcile on loggings with watchNamespaceSelector defined

Signed-off-by: Peter Wilcsinszky <peter.wilcsinszky@axoflow.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants