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

WATCH_NAMESPACE doesn't work for a single namespace #2589

Closed
swiatekm opened this issue Feb 1, 2024 · 2 comments
Closed

WATCH_NAMESPACE doesn't work for a single namespace #2589

swiatekm opened this issue Feb 1, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@swiatekm
Copy link
Contributor

swiatekm commented Feb 1, 2024

Component(s)

operator

What happened?

Description

Setting WATCH_NAMESPACE to a single value has no effect. Multiple values delimited by commas work.

Kubernetes Version

1.28

Operator version

0.92.0, most likely present since 0.84.0

Collector version

0.92.0

Environment information

No response

Log output

No response

Additional context

Looks like #2046 accidentally removed the second branch of a conditional instruction, and now we do nothing if the value of WATCH_NAMESPACE contains no commas. See:

if strings.Contains(watchNamespace, ",") {

@swiatekm swiatekm added bug Something isn't working needs triage and removed needs triage labels Feb 1, 2024
@davidhaja
Copy link
Contributor

I would like to work on this one.
My idea is to move the namespaces map filling, the watchNamespace splitting, and cache.Config{} creation under the found condition.

if found {
setupLog.Info("watching namespace(s)", "namespaces", watchNamespace)
} else {

@jaronoff97
Copy link
Contributor

closed by #2606

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants