Skip to content

Commit 7a3bd1f

Browse files
committed
fix e2e test
Signed-off-by: odubajDT <[email protected]>
1 parent 8a7040b commit 7a3bd1f

File tree

2 files changed

+42
-44
lines changed

2 files changed

+42
-44
lines changed

processor/k8sattributesprocessor/e2e_test.go

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -476,27 +476,26 @@ func TestE2E_ClusterRBAC(t *testing.T) {
476476
dataType: xpipeline.SignalProfiles,
477477
service: "test-profiles-deployment",
478478
attrs: map[string]*expectedValue{
479-
"k8s.pod.name": newExpectedValue(regex, "telemetrygen-"+testID+"-profiles-deployment-[a-z0-9]*-[a-z0-9]*"),
480-
"k8s.pod.ip": newExpectedValue(exist, ""),
481-
"k8s.pod.uid": newExpectedValue(regex, uidRe),
482-
"k8s.pod.start_time": newExpectedValue(exist, ""),
483-
"k8s.node.name": newExpectedValue(exist, ""),
484-
"k8s.namespace.name": newExpectedValue(equal, testNs),
485-
"k8s.deployment.name": newExpectedValue(equal, "telemetrygen-"+testID+"-profiles-deployment"),
486-
"k8s.deployment.uid": newExpectedValue(exist, ""),
487-
"k8s.replicaset.name": newExpectedValue(regex, "telemetrygen-"+testID+"-profiles-deployment-[a-z0-9]*"),
488-
"k8s.replicaset.uid": newExpectedValue(exist, ""),
489-
"k8s.annotations.workload": newExpectedValue(equal, "deployment"),
490-
"k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-profiles-deployment"),
491-
"k8s.container.name": newExpectedValue(equal, "telemetrygen"),
492-
"k8s.cluster.uid": newExpectedValue(regex, uidRe),
493-
"container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"),
494-
"container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"),
495-
"container.image.tag": newExpectedValue(equal, "latest"),
496-
"container.id": newExpectedValue(exist, ""),
497-
"k8s.node.labels.foo": newExpectedValue(equal, "too"),
498-
"k8s.namespace.labels.foons": newExpectedValue(equal, "barns"),
499-
"simple-deployment-workload-annotation": newExpectedValue(equal, "deployment-annotation"),
479+
"k8s.pod.name": newExpectedValue(regex, "telemetrygen-"+testID+"-profiles-deployment-[a-z0-9]*-[a-z0-9]*"),
480+
"k8s.pod.ip": newExpectedValue(exist, ""),
481+
"k8s.pod.uid": newExpectedValue(regex, uidRe),
482+
"k8s.pod.start_time": newExpectedValue(exist, ""),
483+
"k8s.node.name": newExpectedValue(exist, ""),
484+
"k8s.namespace.name": newExpectedValue(equal, testNs),
485+
"k8s.deployment.name": newExpectedValue(equal, "telemetrygen-"+testID+"-profiles-deployment"),
486+
"k8s.deployment.uid": newExpectedValue(exist, ""),
487+
"k8s.replicaset.name": newExpectedValue(regex, "telemetrygen-"+testID+"-profiles-deployment-[a-z0-9]*"),
488+
"k8s.replicaset.uid": newExpectedValue(exist, ""),
489+
"k8s.annotations.workload": newExpectedValue(equal, "deployment"),
490+
"k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-profiles-deployment"),
491+
"k8s.container.name": newExpectedValue(equal, "telemetrygen"),
492+
"k8s.cluster.uid": newExpectedValue(regex, uidRe),
493+
"container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"),
494+
"container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"),
495+
"container.image.tag": newExpectedValue(equal, "latest"),
496+
"container.id": newExpectedValue(exist, ""),
497+
"k8s.node.labels.foo": newExpectedValue(equal, "too"),
498+
"k8s.namespace.labels.foons": newExpectedValue(equal, "barns"),
500499
},
501500
},
502501
{
@@ -1524,27 +1523,26 @@ func TestE2E_ClusterRBACCollectorStartAfterTelemetryGen(t *testing.T) {
15241523
dataType: xpipeline.SignalProfiles,
15251524
service: "test-profiles-deployment",
15261525
attrs: map[string]*expectedValue{
1527-
"k8s.pod.name": newExpectedValue(regex, "telemetrygen-"+testID+"-profiles-deployment-[a-z0-9]*-[a-z0-9]*"),
1528-
"k8s.pod.ip": newExpectedValue(exist, ""),
1529-
"k8s.pod.uid": newExpectedValue(regex, uidRe),
1530-
"k8s.pod.start_time": newExpectedValue(exist, ""),
1531-
"k8s.node.name": newExpectedValue(exist, ""),
1532-
"k8s.namespace.name": newExpectedValue(equal, testNs),
1533-
"k8s.deployment.name": newExpectedValue(equal, "telemetrygen-"+testID+"-profiles-deployment"),
1534-
"k8s.deployment.uid": newExpectedValue(exist, ""),
1535-
"k8s.replicaset.name": newExpectedValue(regex, "telemetrygen-"+testID+"-profiles-deployment-[a-z0-9]*"),
1536-
"k8s.replicaset.uid": newExpectedValue(exist, ""),
1537-
"k8s.annotations.workload": newExpectedValue(equal, "deployment"),
1538-
"k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-profiles-deployment"),
1539-
"k8s.container.name": newExpectedValue(equal, "telemetrygen"),
1540-
"k8s.cluster.uid": newExpectedValue(regex, uidRe),
1541-
"container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"),
1542-
"container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"),
1543-
"container.image.tag": newExpectedValue(equal, "latest"),
1544-
"container.id": newExpectedValue(exist, ""),
1545-
"k8s.node.labels.foo": newExpectedValue(equal, "too"),
1546-
"k8s.namespace.labels.foons": newExpectedValue(equal, "barns"),
1547-
"simple-deployment-workload-annotation": newExpectedValue(equal, "deployment-annotation"),
1526+
"k8s.pod.name": newExpectedValue(regex, "telemetrygen-"+testID+"-profiles-deployment-[a-z0-9]*-[a-z0-9]*"),
1527+
"k8s.pod.ip": newExpectedValue(exist, ""),
1528+
"k8s.pod.uid": newExpectedValue(regex, uidRe),
1529+
"k8s.pod.start_time": newExpectedValue(exist, ""),
1530+
"k8s.node.name": newExpectedValue(exist, ""),
1531+
"k8s.namespace.name": newExpectedValue(equal, testNs),
1532+
"k8s.deployment.name": newExpectedValue(equal, "telemetrygen-"+testID+"-profiles-deployment"),
1533+
"k8s.deployment.uid": newExpectedValue(exist, ""),
1534+
"k8s.replicaset.name": newExpectedValue(regex, "telemetrygen-"+testID+"-profiles-deployment-[a-z0-9]*"),
1535+
"k8s.replicaset.uid": newExpectedValue(exist, ""),
1536+
"k8s.annotations.workload": newExpectedValue(equal, "deployment"),
1537+
"k8s.labels.app": newExpectedValue(equal, "telemetrygen-"+testID+"-profiles-deployment"),
1538+
"k8s.container.name": newExpectedValue(equal, "telemetrygen"),
1539+
"k8s.cluster.uid": newExpectedValue(regex, uidRe),
1540+
"container.image.name": newExpectedValue(equal, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen"),
1541+
"container.image.repo_digests": newExpectedValue(regex, "ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen@sha256:[0-9a-fA-f]{64}"),
1542+
"container.image.tag": newExpectedValue(equal, "latest"),
1543+
"container.id": newExpectedValue(exist, ""),
1544+
"k8s.node.labels.foo": newExpectedValue(equal, "too"),
1545+
"k8s.namespace.labels.foons": newExpectedValue(equal, "barns"),
15481546
},
15491547
},
15501548
{

processor/k8sattributesprocessor/testdata/e2e/clusterrbac/telemetrygen/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ kind: Deployment
33
metadata:
44
name: {{ .Name }}-{{ .DataType }}-deployment
55
namespace: e2ek8sattribute-clusterrbac
6-
annotations:
7-
workload: deployment-annotation
6+
annotations:
7+
workload: deployment-annotation
88
spec:
99
replicas: 1
1010
selector:

0 commit comments

Comments
 (0)