-
Notifications
You must be signed in to change notification settings - Fork 451
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
Annotations Filter does not Filter Annotations #3007
Comments
Taking a look at this now |
Okay, i was able to repro this,
But, I thought this is actually because it's adding in the supplied double quotes: Removing that and reapplying it:
I reapplied it and was wrong... onto some more debugging I go. |
Okay, i found the problem. It's because we escape the regex string you provide right here. This is why the unit test doesn't catch it, we don't apply it with the option pattern. Fixing this now. |
@ryanohnemus thanks for the report and the repro! I have a fix up (see above PR) that I will make sure to get merged prior to the next release. |
Awesome!! This is extremely appreciated, thank you @jaronoff97!! |
For extra confirmation, i installed a local copy of the operator with this change, followed the repro steps and it's gone now 🎉
|
Component(s)
collector
What happened?
Description
When using an annotations filter with the opentelemetry-operator the annotations are not actually being filtered out in the Deployment that is created.
Steps to Reproduce
I setup a kind cluster using the kind-1.29.yaml included in the repo:
I then edited the otel-op.yaml to add the
--annotations-filter="config.*.gke.io.*"
arg below for the operator's Deployment:I then applied operator to the cluster and confirmed the operator pod args contained the annotations-filter above:
kubectl apply -f otel-op.yaml
Finally I added an OpenTelemetryCollector resource that has an annotation configmanagement.gke.io/token I was expecting filtered out:
The logs below show opentelemetry-operator the annotation-filter was loaded
Expected Result
The
configmanagement.gke.io/token
annotation does not make it to the collector deployment created by otel-operator.Actual Result
The
configmanagement.gke.io/token: asdfasdf
is still added to the pod template in the deployment of the collector and is still added to the pod.Kubernetes Version
1.29.0
Operator version
0.101.0
Collector version
0.101.0
Environment information
Environment
kind cluster 1.29 (already included in repo)
Log output
# OpenTelemetry Operator shows the annotation filter was loaded {"level":"INFO","timestamp":"2024-06-03T16:18:48.225161474Z","message":"Starting the OpenTelemetry Operator","opentelemetry-operator":"0.101.0","opentelemetry-collector":"ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:0.101.0","opentelemetry-targetallocator":"ghcr.io/open-telemetry/opentelemetry-operator/target-allocator:0.101.0","operator-opamp-bridge":"ghcr.io/open-telemetry/opentelemetry-operator/operator-opamp-bridge:0.101.0","auto-instrumentation-java":"ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-java:1.32.1","auto-instrumentation-nodejs":"ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-nodejs:0.51.0","auto-instrumentation-python":"ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-python:0.44b0","auto-instrumentation-dotnet":"ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-dotnet:1.2.0","auto-instrumentation-go":"ghcr.io/open-telemetry/opentelemetry-go-instrumentation/autoinstrumentation-go:v0.12.0-alpha","auto-instrumentation-apache-httpd":"ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-apache-httpd:1.0.4","auto-instrumentation-nginx":"ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-apache-httpd:1.0.4","feature-gates":"-operator.golang.flags,operator.observability.prometheus","build-date":"2024-05-29T12:23:02Z","go-version":"go1.21.10","go-arch":"amd64","go-os":"linux","labels-filter":[],"annotations-filter":["\"config.*.gke.io.*\""],"enable-multi-instrumentation":false,"enable-apache-httpd-instrumentation":true,"enable-dotnet-instrumentation":true,"enable-go-instrumentation":false,"enable-python-instrumentation":true,"enable-nginx-instrumentation":true,"enable-nodejs-instrumentation":true,"enable-java-instrumentation":true,"zap-message-key":"message","zap-level-key":"level","zap-time-key":"timestamp","zap-level-format":"uppercase"}
Additional context
No response
The text was updated successfully, but these errors were encountered: