@@ -651,6 +651,10 @@ func TestOTELColValidatingWebhook(t *testing.T) {
651
651
name : "prom CR admissions warning" ,
652
652
shouldFailSar : true , // force failure
653
653
otelcol : v1beta1.OpenTelemetryCollector {
654
+ ObjectMeta : metav1.ObjectMeta {
655
+ Name : "adm-warning" ,
656
+ Namespace : "test-ns" ,
657
+ },
654
658
Spec : v1beta1.OpenTelemetryCollectorSpec {
655
659
Mode : v1beta1 .ModeStatefulSet ,
656
660
OpenTelemetryCommonFields : v1beta1.OpenTelemetryCommonFields {
@@ -693,18 +697,18 @@ func TestOTELColValidatingWebhook(t *testing.T) {
693
697
},
694
698
},
695
699
expectedWarnings : []string {
696
- "missing the following rules for monitoring.coreos.com/servicemonitors: [*]" ,
697
- "missing the following rules for monitoring.coreos.com/podmonitors: [*]" ,
698
- "missing the following rules for nodes/metrics: [get,list,watch]" ,
699
- "missing the following rules for services: [get,list,watch]" ,
700
- "missing the following rules for endpoints: [get,list,watch]" ,
701
- "missing the following rules for namespaces: [get,list,watch]" ,
702
- "missing the following rules for networking.k8s.io/ingresses: [get,list,watch]" ,
703
- "missing the following rules for nodes: [get,list,watch]" ,
704
- "missing the following rules for pods: [get,list,watch]" ,
705
- "missing the following rules for configmaps: [get]" ,
706
- "missing the following rules for discovery.k8s.io/endpointslices: [get,list,watch]" ,
707
- "missing the following rules for nonResourceURL: /metrics: [get]" ,
700
+ "missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - monitoring.coreos.com/servicemonitors: [*]" ,
701
+ "missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - monitoring.coreos.com/podmonitors: [*]" ,
702
+ "missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - nodes/metrics: [get,list,watch]" ,
703
+ "missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - services: [get,list,watch]" ,
704
+ "missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - endpoints: [get,list,watch]" ,
705
+ "missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - namespaces: [get,list,watch]" ,
706
+ "missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - networking.k8s.io/ingresses: [get,list,watch]" ,
707
+ "missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - nodes: [get,list,watch]" ,
708
+ "missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - pods: [get,list,watch]" ,
709
+ "missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - configmaps: [get]" ,
710
+ "missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - discovery.k8s.io/endpointslices: [get,list,watch]" ,
711
+ "missing the following rules for system:serviceaccount:test-ns:adm-warning-targetallocator - nonResourceURL: /metrics: [get]" ,
708
712
},
709
713
},
710
714
{
0 commit comments