-
Notifications
You must be signed in to change notification settings - Fork 450
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 is still trying to change Pod from other namespaces #2668
Comments
Could you please try to use the operator on version 0.94? It seems this issue got fixed |
I tried it, but the issue is still at the webhook when trying to mutate the pod because of the absent cache key at #2668 (comment) |
But that's interesting 🤔 It should have other cleaner ways. https://sdk.operatorframework.io/docs/building-operators/golang/operator-scope/ https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/manager#example-New-LimitToNamespaces I'll try some other approaches in the PR and get back here |
I've tried like it shows at https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/manager#example-New-LimitToNamespaces With NewCache, but no luck it is still getting unwatched namespaces for some reason. Any ideas that I can try? 🤔 |
Not an issue, we got into details at the PR #2666 |
Component(s)
No response
What happened?
Description
We have the operator installed and mapped to only a few namespaces using the WATCH_NAMESPACE env var.
In our scenario we have an app chart we have the inject config in place. The app chart is expected to be used across many different namespaces, especially in development environment.
But we are not interested in injecting with the operator in all of them since it was already restricted for a few namespaces.
The problem is that it still tries to list to namespaces that were not listed.
Initial PR: #2666
Steps to Reproduce
Our operator is deployed like:
with values.yaml
And our app chart Deployment looks like:
Expected Result
It shouldn't try to inject the otel configs for namespaces that were not listed in the WATCH_NAMESPACE.
Actual Result
The operator gets the event, tries to mutate the pod and show a error message due to a cache that was not created for the namespace. This leaves the Pod mutated but a few things looked weird on it like the service name. Like it was incompletely mutated.
Stack message:
Kubernetes Version
1.25
Operator version
0.93.0 (0.47.0 chart)
Collector version
0.93.0
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: