diff --git a/tests/e2e-targetallocator/targetallocator-kubernetessd/00-assert.yaml b/tests/e2e-targetallocator/targetallocator-kubernetessd/00-assert.yaml index fc3f8623b7..88d16ed604 100644 --- a/tests/e2e-targetallocator/targetallocator-kubernetessd/00-assert.yaml +++ b/tests/e2e-targetallocator/targetallocator-kubernetessd/00-assert.yaml @@ -13,6 +13,9 @@ metadata: name: prometheus-kubernetessd-targetallocator --- apiVersion: v1 +kind: ConfigMap +metadata: + name: prometheus-kubernetessd-collector data: collector.yaml: | exporters: @@ -33,6 +36,11 @@ data: processors: [] receivers: - prometheus -kind: ConfigMap +--- +apiVersion: apps/v1 +kind: DaemonSet metadata: name: prometheus-kubernetessd-collector +status: + numberMisscheduled: 0 + (desiredNumberScheduled == numberReady): true diff --git a/tests/e2e-targetallocator/targetallocator-kubernetessd/chainsaw-test.yaml b/tests/e2e-targetallocator/targetallocator-kubernetessd/chainsaw-test.yaml index 8c8881d89c..8e5aae1b58 100755 --- a/tests/e2e-targetallocator/targetallocator-kubernetessd/chainsaw-test.yaml +++ b/tests/e2e-targetallocator/targetallocator-kubernetessd/chainsaw-test.yaml @@ -14,8 +14,6 @@ spec: - assert: file: 00-assert.yaml catch: - - script: - content: ./tests/e2e/smoke-daemonset/check-daemonset.sh - podLogs: selector: app.kubernetes.io/managed-by=opentelemetry-operator - name: step-01 diff --git a/tests/e2e-targetallocator/targetallocator-kubernetessd/check-daemonset.sh b/tests/e2e-targetallocator/targetallocator-kubernetessd/check-daemonset.sh deleted file mode 100755 index ae9c64b8d9..0000000000 --- a/tests/e2e-targetallocator/targetallocator-kubernetessd/check-daemonset.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# Name of the daemonset to check -DAEMONSET_NAME="prometheus-kubernetessd-collector" - -# Get the desired and ready pod counts for the daemonset -read DESIRED READY <<< $(kubectl get daemonset -n $NAMESPACE $DAEMONSET_NAME -o custom-columns=:status.desiredNumberScheduled,:status.numberReady --no-headers) - -# Check if the desired count matches the ready count -if [ "$DESIRED" -eq "$READY" ]; then - echo "Desired count ($DESIRED) matches the ready count ($READY) for $DAEMONSET_NAME." -else - echo "Desired count ($DESIRED) does not match the ready count ($READY) for $DAEMONSET_NAME." - exit 1 -fi diff --git a/tests/e2e/smoke-daemonset/00-assert.yaml b/tests/e2e/smoke-daemonset/00-assert.yaml index e38cf19ee9..d2090f3e2e 100644 --- a/tests/e2e/smoke-daemonset/00-assert.yaml +++ b/tests/e2e/smoke-daemonset/00-assert.yaml @@ -10,3 +10,4 @@ spec: type: RollingUpdate status: numberMisscheduled: 0 + (desiredNumberScheduled == numberReady): true diff --git a/tests/e2e/smoke-daemonset/chainsaw-test.yaml b/tests/e2e/smoke-daemonset/chainsaw-test.yaml old mode 100755 new mode 100644 index 2a01a5fb5e..fd1fc16417 --- a/tests/e2e/smoke-daemonset/chainsaw-test.yaml +++ b/tests/e2e/smoke-daemonset/chainsaw-test.yaml @@ -6,10 +6,7 @@ metadata: name: smoke-daemonset spec: steps: - - catch: - - script: - content: ./tests/e2e/smoke-daemonset/check-daemonset.sh - name: step-00 + - name: step-00 try: - apply: file: 00-install.yaml diff --git a/tests/e2e/smoke-daemonset/check-daemonset.sh b/tests/e2e/smoke-daemonset/check-daemonset.sh deleted file mode 100755 index 4e6c2d8062..0000000000 --- a/tests/e2e/smoke-daemonset/check-daemonset.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# Name of the daemonset to check -DAEMONSET_NAME="daemonset-test-collector" - -# Get the desired and ready pod counts for the daemonset -read DESIRED READY <<< $(kubectl get daemonset -n $NAMESPACE $DAEMONSET_NAME -o custom-columns=:status.desiredNumberScheduled,:status.numberReady --no-headers) - -# Check if the desired count matches the ready count -if [ "$DESIRED" -eq "$READY" ]; then - echo "Desired count ($DESIRED) matches the ready count ($READY) for $DAEMONSET_NAME." -else - echo "Desired count ($DESIRED) does not match the ready count ($READY) for $DAEMONSET_NAME." - exit 1 -fi