@@ -175,7 +175,7 @@ func TestAnnotationsSingleFilter(t *testing.T) {
175
175
}
176
176
177
177
// This requires the filter to be in regex match form and not the other simpler wildcard one.
178
- annotations , err := Annotations (otelcol , []string {".bar.io" })
178
+ annotations , err := Annotations (otelcol , []string {".* bar.io" })
179
179
180
180
// verify
181
181
require .NoError (t , err )
@@ -188,10 +188,10 @@ func TestAnnotationsFilter(t *testing.T) {
188
188
otelcol := v1beta1.OpenTelemetryCollector {
189
189
ObjectMeta : metav1.ObjectMeta {
190
190
Annotations : map [string ]string {
191
- "test.bar.io" : "foo" ,
192
- "test.otel.io " : "true " ,
193
- "test.io/port " : "1234 " ,
194
- "test.io/path " : "/test " ,
191
+ "test.bar.io" : "foo" ,
192
+ "test.io/port " : "1234 " ,
193
+ "test.io/path " : "/test " ,
194
+ "config.otel.test/filter " : "true " ,
195
195
},
196
196
},
197
197
Spec : v1beta1.OpenTelemetryCollectorSpec {
@@ -200,12 +200,13 @@ func TestAnnotationsFilter(t *testing.T) {
200
200
}
201
201
202
202
// This requires the filter to be in regex match form and not the other simpler wildcard one.
203
- annotations , err := Annotations (otelcol , []string {".bar.io" , "otel.io " })
203
+ annotations , err := Annotations (otelcol , []string {".* bar.io" , ".*otel/io" , "config.*otel.test.* " })
204
204
205
205
// verify
206
206
require .NoError (t , err )
207
207
assert .Len (t , annotations , 6 )
208
208
assert .NotContains (t , annotations , "test.bar.io" )
209
- assert .NotContains (t , annotations , "test.otel.io" )
209
+ assert .NotContains (t , annotations , "test.otel/io" )
210
+ assert .NotContains (t , annotations , "config.otel.test/filter" )
210
211
assert .Equal (t , "1234" , annotations ["test.io/port" ])
211
212
}
0 commit comments