diff --git a/.chainsaw.yaml b/.chainsaw.yaml index 20a9dbf07a..f001081ad5 100644 --- a/.chainsaw.yaml +++ b/.chainsaw.yaml @@ -6,7 +6,8 @@ metadata: spec: parallel: 4 timeouts: - assert: 5m0s + assert: 6m0s cleanup: 5m0s delete: 5m0s error: 5m0s + apply: 10s diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 18b2614cec..1e6336c617 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -51,7 +51,7 @@ jobs: path: bin key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Makefile') }} - name: Install chainsaw - uses: kyverno/action-install-chainsaw@v0.1.4 + uses: kyverno/action-install-chainsaw@v0.1.6 - name: Install tools run: make install-tools - name: Prepare e2e tests diff --git a/Makefile b/Makefile index ff2016a972..4772b20564 100644 --- a/Makefile +++ b/Makefile @@ -367,7 +367,7 @@ KUSTOMIZE_VERSION ?= v5.0.3 CONTROLLER_TOOLS_VERSION ?= v0.12.0 GOLANGCI_LINT_VERSION ?= v1.54.0 KIND_VERSION ?= v0.20.0 -CHAINSAW_VERSION ?= v0.1.4 +CHAINSAW_VERSION ?= v0.1.6 .PHONY: install-tools install-tools: kustomize golangci-lint kind controller-gen envtest crdoc kind operator-sdk chainsaw diff --git a/tests/e2e-autoscale/autoscale/02-install.yaml b/tests/e2e-autoscale/autoscale/02-install.yaml index 15a949ae33..6c796f3c80 100644 --- a/tests/e2e-autoscale/autoscale/02-install.yaml +++ b/tests/e2e-autoscale/autoscale/02-install.yaml @@ -15,7 +15,7 @@ spec: - --otlp-insecure # High duration to ensure the trace creation doesn't stop. # It'll be stopped in step 4 - - --duration=1m + - --duration=6m - --workers=20 - traces restartPolicy: Never diff --git a/tests/e2e-instrumentation/instrumentation-apache-httpd/chainsaw-test.yaml b/tests/e2e-instrumentation/instrumentation-apache-httpd/chainsaw-test.yaml index b630a2ddb8..d9e90d1fa8 100755 --- a/tests/e2e-instrumentation/instrumentation-apache-httpd/chainsaw-test.yaml +++ b/tests/e2e-instrumentation/instrumentation-apache-httpd/chainsaw-test.yaml @@ -4,14 +4,26 @@ kind: Test metadata: name: instrumentation-apache-httpd spec: - namespaceTemplate: - metadata: - annotations: - openshift.io/sa.scc.uid-range: 1000/1000 - openshift.io/sa.scc.supplemental-groups: 3000/1000 steps: - name: step-00 try: + # In OpenShift, when a namespace is created, all necessary SCC annotations are automatically added. However, if a namespace is created using a resource file with only selected SCCs, the other auto-added SCCs are not included. Therefore, the UID-range and supplemental groups SCC annotations must be set after the namespace is created. + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.uid-range=1000/1000 + - --overwrite + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.supplemental-groups=3000/1000 + - --overwrite - apply: file: 00-install-collector.yaml - apply: diff --git a/tests/e2e-instrumentation/instrumentation-dotnet-musl/chainsaw-test.yaml b/tests/e2e-instrumentation/instrumentation-dotnet-musl/chainsaw-test.yaml index 2e66379911..f7df95de51 100755 --- a/tests/e2e-instrumentation/instrumentation-dotnet-musl/chainsaw-test.yaml +++ b/tests/e2e-instrumentation/instrumentation-dotnet-musl/chainsaw-test.yaml @@ -5,14 +5,26 @@ metadata: creationTimestamp: null name: instrumentation-dotnet-musl spec: - namespaceTemplate: - metadata: - annotations: - openshift.io/sa.scc.uid-range: 1000/1000 - openshift.io/sa.scc.supplemental-groups: 2000/1000 steps: - name: step-00 try: + # In OpenShift, when a namespace is created, all necessary SCC annotations are automatically added. However, if a namespace is created using a resource file with only selected SCCs, the other auto-added SCCs are not included. Therefore, the UID-range and supplemental groups SCC annotations must be set after the namespace is created. + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.uid-range=1000/1000 + - --overwrite + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.supplemental-groups=2000/1000 + - --overwrite - apply: file: 00-install-collector.yaml - apply: diff --git a/tests/e2e-instrumentation/instrumentation-dotnet/chainsaw-test.yaml b/tests/e2e-instrumentation/instrumentation-dotnet/chainsaw-test.yaml index 9f6752c00c..5186e6b54d 100755 --- a/tests/e2e-instrumentation/instrumentation-dotnet/chainsaw-test.yaml +++ b/tests/e2e-instrumentation/instrumentation-dotnet/chainsaw-test.yaml @@ -5,14 +5,26 @@ metadata: creationTimestamp: null name: instrumentation-dotnet spec: - namespaceTemplate: - metadata: - annotations: - openshift.io/sa.scc.uid-range: 1000/1000 - openshift.io/sa.scc.supplemental-groups: 2000/1000 steps: - name: step-00 try: + # In OpenShift, when a namespace is created, all necessary SCC annotations are automatically added. However, if a namespace is created using a resource file with only selected SCCs, the other auto-added SCCs are not included. Therefore, the UID-range and supplemental groups SCC annotations must be set after the namespace is created. + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.uid-range=1000/1000 + - --overwrite + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.supplemental-groups=2000/1000 + - --overwrite - apply: file: 00-install-collector.yaml - apply: diff --git a/tests/e2e-instrumentation/instrumentation-go/chainsaw-test.yaml b/tests/e2e-instrumentation/instrumentation-go/chainsaw-test.yaml index 1a44d8007c..440dadc9b0 100755 --- a/tests/e2e-instrumentation/instrumentation-go/chainsaw-test.yaml +++ b/tests/e2e-instrumentation/instrumentation-go/chainsaw-test.yaml @@ -5,14 +5,26 @@ metadata: creationTimestamp: null name: instrumentation-go spec: - namespaceTemplate: - metadata: - annotations: - openshift.io/sa.scc.uid-range: 0/0 - openshift.io/sa.scc.supplemental-groups: 2000/1000 steps: - name: step-00 try: + # In OpenShift, when a namespace is created, all necessary SCC annotations are automatically added. However, if a namespace is created using a resource file with only selected SCCs, the other auto-added SCCs are not included. Therefore, the UID-range and supplemental groups SCC annotations must be set after the namespace is created. + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.uid-range=0/0 + - --overwrite + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.supplemental-groups=2000/1000 + - --overwrite - apply: file: 00-install-collector.yaml - apply: diff --git a/tests/e2e-instrumentation/instrumentation-java-other-ns/chainsaw-test.yaml b/tests/e2e-instrumentation/instrumentation-java-other-ns/chainsaw-test.yaml index 6ea738787a..046669f63e 100755 --- a/tests/e2e-instrumentation/instrumentation-java-other-ns/chainsaw-test.yaml +++ b/tests/e2e-instrumentation/instrumentation-java-other-ns/chainsaw-test.yaml @@ -5,14 +5,26 @@ metadata: creationTimestamp: null name: instrumentation-java-other-ns spec: - namespaceTemplate: - metadata: - annotations: - openshift.io/sa.scc.uid-range: 1000/1000 - openshift.io/sa.scc.supplemental-groups: 2000/1000 steps: - name: step-01 try: + # In OpenShift, when a namespace is created, all necessary SCC annotations are automatically added. However, if a namespace is created using a resource file with only selected SCCs, the other auto-added SCCs are not included. Therefore, the UID-range and supplemental groups SCC annotations must be set after the namespace is created. + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.uid-range=1000/1000 + - --overwrite + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.supplemental-groups=2000/1000 + - --overwrite - delete: ref: apiVersion: v1 diff --git a/tests/e2e-instrumentation/instrumentation-java/chainsaw-test.yaml b/tests/e2e-instrumentation/instrumentation-java/chainsaw-test.yaml index 064d020f72..5c5c78ee96 100755 --- a/tests/e2e-instrumentation/instrumentation-java/chainsaw-test.yaml +++ b/tests/e2e-instrumentation/instrumentation-java/chainsaw-test.yaml @@ -5,14 +5,26 @@ metadata: creationTimestamp: null name: instrumentation-java spec: - namespaceTemplate: - metadata: - annotations: - openshift.io/sa.scc.uid-range: 1000/1000 - openshift.io/sa.scc.supplemental-groups: 2000/1000 steps: - name: step-00 try: + # In OpenShift, when a namespace is created, all necessary SCC annotations are automatically added. However, if a namespace is created using a resource file with only selected SCCs, the other auto-added SCCs are not included. Therefore, the UID-range and supplemental groups SCC annotations must be set after the namespace is created. + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.uid-range=1000/1000 + - --overwrite + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.supplemental-groups=2000/1000 + - --overwrite - apply: file: 00-install-collector.yaml - apply: diff --git a/tests/e2e-instrumentation/instrumentation-nginx-contnr-secctx/chainsaw-test.yaml b/tests/e2e-instrumentation/instrumentation-nginx-contnr-secctx/chainsaw-test.yaml index 52ca3192b9..25eec0edef 100755 --- a/tests/e2e-instrumentation/instrumentation-nginx-contnr-secctx/chainsaw-test.yaml +++ b/tests/e2e-instrumentation/instrumentation-nginx-contnr-secctx/chainsaw-test.yaml @@ -5,14 +5,26 @@ metadata: creationTimestamp: null name: instrumentation-nginx-contnr-secctx spec: - namespaceTemplate: - metadata: - annotations: - openshift.io/sa.scc.uid-range: 1000/1000 - openshift.io/sa.scc.supplemental-groups: 3000/1000 steps: - name: step-00 try: + # In OpenShift, when a namespace is created, all necessary SCC annotations are automatically added. However, if a namespace is created using a resource file with only selected SCCs, the other auto-added SCCs are not included. Therefore, the UID-range and supplemental groups SCC annotations must be set after the namespace is created. + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.uid-range=1000/1000 + - --overwrite + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.supplemental-groups=3000/1000 + - --overwrite - apply: file: 00-install-collector.yaml - apply: diff --git a/tests/e2e-instrumentation/instrumentation-nginx-multicontainer/chainsaw-test.yaml b/tests/e2e-instrumentation/instrumentation-nginx-multicontainer/chainsaw-test.yaml index cec812a1ea..6e36075425 100755 --- a/tests/e2e-instrumentation/instrumentation-nginx-multicontainer/chainsaw-test.yaml +++ b/tests/e2e-instrumentation/instrumentation-nginx-multicontainer/chainsaw-test.yaml @@ -5,14 +5,26 @@ metadata: creationTimestamp: null name: instrumentation-nginx-multicontainer spec: - namespaceTemplate: - metadata: - annotations: - openshift.io/sa.scc.uid-range: 1000/1000 - openshift.io/sa.scc.supplemental-groups: 3000/1000 steps: - name: step-00 try: + # In OpenShift, when a namespace is created, all necessary SCC annotations are automatically added. However, if a namespace is created using a resource file with only selected SCCs, the other auto-added SCCs are not included. Therefore, the UID-range and supplemental groups SCC annotations must be set after the namespace is created. + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.uid-range=1000/1000 + - --overwrite + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.supplemental-groups=3000/1000 + - --overwrite - apply: file: 00-install-collector.yaml - apply: diff --git a/tests/e2e-instrumentation/instrumentation-nginx/chainsaw-test.yaml b/tests/e2e-instrumentation/instrumentation-nginx/chainsaw-test.yaml index d6f0073f81..0ef0f768c7 100755 --- a/tests/e2e-instrumentation/instrumentation-nginx/chainsaw-test.yaml +++ b/tests/e2e-instrumentation/instrumentation-nginx/chainsaw-test.yaml @@ -5,14 +5,26 @@ metadata: creationTimestamp: null name: instrumentation-nginx spec: - namespaceTemplate: - metadata: - annotations: - openshift.io/sa.scc.uid-range: 1000/1000 - openshift.io/sa.scc.supplemental-groups: 3000/1000 steps: - name: step-00 try: + # In OpenShift, when a namespace is created, all necessary SCC annotations are automatically added. However, if a namespace is created using a resource file with only selected SCCs, the other auto-added SCCs are not included. Therefore, the UID-range and supplemental groups SCC annotations must be set after the namespace is created. + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.uid-range=1000/1000 + - --overwrite + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.supplemental-groups=3000/1000 + - --overwrite - apply: file: 00-install-collector.yaml - apply: diff --git a/tests/e2e-instrumentation/instrumentation-nodejs/chainsaw-test.yaml b/tests/e2e-instrumentation/instrumentation-nodejs/chainsaw-test.yaml index 7595b0c448..caccbb06d8 100755 --- a/tests/e2e-instrumentation/instrumentation-nodejs/chainsaw-test.yaml +++ b/tests/e2e-instrumentation/instrumentation-nodejs/chainsaw-test.yaml @@ -5,14 +5,26 @@ metadata: creationTimestamp: null name: instrumentation-nodejs spec: - namespaceTemplate: - metadata: - annotations: - openshift.io/sa.scc.uid-range: 1000/1000 - openshift.io/sa.scc.supplemental-groups: 2000/1000 steps: - name: step-00 try: + # In OpenShift, when a namespace is created, all necessary SCC annotations are automatically added. However, if a namespace is created using a resource file with only selected SCCs, the other auto-added SCCs are not included. Therefore, the UID-range and supplemental groups SCC annotations must be set after the namespace is created. + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.uid-range=1000/1000 + - --overwrite + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.supplemental-groups=2000/1000 + - --overwrite - apply: file: 00-install-collector.yaml - apply: diff --git a/tests/e2e-instrumentation/instrumentation-python/chainsaw-test.yaml b/tests/e2e-instrumentation/instrumentation-python/chainsaw-test.yaml index d36d69d224..a47d3d949c 100755 --- a/tests/e2e-instrumentation/instrumentation-python/chainsaw-test.yaml +++ b/tests/e2e-instrumentation/instrumentation-python/chainsaw-test.yaml @@ -5,14 +5,26 @@ metadata: creationTimestamp: null name: instrumentation-python spec: - namespaceTemplate: - metadata: - annotations: - openshift.io/sa.scc.uid-range: 1000/1000 - openshift.io/sa.scc.supplemental-groups: 2000/1000 steps: - name: step-00 try: + # In OpenShift, when a namespace is created, all necessary SCC annotations are automatically added. However, if a namespace is created using a resource file with only selected SCCs, the other auto-added SCCs are not included. Therefore, the UID-range and supplemental groups SCC annotations must be set after the namespace is created. + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.uid-range=1000/1000 + - --overwrite + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.supplemental-groups=2000/1000 + - --overwrite - apply: file: 00-install-collector.yaml - apply: diff --git a/tests/e2e-instrumentation/instrumentation-sdk/chainsaw-test.yaml b/tests/e2e-instrumentation/instrumentation-sdk/chainsaw-test.yaml index e329a7ff4e..53fd6a8f3d 100755 --- a/tests/e2e-instrumentation/instrumentation-sdk/chainsaw-test.yaml +++ b/tests/e2e-instrumentation/instrumentation-sdk/chainsaw-test.yaml @@ -5,14 +5,26 @@ metadata: creationTimestamp: null name: instrumentation-sdk spec: - namespaceTemplate: - metadata: - annotations: - openshift.io/sa.scc.uid-range: 1000/1000 - openshift.io/sa.scc.supplemental-groups: 2000/1000 steps: - name: step-00 try: + # In OpenShift, when a namespace is created, all necessary SCC annotations are automatically added. However, if a namespace is created using a resource file with only selected SCCs, the other auto-added SCCs are not included. Therefore, the UID-range and supplemental groups SCC annotations must be set after the namespace is created. + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.uid-range=1000/1000 + - --overwrite + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.supplemental-groups=2000/1000 + - --overwrite - apply: file: 00-install-collector.yaml - apply: diff --git a/tests/e2e-openshift/Dockerfile b/tests/e2e-openshift/Dockerfile index 17e9b46e4b..7e775d7474 100644 --- a/tests/e2e-openshift/Dockerfile +++ b/tests/e2e-openshift/Dockerfile @@ -1,6 +1,6 @@ # The Dockerfile's resulting image is purpose-built for executing OpenTelemetry Operator e2e tests within the OpenShift release (https://github.com/openshift/release) using Prow CI. -FROM golang:1.20 +FROM golang:1.21 # Copy the repository files COPY . /tmp/opentelemetry-operator @@ -20,11 +20,14 @@ RUN mkdir -p /tmp/go/bin $GOCACHE \ # Install dependencies required by test cases and debugging RUN apt-get update && apt-get install -y jq vim libreadline-dev -# Install kuttl +# Install kuttl e2e RUN curl -LO https://github.com/kudobuilder/kuttl/releases/download/v0.15.0/kubectl-kuttl_0.15.0_linux_x86_64 \ && chmod +x kubectl-kuttl_0.15.0_linux_x86_64 \ && mv kubectl-kuttl_0.15.0_linux_x86_64 /usr/local/bin/kuttl +# Install Chainsaw e2e +RUN go install github.com/kyverno/chainsaw@v0.1.6 + # Install kubectl and oc RUN curl -LO https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/latest/openshift-client-linux.tar.gz \ && tar -xzf openshift-client-linux.tar.gz \ diff --git a/tests/e2e-openshift/kafka/00-assert.yaml b/tests/e2e-openshift/kafka/00-assert.yaml index 7474e7da98..eb25162007 100644 --- a/tests/e2e-openshift/kafka/00-assert.yaml +++ b/tests/e2e-openshift/kafka/00-assert.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Namespace metadata: - name: kuttl-kafka + name: chainsaw-kafka --- apiVersion: apps/v1 @@ -17,7 +17,7 @@ metadata: strimzi.io/kind: Kafka strimzi.io/name: my-cluster-entity-operator name: my-cluster-entity-operator - namespace: kuttl-kafka + namespace: chainsaw-kafka status: availableReplicas: 1 readyReplicas: 1 @@ -28,7 +28,7 @@ apiVersion: v1 kind: Pod metadata: name: my-cluster-kafka-0 - namespace: kuttl-kafka + namespace: chainsaw-kafka status: phase: Running @@ -37,7 +37,7 @@ apiVersion: v1 kind: Pod metadata: name: my-cluster-zookeeper-0 - namespace: kuttl-kafka + namespace: chainsaw-kafka status: phase: Running @@ -56,7 +56,7 @@ metadata: strimzi.io/kind: Kafka strimzi.io/name: my-cluster-kafka name: my-cluster-kafka-bootstrap - namespace: kuttl-kafka + namespace: chainsaw-kafka spec: ports: - name: tcp-replication @@ -90,7 +90,7 @@ metadata: strimzi.io/kind: Kafka strimzi.io/name: my-cluster-kafka name: my-cluster-kafka-brokers - namespace: kuttl-kafka + namespace: chainsaw-kafka spec: ports: - name: tcp-ctrlplane @@ -133,7 +133,7 @@ metadata: strimzi.io/kind: Kafka strimzi.io/name: my-cluster-zookeeper name: my-cluster-zookeeper-client - namespace: kuttl-kafka + namespace: chainsaw-kafka spec: ports: - name: tcp-clients @@ -159,7 +159,7 @@ metadata: strimzi.io/kind: Kafka strimzi.io/name: my-cluster-zookeeper name: my-cluster-zookeeper-nodes - namespace: kuttl-kafka + namespace: chainsaw-kafka spec: ports: - name: tcp-clients diff --git a/tests/e2e-openshift/kafka/00-create-kafka-instance.yaml b/tests/e2e-openshift/kafka/00-create-kafka-instance.yaml index 22b30c0759..a137dd3325 100644 --- a/tests/e2e-openshift/kafka/00-create-kafka-instance.yaml +++ b/tests/e2e-openshift/kafka/00-create-kafka-instance.yaml @@ -3,14 +3,14 @@ apiVersion: v1 kind: Namespace metadata: - name: kuttl-kafka + name: chainsaw-kafka --- apiVersion: kafka.strimzi.io/v1beta2 kind: Kafka metadata: name: my-cluster - namespace: kuttl-kafka + namespace: chainsaw-kafka spec: entityOperator: topicOperator: diff --git a/tests/e2e-openshift/kafka/01-assert.yaml b/tests/e2e-openshift/kafka/01-assert.yaml index eceae60c45..e76dc394a0 100644 --- a/tests/e2e-openshift/kafka/01-assert.yaml +++ b/tests/e2e-openshift/kafka/01-assert.yaml @@ -2,7 +2,7 @@ apiVersion: kafka.strimzi.io/v1beta2 kind: KafkaTopic metadata: name: otlp-spans - namespace: kuttl-kafka + namespace: chainsaw-kafka spec: config: retention.ms: 300000 diff --git a/tests/e2e-openshift/kafka/01-create-kafka-topics.yaml b/tests/e2e-openshift/kafka/01-create-kafka-topics.yaml index e7cfcc23d4..e61184cfae 100644 --- a/tests/e2e-openshift/kafka/01-create-kafka-topics.yaml +++ b/tests/e2e-openshift/kafka/01-create-kafka-topics.yaml @@ -4,7 +4,7 @@ metadata: labels: strimzi.io/cluster: my-cluster name: otlp-spans - namespace: kuttl-kafka + namespace: chainsaw-kafka spec: config: retention.ms: 300000 diff --git a/tests/e2e-openshift/kafka/02-assert.yaml b/tests/e2e-openshift/kafka/02-assert.yaml index 5fa0ca1403..4f0a38bd21 100644 --- a/tests/e2e-openshift/kafka/02-assert.yaml +++ b/tests/e2e-openshift/kafka/02-assert.yaml @@ -3,13 +3,13 @@ kind: Deployment metadata: labels: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-kafka.kafka-receiver + app.kubernetes.io/instance: chainsaw-kafka.kafka-receiver app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/name: kafka-receiver-collector app.kubernetes.io/part-of: opentelemetry app.kubernetes.io/version: latest name: kafka-receiver-collector - namespace: kuttl-kafka + namespace: chainsaw-kafka status: availableReplicas: 1 readyReplicas: 1 @@ -21,11 +21,11 @@ kind: Service metadata: labels: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-kafka.kafka-receiver + app.kubernetes.io/instance: chainsaw-kafka.kafka-receiver app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/name: kafka-receiver-collector-monitoring name: kafka-receiver-collector-monitoring - namespace: kuttl-kafka + namespace: chainsaw-kafka spec: ports: - name: monitoring @@ -34,6 +34,6 @@ spec: targetPort: 8888 selector: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-kafka.kafka-receiver + app.kubernetes.io/instance: chainsaw-kafka.kafka-receiver app.kubernetes.io/managed-by: opentelemetry-operator type: ClusterIP diff --git a/tests/e2e-openshift/kafka/02-otel-kakfa-receiver.yaml b/tests/e2e-openshift/kafka/02-otel-kakfa-receiver.yaml index 800732cefb..78cac9f400 100644 --- a/tests/e2e-openshift/kafka/02-otel-kakfa-receiver.yaml +++ b/tests/e2e-openshift/kafka/02-otel-kakfa-receiver.yaml @@ -2,13 +2,13 @@ apiVersion: opentelemetry.io/v1alpha1 kind: OpenTelemetryCollector metadata: name: kafka-receiver - namespace: kuttl-kafka + namespace: chainsaw-kafka spec: mode: "deployment" config: | receivers: kafka/traces: - brokers: ["my-cluster-kafka-brokers.kuttl-kafka.svc:9092"] + brokers: ["my-cluster-kafka-brokers.chainsaw-kafka.svc:9092"] protocol_version: 3.5.0 topic: otlp-spans exporters: diff --git a/tests/e2e-openshift/kafka/03-assert.yaml b/tests/e2e-openshift/kafka/03-assert.yaml index 6881d17302..0152057fd0 100644 --- a/tests/e2e-openshift/kafka/03-assert.yaml +++ b/tests/e2e-openshift/kafka/03-assert.yaml @@ -3,13 +3,13 @@ kind: Deployment metadata: labels: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-kafka.kafka-exporter + app.kubernetes.io/instance: chainsaw-kafka.kafka-exporter app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/name: kafka-exporter-collector app.kubernetes.io/part-of: opentelemetry app.kubernetes.io/version: latest name: kafka-exporter-collector - namespace: kuttl-kafka + namespace: chainsaw-kafka status: availableReplicas: 1 readyReplicas: 1 @@ -21,11 +21,11 @@ kind: Service metadata: labels: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-kafka.kafka-exporter + app.kubernetes.io/instance: chainsaw-kafka.kafka-exporter app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/name: kafka-exporter-collector name: kafka-exporter-collector - namespace: kuttl-kafka + namespace: chainsaw-kafka spec: ports: - appProtocol: grpc @@ -40,7 +40,7 @@ spec: targetPort: 4318 selector: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-kafka.kafka-exporter + app.kubernetes.io/instance: chainsaw-kafka.kafka-exporter app.kubernetes.io/managed-by: opentelemetry-operator sessionAffinity: None @@ -50,12 +50,12 @@ kind: Service metadata: labels: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-kafka.kafka-exporter + app.kubernetes.io/instance: chainsaw-kafka.kafka-exporter app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/name: kafka-exporter-collector operator.opentelemetry.io/collector-headless-service: Exists name: kafka-exporter-collector-headless - namespace: kuttl-kafka + namespace: chainsaw-kafka spec: ports: - appProtocol: grpc @@ -70,6 +70,6 @@ spec: targetPort: 4318 selector: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-kafka.kafka-exporter + app.kubernetes.io/instance: chainsaw-kafka.kafka-exporter app.kubernetes.io/managed-by: opentelemetry-operator type: ClusterIP diff --git a/tests/e2e-openshift/kafka/03-otel-kakfa-exporter.yaml b/tests/e2e-openshift/kafka/03-otel-kakfa-exporter.yaml index 65f1f114f5..89a11bfcfe 100644 --- a/tests/e2e-openshift/kafka/03-otel-kakfa-exporter.yaml +++ b/tests/e2e-openshift/kafka/03-otel-kakfa-exporter.yaml @@ -2,7 +2,7 @@ apiVersion: opentelemetry.io/v1alpha1 kind: OpenTelemetryCollector metadata: name: kafka-exporter - namespace: kuttl-kafka + namespace: chainsaw-kafka spec: mode: deployment config: | @@ -14,7 +14,7 @@ spec: processors: exporters: kafka/traces: - brokers: ["my-cluster-kafka-brokers.kuttl-kafka.svc:9092"] + brokers: ["my-cluster-kafka-brokers.chainsaw-kafka.svc:9092"] protocol_version: 3.5.0 topic: otlp-spans service: diff --git a/tests/e2e-openshift/kafka/04-generate-traces.yaml b/tests/e2e-openshift/kafka/04-generate-traces.yaml index ee6d823ad6..355e4c9282 100644 --- a/tests/e2e-openshift/kafka/04-generate-traces.yaml +++ b/tests/e2e-openshift/kafka/04-generate-traces.yaml @@ -15,11 +15,11 @@ spec: image: ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:v0.92.0 command: ["./telemetrygen"] args: - - "--otlp-endpoint=kafka-exporter-collector-headless.kuttl-kafka.svc:4317" + - "--otlp-endpoint=kafka-exporter-collector-headless.chainsaw-kafka.svc:4317" - "--otlp-insecure=true" - "--rate=1" - "--duration=30s" - - "--otlp-attributes=test=\"kuttl-kafka\"" + - "--otlp-attributes=test=\"chainsaw-kafka\"" - "--otlp-header=kafka-topic=\"otlp-spans\"" - "--service=\"kafka\"" - "traces" diff --git a/tests/e2e-openshift/kafka/chainsaw-test.yaml b/tests/e2e-openshift/kafka/chainsaw-test.yaml index 71932c1823..b96def245d 100755 --- a/tests/e2e-openshift/kafka/chainsaw-test.yaml +++ b/tests/e2e-openshift/kafka/chainsaw-test.yaml @@ -39,4 +39,4 @@ spec: - name: step-05 try: - script: - content: ./tests/e2e-openshift/kafka/check_traces.sh + content: ./check_traces.sh \ No newline at end of file diff --git a/tests/e2e-openshift/kafka/check_traces.sh b/tests/e2e-openshift/kafka/check_traces.sh index 05b4755d07..012beb79e1 100755 --- a/tests/e2e-openshift/kafka/check_traces.sh +++ b/tests/e2e-openshift/kafka/check_traces.sh @@ -1,15 +1,14 @@ #!/bin/bash -# This script checks the kafka-receiver OTEL collector pod for the presence of Traces. # Define the label selector -LABEL_SELECTOR="app.kubernetes.io/instance=kuttl-kafka.kafka-receiver" +LABEL_SELECTOR="app.kubernetes.io/instance=chainsaw-kafka.kafka-receiver" # Define the search strings SEARCH_STRING1='-> service.name: Str("kafka")' -SEARCH_STRING2='-> test: Str(kuttl-kafka)' +SEARCH_STRING2='-> test: Str(chainsaw-kafka)' # Get the list of pods with the specified label -PODS=$(kubectl -n kuttl-kafka get pods -l $LABEL_SELECTOR -o jsonpath='{.items[*].metadata.name}') +PODS=$(kubectl -n chainsaw-kafka get pods -l $LABEL_SELECTOR -o jsonpath='{.items[*].metadata.name}') # Initialize flags to track if strings are found FOUND1=false @@ -18,12 +17,12 @@ FOUND2=false # Loop through each pod and search for the strings in the logs for POD in $PODS; do # Search for the first string - if ! $FOUND1 && kubectl -n kuttl-kafka logs $POD | grep -q -- "$SEARCH_STRING1"; then + if ! $FOUND1 && kubectl -n chainsaw-kafka logs $POD | grep -q -- "$SEARCH_STRING1"; then echo "\"$SEARCH_STRING1\" found in $POD" FOUND1=true fi # Search for the second string - if ! $FOUND2 && kubectl -n kuttl-kafka logs $POD | grep -q -- "$SEARCH_STRING2"; then + if ! $FOUND2 && kubectl -n chainsaw-kafka logs $POD | grep -q -- "$SEARCH_STRING2"; then echo "\"$SEARCH_STRING2\" found in $POD" FOUND2=true fi @@ -31,9 +30,8 @@ done # Check if either of the strings was not found if ! $FOUND1 || ! $FOUND2; then - echo "No Traces with service name Kafka and attribute test=kuttl-kafka found." + echo "No Traces with service name Kafka and attribute test=chainsaw-kafka found." exit 1 else - echo "Traces with service name Kafka and attribute test=kuttl-kafka found." + echo "Traces with service name Kafka and attribute test=chainsaw-kafka found." fi - diff --git a/tests/e2e-openshift/monitoring/00-assert.yaml b/tests/e2e-openshift/monitoring/00-assert.yaml new file mode 100644 index 0000000000..a94fda11b2 --- /dev/null +++ b/tests/e2e-openshift/monitoring/00-assert.yaml @@ -0,0 +1,28 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: prometheus-operator + namespace: openshift-user-workload-monitoring +(status.replicas == spec.replicas): true +spec: + (replicas >= `1`): true + +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: prometheus-user-workload + namespace: openshift-user-workload-monitoring +(status.replicas == spec.replicas): true +spec: + (replicas >= `1`): true + +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: thanos-ruler-user-workload + namespace: openshift-user-workload-monitoring +(status.replicas == spec.replicas): true +spec: + (replicas >= `1`): true diff --git a/tests/e2e-openshift/monitoring/03-assert.yaml b/tests/e2e-openshift/monitoring/03-assert.yaml index 24386d9d70..508687915c 100644 --- a/tests/e2e-openshift/monitoring/03-assert.yaml +++ b/tests/e2e-openshift/monitoring/03-assert.yaml @@ -1,7 +1,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: kuttl-cluster-monitoring-metrics-api + name: chainsaw-monitoring-metrics-api rules: - apiGroups: - monitoring.coreos.com @@ -15,11 +15,11 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: kuttl-cluster-monitoring-metrics-api + name: chainsaw-monitoring-metrics-api roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: kuttl-cluster-monitoring-metrics-api + name: chainsaw-monitoring-metrics-api subjects: - kind: ServiceAccount name: prometheus-user-workload diff --git a/tests/e2e-openshift/monitoring/03-create-monitoring-roles.yaml b/tests/e2e-openshift/monitoring/03-create-monitoring-roles.yaml index 6ee5291eb3..23fd47841f 100644 --- a/tests/e2e-openshift/monitoring/03-create-monitoring-roles.yaml +++ b/tests/e2e-openshift/monitoring/03-create-monitoring-roles.yaml @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: kuttl-cluster-monitoring-metrics-api + name: chainsaw-monitoring-metrics-api rules: - apiGroups: ["monitoring.coreos.com"] resources: ["prometheuses/api"] @@ -12,11 +12,11 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: kuttl-cluster-monitoring-metrics-api + name: chainsaw-monitoring-metrics-api roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: kuttl-cluster-monitoring-metrics-api + name: chainsaw-monitoring-metrics-api subjects: - kind: ServiceAccount name: prometheus-user-workload diff --git a/tests/e2e-openshift/monitoring/chainsaw-test.yaml b/tests/e2e-openshift/monitoring/chainsaw-test.yaml index 8c527ec871..c5f0cc8dca 100755 --- a/tests/e2e-openshift/monitoring/chainsaw-test.yaml +++ b/tests/e2e-openshift/monitoring/chainsaw-test.yaml @@ -10,8 +10,8 @@ spec: try: - apply: file: 00-workload-monitoring.yaml - - script: - content: ./tests/e2e-openshift/monitoring/check_user_workload_monitoring.sh + - assert: + file: 00-assert.yaml - name: step-01 try: - apply: @@ -31,4 +31,5 @@ spec: - assert: file: 03-assert.yaml - script: - content: ./tests/e2e-openshift/monitoring/check_metrics.sh + timeout: 5m + content: ./check_metrics.sh \ No newline at end of file diff --git a/tests/e2e-openshift/monitoring/check_metrics.sh b/tests/e2e-openshift/monitoring/check_metrics.sh index 1d88c58413..8331ff8366 100755 --- a/tests/e2e-openshift/monitoring/check_metrics.sh +++ b/tests/e2e-openshift/monitoring/check_metrics.sh @@ -8,16 +8,19 @@ THANOS_QUERIER_HOST=$(oc get route thanos-querier -n openshift-monitoring -o jso metrics="otelcol_process_uptime otelcol_process_runtime_total_sys_memory_bytes otelcol_process_memory_rss otelcol_exporter_sent_spans otelcol_process_cpu_seconds otelcol_process_memory_rss otelcol_process_runtime_heap_alloc_bytes otelcol_process_runtime_total_alloc_bytes otelcol_process_runtime_total_sys_memory_bytes otelcol_process_uptime otelcol_receiver_accepted_spans otelcol_receiver_refused_spans" for metric in $metrics; do - query="$metric" +query="$metric" +count=0 - response=$(curl -k -H "Authorization: Bearer $TOKEN" -H "Content-type: application/json" "https://$THANOS_QUERIER_HOST/api/v1/query?query=$query") +# Keep fetching and checking the metrics until metrics with value is present. +while [[ $count -eq 0 ]]; do + response=$(curl -k -H "Authorization: Bearer $TOKEN" -H "Content-type: application/json" "https://$THANOS_QUERIER_HOST/api/v1/query?query=$query") + count=$(echo "$response" | jq -r '.data.result | length') - count=$(echo "$response" | jq -r '.data.result | length') - - if [[ $count -eq 0 ]]; then - echo "No metric '$metric' with value present. Exiting with status 1." - exit 1 - else + if [[ $count -eq 0 ]]; then + echo "No metric '$metric' with value present. Retrying..." + sleep 5 # Wait for 5 seconds before retrying + else echo "Metric '$metric' with value is present." - fi + fi + done done diff --git a/tests/e2e-openshift/monitoring/check_user_workload_monitoring.sh b/tests/e2e-openshift/monitoring/check_user_workload_monitoring.sh deleted file mode 100755 index 5ecaebe3df..0000000000 --- a/tests/e2e-openshift/monitoring/check_user_workload_monitoring.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -set -e - -check_replicas() { - replicas=$(oc get $1 $2 -n openshift-user-workload-monitoring -o 'jsonpath={.status.availableReplicas} {.status.readyReplicas} {.status.replicas}') - for count in $replicas; do - if [[ $count =~ ^[0-9]+$ ]]; then - if ((count < 1)); then - echo "The number of replicas is 0 for $1 $2" - exit 1 - fi - else - echo "Error: Replica count is not a valid number for $1 $2" - exit 1 - fi - done -} - -check_replicas deployment prometheus-operator -check_replicas statefulset prometheus-user-workload -check_replicas statefulset thanos-ruler-user-workload diff --git a/tests/e2e-openshift/multi-cluster/00-assert.yaml b/tests/e2e-openshift/multi-cluster/00-assert.yaml index cf530e1d45..c736b30cc7 100644 --- a/tests/e2e-openshift/multi-cluster/00-assert.yaml +++ b/tests/e2e-openshift/multi-cluster/00-assert.yaml @@ -1,13 +1,13 @@ apiVersion: project.openshift.io/v1 kind: Project metadata: - name: kuttl-multi-cluster-send + name: chainsaw-multi-cluster-send status: phase: Active apiVersion: project.openshift.io/v1 kind: Project metadata: - name: kuttl-multi-cluster-receive + name: chainsaw-multi-cluster-receive status: phase: Active diff --git a/tests/e2e-openshift/multi-cluster/00-create-namespaces.yaml b/tests/e2e-openshift/multi-cluster/00-create-namespaces.yaml index 15931a4001..7d9d8e7a50 100644 --- a/tests/e2e-openshift/multi-cluster/00-create-namespaces.yaml +++ b/tests/e2e-openshift/multi-cluster/00-create-namespaces.yaml @@ -1,10 +1,10 @@ apiVersion: v1 kind: Namespace metadata: - name: kuttl-multi-cluster-send + name: chainsaw-multi-cluster-send --- apiVersion: v1 kind: Namespace metadata: - name: kuttl-multi-cluster-receive + name: chainsaw-multi-cluster-receive diff --git a/tests/e2e-openshift/multi-cluster/01-assert.yaml b/tests/e2e-openshift/multi-cluster/01-assert.yaml index f2c8714806..8e28110509 100644 --- a/tests/e2e-openshift/multi-cluster/01-assert.yaml +++ b/tests/e2e-openshift/multi-cluster/01-assert.yaml @@ -9,7 +9,7 @@ metadata: app.kubernetes.io/name: jaeger-allinone app.kubernetes.io/part-of: jaeger name: jaeger-allinone - namespace: kuttl-multi-cluster-receive + namespace: chainsaw-multi-cluster-receive status: availableReplicas: 1 readyReplicas: 1 @@ -27,7 +27,7 @@ metadata: app.kubernetes.io/name: jaeger-allinone-collector app.kubernetes.io/part-of: jaeger name: jaeger-allinone-collector - namespace: kuttl-multi-cluster-receive + namespace: chainsaw-multi-cluster-receive spec: ports: - name: http-zipkin @@ -79,7 +79,7 @@ metadata: app.kubernetes.io/name: jaeger-allinone-query app.kubernetes.io/part-of: jaeger name: jaeger-allinone-query - namespace: kuttl-multi-cluster-receive + namespace: chainsaw-multi-cluster-receive spec: ports: - name: http-query @@ -115,7 +115,7 @@ metadata: app.kubernetes.io/name: jaeger-allinone app.kubernetes.io/part-of: jaeger name: jaeger-allinone - namespace: kuttl-multi-cluster-receive + namespace: chainsaw-multi-cluster-receive spec: port: targetPort: http-query diff --git a/tests/e2e-openshift/multi-cluster/01-create-jaeger.yaml b/tests/e2e-openshift/multi-cluster/01-create-jaeger.yaml index bac7266626..b02785b5f7 100644 --- a/tests/e2e-openshift/multi-cluster/01-create-jaeger.yaml +++ b/tests/e2e-openshift/multi-cluster/01-create-jaeger.yaml @@ -2,7 +2,7 @@ apiVersion: jaegertracing.io/v1 kind: Jaeger metadata: name: jaeger-allinone - namespace: kuttl-multi-cluster-receive + namespace: chainsaw-multi-cluster-receive spec: strategy: allinone ingress: diff --git a/tests/e2e-openshift/multi-cluster/02-assert.yaml b/tests/e2e-openshift/multi-cluster/02-assert.yaml index 9650dd59f3..7ba79cbe56 100644 --- a/tests/e2e-openshift/multi-cluster/02-assert.yaml +++ b/tests/e2e-openshift/multi-cluster/02-assert.yaml @@ -3,13 +3,13 @@ kind: Deployment metadata: labels: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-multi-cluster-receive.otlp-receiver + app.kubernetes.io/instance: chainsaw-multi-cluster-receive.otlp-receiver app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/name: otlp-receiver-collector app.kubernetes.io/part-of: opentelemetry app.kubernetes.io/version: latest name: otlp-receiver-collector - namespace: kuttl-multi-cluster-receive + namespace: chainsaw-multi-cluster-receive status: availableReplicas: 1 readyReplicas: 1 @@ -21,13 +21,13 @@ kind: Service metadata: labels: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-multi-cluster-receive.otlp-receiver + app.kubernetes.io/instance: chainsaw-multi-cluster-receive.otlp-receiver app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/name: otlp-receiver-collector app.kubernetes.io/part-of: opentelemetry app.kubernetes.io/version: latest name: otlp-receiver-collector - namespace: kuttl-multi-cluster-receive + namespace: chainsaw-multi-cluster-receive spec: ports: - appProtocol: h2c @@ -42,7 +42,7 @@ spec: targetPort: 4318 selector: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-multi-cluster-receive.otlp-receiver + app.kubernetes.io/instance: chainsaw-multi-cluster-receive.otlp-receiver app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/part-of: opentelemetry type: ClusterIP @@ -53,14 +53,14 @@ kind: Service metadata: labels: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-multi-cluster-receive.otlp-receiver + app.kubernetes.io/instance: chainsaw-multi-cluster-receive.otlp-receiver app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/name: otlp-receiver-collector app.kubernetes.io/part-of: opentelemetry app.kubernetes.io/version: latest operator.opentelemetry.io/collector-headless-service: Exists name: otlp-receiver-collector-headless - namespace: kuttl-multi-cluster-receive + namespace: chainsaw-multi-cluster-receive spec: ports: - appProtocol: h2c @@ -75,7 +75,7 @@ spec: targetPort: 4318 selector: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-multi-cluster-receive.otlp-receiver + app.kubernetes.io/instance: chainsaw-multi-cluster-receive.otlp-receiver app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/part-of: opentelemetry type: ClusterIP @@ -86,13 +86,13 @@ kind: Service metadata: labels: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-multi-cluster-receive.otlp-receiver + app.kubernetes.io/instance: chainsaw-multi-cluster-receive.otlp-receiver app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/name: otlp-receiver-collector-monitoring app.kubernetes.io/part-of: opentelemetry app.kubernetes.io/version: latest name: otlp-receiver-collector-monitoring - namespace: kuttl-multi-cluster-receive + namespace: chainsaw-multi-cluster-receive spec: ports: - name: monitoring @@ -101,7 +101,7 @@ spec: targetPort: 8888 selector: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-multi-cluster-receive.otlp-receiver + app.kubernetes.io/instance: chainsaw-multi-cluster-receive.otlp-receiver app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/part-of: opentelemetry type: ClusterIP @@ -111,11 +111,11 @@ apiVersion: route.openshift.io/v1 kind: Route metadata: labels: - app.kubernetes.io/instance: kuttl-multi-cluster-receive.otlp-receiver + app.kubernetes.io/instance: chainsaw-multi-cluster-receive.otlp-receiver app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/name: otlp-grpc-otlp-receiver-route name: otlp-grpc-otlp-receiver-route - namespace: kuttl-multi-cluster-receive + namespace: chainsaw-multi-cluster-receive spec: port: targetPort: otlp-grpc @@ -131,11 +131,11 @@ apiVersion: route.openshift.io/v1 kind: Route metadata: labels: - app.kubernetes.io/instance: kuttl-multi-cluster-receive.otlp-receiver + app.kubernetes.io/instance: chainsaw-multi-cluster-receive.otlp-receiver app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/name: otlp-http-otlp-receiver-route name: otlp-http-otlp-receiver-route - namespace: kuttl-multi-cluster-receive + namespace: chainsaw-multi-cluster-receive spec: port: targetPort: otlp-http diff --git a/tests/e2e-openshift/multi-cluster/02-otlp-receiver.yaml b/tests/e2e-openshift/multi-cluster/02-otlp-receiver.yaml index 46f39a7b89..ab493d8ea5 100644 --- a/tests/e2e-openshift/multi-cluster/02-otlp-receiver.yaml +++ b/tests/e2e-openshift/multi-cluster/02-otlp-receiver.yaml @@ -2,7 +2,7 @@ apiVersion: opentelemetry.io/v1alpha1 kind: OpenTelemetryCollector metadata: name: otlp-receiver - namespace: kuttl-multi-cluster-receive + namespace: chainsaw-multi-cluster-receive spec: config: | receivers: @@ -20,7 +20,7 @@ spec: client_ca_file: /certs/ca.crt exporters: otlp: - endpoint: "jaeger-allinone-collector.kuttl-multi-cluster-receive.svc:4317" + endpoint: "jaeger-allinone-collector.chainsaw-multi-cluster-receive.svc:4317" tls: insecure: true service: @@ -36,8 +36,8 @@ spec: mode: deployment volumeMounts: - mountPath: /certs - name: kuttl-certs + name: chainsaw-certs volumes: - configMap: - name: kuttl-certs - name: kuttl-certs + name: chainsaw-certs + name: chainsaw-certs diff --git a/tests/e2e-openshift/multi-cluster/03-assert.yaml b/tests/e2e-openshift/multi-cluster/03-assert.yaml index 8edce42aa8..bc3a130380 100644 --- a/tests/e2e-openshift/multi-cluster/03-assert.yaml +++ b/tests/e2e-openshift/multi-cluster/03-assert.yaml @@ -3,13 +3,13 @@ kind: Deployment metadata: labels: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-multi-cluster-send.otel-sender + app.kubernetes.io/instance: chainsaw-multi-cluster-send.otel-sender app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/name: otel-sender-collector app.kubernetes.io/part-of: opentelemetry app.kubernetes.io/version: latest name: otel-sender-collector - namespace: kuttl-multi-cluster-send + namespace: chainsaw-multi-cluster-send status: availableReplicas: 1 readyReplicas: 1 @@ -21,13 +21,13 @@ kind: Service metadata: labels: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-multi-cluster-send.otel-sender + app.kubernetes.io/instance: chainsaw-multi-cluster-send.otel-sender app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/name: otel-sender-collector app.kubernetes.io/part-of: opentelemetry app.kubernetes.io/version: latest name: otel-sender-collector - namespace: kuttl-multi-cluster-send + namespace: chainsaw-multi-cluster-send spec: ports: - appProtocol: grpc @@ -42,7 +42,7 @@ spec: targetPort: 4318 selector: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-multi-cluster-send.otel-sender + app.kubernetes.io/instance: chainsaw-multi-cluster-send.otel-sender app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/part-of: opentelemetry type: ClusterIP @@ -53,14 +53,14 @@ kind: Service metadata: labels: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-multi-cluster-send.otel-sender + app.kubernetes.io/instance: chainsaw-multi-cluster-send.otel-sender app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/name: otel-sender-collector app.kubernetes.io/part-of: opentelemetry app.kubernetes.io/version: latest operator.opentelemetry.io/collector-headless-service: Exists name: otel-sender-collector-headless - namespace: kuttl-multi-cluster-send + namespace: chainsaw-multi-cluster-send spec: ports: - appProtocol: grpc @@ -75,7 +75,7 @@ spec: targetPort: 4318 selector: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-multi-cluster-send.otel-sender + app.kubernetes.io/instance: chainsaw-multi-cluster-send.otel-sender app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/part-of: opentelemetry type: ClusterIP @@ -86,13 +86,13 @@ kind: Service metadata: labels: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-multi-cluster-send.otel-sender + app.kubernetes.io/instance: chainsaw-multi-cluster-send.otel-sender app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/name: otel-sender-collector-monitoring app.kubernetes.io/part-of: opentelemetry app.kubernetes.io/version: latest name: otel-sender-collector-monitoring - namespace: kuttl-multi-cluster-send + namespace: chainsaw-multi-cluster-send spec: ports: - name: monitoring @@ -101,7 +101,7 @@ spec: targetPort: 8888 selector: app.kubernetes.io/component: opentelemetry-collector - app.kubernetes.io/instance: kuttl-multi-cluster-send.otel-sender + app.kubernetes.io/instance: chainsaw-multi-cluster-send.otel-sender app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/part-of: opentelemetry type: ClusterIP diff --git a/tests/e2e-openshift/multi-cluster/03-otlp-sender.yaml b/tests/e2e-openshift/multi-cluster/03-otlp-sender.yaml index 6b561b4875..7c546407a4 100644 --- a/tests/e2e-openshift/multi-cluster/03-otlp-sender.yaml +++ b/tests/e2e-openshift/multi-cluster/03-otlp-sender.yaml @@ -1,13 +1,13 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: kuttl-multi-cluster - namespace: kuttl-multi-cluster-send + name: chainsaw-multi-cluster + namespace: chainsaw-multi-cluster-send --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: kuttl-multi-cluster + name: chainsaw-multi-cluster rules: - apiGroups: - config.openshift.io @@ -46,12 +46,12 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: kuttl-multi-cluster + name: chainsaw-multi-cluster roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: kuttl-multi-cluster + name: chainsaw-multi-cluster subjects: - kind: ServiceAccount - name: kuttl-multi-cluster - namespace: kuttl-multi-cluster-send + name: chainsaw-multi-cluster + namespace: chainsaw-multi-cluster-send diff --git a/tests/e2e-openshift/multi-cluster/04-assert.yaml b/tests/e2e-openshift/multi-cluster/04-assert.yaml index 2a2a3b6221..922508c134 100644 --- a/tests/e2e-openshift/multi-cluster/04-assert.yaml +++ b/tests/e2e-openshift/multi-cluster/04-assert.yaml @@ -2,7 +2,7 @@ apiVersion: batch/v1 kind: Job metadata: name: generate-traces-http - namespace: kuttl-multi-cluster-send + namespace: chainsaw-multi-cluster-send status: conditions: - status: "True" @@ -13,7 +13,7 @@ apiVersion: batch/v1 kind: Job metadata: name: generate-traces-grpc - namespace: kuttl-multi-cluster-send + namespace: chainsaw-multi-cluster-send status: conditions: - status: "True" diff --git a/tests/e2e-openshift/multi-cluster/04-generate-traces.yaml b/tests/e2e-openshift/multi-cluster/04-generate-traces.yaml index 945d081949..b3018c7d93 100644 --- a/tests/e2e-openshift/multi-cluster/04-generate-traces.yaml +++ b/tests/e2e-openshift/multi-cluster/04-generate-traces.yaml @@ -2,7 +2,7 @@ apiVersion: batch/v1 kind: Job metadata: name: generate-traces-http - namespace: kuttl-multi-cluster-send + namespace: chainsaw-multi-cluster-send spec: template: spec: @@ -24,7 +24,7 @@ apiVersion: batch/v1 kind: Job metadata: name: generate-traces-grpc - namespace: kuttl-multi-cluster-send + namespace: chainsaw-multi-cluster-send spec: template: spec: diff --git a/tests/e2e-openshift/multi-cluster/chainsaw-test.yaml b/tests/e2e-openshift/multi-cluster/chainsaw-test.yaml index 67cc6fc848..62a454cdf8 100755 --- a/tests/e2e-openshift/multi-cluster/chainsaw-test.yaml +++ b/tests/e2e-openshift/multi-cluster/chainsaw-test.yaml @@ -43,4 +43,5 @@ spec: - name: step-05 try: - script: - content: ./tests/e2e-openshift/multi-cluster/check_traces.sh + timeout: 5m + content: ./check_traces.sh diff --git a/tests/e2e-openshift/multi-cluster/check_traces.sh b/tests/e2e-openshift/multi-cluster/check_traces.sh index 7fe6eea518..430a96835c 100755 --- a/tests/e2e-openshift/multi-cluster/check_traces.sh +++ b/tests/e2e-openshift/multi-cluster/check_traces.sh @@ -4,23 +4,30 @@ SERVICE_NAMES=("telemetrygen-http" "telemetrygen-grpc") # Get the Jaeger URL -JAEGER_URL=$(oc -n kuttl-multi-cluster-receive get route jaeger-allinone -o json | jq '.spec.host' -r) +JAEGER_URL=$(oc -n chainsaw-multi-cluster-receive get route jaeger-allinone -o json | jq '.spec.host' -r) -# Initialize a flag to check if any trace exists -trace_exists=false +# Initialize a flag to check if traces exist for all services +all_traces_exist=false -# Loop through each service name -for SERVICE_NAME in "${SERVICE_NAMES[@]}"; do - trace_count=$(curl -ksSL "https://$JAEGER_URL/api/traces?service=$SERVICE_NAME&limit=1" | jq -r '.data | length') - if [[ $trace_count -gt 0 ]]; then - echo "Traces for $SERVICE_NAME exist in Jaeger." - trace_exists=true - else - echo "Trace for $SERVICE_NAME does not exist in Jaeger." +# Keep checking until traces exist for all services +while [[ $all_traces_exist == false ]]; do + all_traces_exist=true + + # Loop through each service name + for SERVICE_NAME in "${SERVICE_NAMES[@]}"; do + trace_count=$(curl -ksSL "https://$JAEGER_URL/api/traces?service=$SERVICE_NAME&limit=1" | jq -r '.data | length') + if [[ $trace_count -gt 0 ]]; then + echo "Traces for $SERVICE_NAME exist in Jaeger." + else + echo "Trace for $SERVICE_NAME does not exist in Jaeger." + all_traces_exist=false + fi + done + + # If traces do not exist for all services, sleep for a while before the next check + if [[ $all_traces_exist == false ]]; then + sleep 10 fi done -# Fail the test step if no traces exist for any service name -if ! $trace_exists; then - exit 1 -fi +echo "Traces exist for all service names." diff --git a/tests/e2e-openshift/multi-cluster/create_otlp_sender.sh b/tests/e2e-openshift/multi-cluster/create_otlp_sender.sh index fadb2fc8a6..03b4461c86 100755 --- a/tests/e2e-openshift/multi-cluster/create_otlp_sender.sh +++ b/tests/e2e-openshift/multi-cluster/create_otlp_sender.sh @@ -1,8 +1,8 @@ #!/bin/bash # Get the HTTP and GRPC routes from OpenTelemetry receiver collector. -otlp_route_http=$(oc -n kuttl-multi-cluster-receive get route otlp-http-otlp-receiver-route -o json | jq '.spec.host' -r) -otlp_route_grpc=$(oc -n kuttl-multi-cluster-receive get route otlp-grpc-otlp-receiver-route -o json | jq '.spec.host' -r) +otlp_route_http=$(oc -n chainsaw-multi-cluster-receive get route otlp-http-otlp-receiver-route -o json | jq '.spec.host' -r) +otlp_route_grpc=$(oc -n chainsaw-multi-cluster-receive get route otlp-grpc-otlp-receiver-route -o json | jq '.spec.host' -r) # Define the collector content collector_content=$(cat <= `1`): true + +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: prometheus-user-workload + namespace: openshift-user-workload-monitoring +(status.replicas == spec.replicas): true +spec: + (replicas >= `1`): true + +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: thanos-ruler-user-workload + namespace: openshift-user-workload-monitoring +(status.replicas == spec.replicas): true +spec: + (replicas >= `1`): true diff --git a/tests/e2e-openshift/otlp-metrics-traces/02-assert.yaml b/tests/e2e-openshift/otlp-metrics-traces/02-assert.yaml index 8315633e89..057820e934 100644 --- a/tests/e2e-openshift/otlp-metrics-traces/02-assert.yaml +++ b/tests/e2e-openshift/otlp-metrics-traces/02-assert.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - namespace: kuttl-otlp-metrics + namespace: chainsaw-otlp-metrics status: availableReplicas: 1 readyReplicas: 1 @@ -13,19 +13,19 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: labels: - app.kubernetes.io/instance: kuttl-otlp-metrics.cluster-collector + app.kubernetes.io/instance: chainsaw-otlp-metrics.cluster-collector app.kubernetes.io/managed-by: opentelemetry-operator app.kubernetes.io/name: cluster-collector-collector name: cluster-collector-collector - namespace: kuttl-otlp-metrics + namespace: chainsaw-otlp-metrics spec: endpoints: - port: monitoring - port: prometheus namespaceSelector: matchNames: - - kuttl-otlp-metrics + - chainsaw-otlp-metrics selector: matchLabels: - app.kubernetes.io/instance: kuttl-otlp-metrics.cluster-collector + app.kubernetes.io/instance: chainsaw-otlp-metrics.cluster-collector app.kubernetes.io/managed-by: opentelemetry-operator diff --git a/tests/e2e-openshift/otlp-metrics-traces/02-otel-metrics-collector.yaml b/tests/e2e-openshift/otlp-metrics-traces/02-otel-metrics-collector.yaml index 632b994457..db821a729f 100644 --- a/tests/e2e-openshift/otlp-metrics-traces/02-otel-metrics-collector.yaml +++ b/tests/e2e-openshift/otlp-metrics-traces/02-otel-metrics-collector.yaml @@ -4,7 +4,7 @@ apiVersion: opentelemetry.io/v1alpha1 kind: OpenTelemetryCollector metadata: name: cluster-collector - namespace: kuttl-otlp-metrics + namespace: chainsaw-otlp-metrics spec: mode: deployment observability: @@ -19,7 +19,7 @@ spec: processors: exporters: otlp: - endpoint: jaeger-allinone-collector-headless.kuttl-otlp-metrics.svc:4317 + endpoint: jaeger-allinone-collector-headless.chainsaw-otlp-metrics.svc:4317 tls: insecure: true prometheus: diff --git a/tests/e2e-openshift/otlp-metrics-traces/03-assert.yaml b/tests/e2e-openshift/otlp-metrics-traces/03-assert.yaml index cac0e077d1..373f553cb4 100644 --- a/tests/e2e-openshift/otlp-metrics-traces/03-assert.yaml +++ b/tests/e2e-openshift/otlp-metrics-traces/03-assert.yaml @@ -1,7 +1,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: kuttl-cluster-monitoring-metrics-api + name: chainsaw-otlp-metrics-traces-api rules: - apiGroups: - monitoring.coreos.com @@ -16,11 +16,11 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: kuttl-cluster-monitoring-metrics-api + name: chainsaw-otlp-metrics-traces-api roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: kuttl-cluster-monitoring-metrics-api + name: chainsaw-otlp-metrics-traces-api subjects: - kind: ServiceAccount name: prometheus-user-workload diff --git a/tests/e2e-openshift/otlp-metrics-traces/03-metrics-traces-gen.yaml b/tests/e2e-openshift/otlp-metrics-traces/03-metrics-traces-gen.yaml index 54ce83354e..6483cd9216 100644 --- a/tests/e2e-openshift/otlp-metrics-traces/03-metrics-traces-gen.yaml +++ b/tests/e2e-openshift/otlp-metrics-traces/03-metrics-traces-gen.yaml @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: kuttl-cluster-monitoring-metrics-api + name: chainsaw-otlp-metrics-traces-api rules: - apiGroups: ["monitoring.coreos.com"] resources: ["prometheuses/api"] @@ -12,11 +12,11 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: kuttl-cluster-monitoring-metrics-api + name: chainsaw-otlp-metrics-traces-api roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: kuttl-cluster-monitoring-metrics-api + name: chainsaw-otlp-metrics-traces-api subjects: - kind: ServiceAccount name: prometheus-user-workload @@ -40,7 +40,7 @@ spec: image: ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:v0.92.0 command: ["./telemetrygen"] args: - - "--otlp-endpoint=cluster-collector-collector-headless.kuttl-otlp-metrics.svc:4317" + - "--otlp-endpoint=cluster-collector-collector-headless.chainsaw-otlp-metrics.svc:4317" - "--otlp-insecure=true" - "--rate=1" - "--duration=30s" @@ -67,7 +67,7 @@ spec: image: ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:v0.92.0 command: ["./telemetrygen"] args: - - "--otlp-endpoint=cluster-collector-collector-headless.kuttl-otlp-metrics.svc:4317" + - "--otlp-endpoint=cluster-collector-collector-headless.chainsaw-otlp-metrics.svc:4317" - "--otlp-insecure=true" - "--duration=30s" - "--rate=1" diff --git a/tests/e2e-openshift/otlp-metrics-traces/chainsaw-test.yaml b/tests/e2e-openshift/otlp-metrics-traces/chainsaw-test.yaml index 0c67bc4c13..ef331179fc 100755 --- a/tests/e2e-openshift/otlp-metrics-traces/chainsaw-test.yaml +++ b/tests/e2e-openshift/otlp-metrics-traces/chainsaw-test.yaml @@ -16,8 +16,8 @@ spec: try: - apply: file: 01-workload-monitoring.yaml - - script: - content: ./tests/e2e-openshift/otlp-metrics-traces/check_user_workload_monitoring.sh + - assert: + file: 01-assert.yaml - name: step-02 try: - apply: @@ -33,8 +33,10 @@ spec: - name: step-04 try: - script: - content: ./tests/e2e-openshift/otlp-metrics-traces/check_traces.sh + timeout: 5m + content: ./check_traces.sh - name: step-05 try: - script: - content: ./tests/e2e-openshift/otlp-metrics-traces/check_metrics.sh + timeout: 5m + content: ./check_metrics.sh diff --git a/tests/e2e-openshift/otlp-metrics-traces/check_metrics.sh b/tests/e2e-openshift/otlp-metrics-traces/check_metrics.sh index dd44adc871..066a5c01e0 100755 --- a/tests/e2e-openshift/otlp-metrics-traces/check_metrics.sh +++ b/tests/e2e-openshift/otlp-metrics-traces/check_metrics.sh @@ -1,15 +1,17 @@ #!/bin/bash + SECRET=$(oc get secret -n openshift-user-workload-monitoring | grep prometheus-user-workload-token | head -n 1 | awk '{print $1}') TOKEN=$(echo $(oc get secret $SECRET -n openshift-user-workload-monitoring -o json | jq -r '.data.token') | base64 -d) THANOS_QUERIER_HOST=$(oc get route thanos-querier -n openshift-monitoring -o json | jq -r '.spec.host') -response=$(curl -k -H "Authorization: Bearer $TOKEN" -H "Content-type: application/json" "https://$THANOS_QUERIER_HOST/api/v1/query?query=gen") - -count=$(echo "$response" | jq -r '.data.result | length') +while true; do + response=$(curl -k -H "Authorization: Bearer $TOKEN" -H "Content-type: application/json" "https://$THANOS_QUERIER_HOST/api/v1/query?query=gen") + count=$(echo "$response" | jq -r '.data.result | length') -if [[ $count -eq 0 ]]; then - echo "No telemetrygen metrics count with value present. Exiting with status 1." - exit 1 -else - echo "telemetrygen metrics with value is present." -fi + if [[ $count -eq 0 ]]; then + echo "No telemetrygen metrics count with value present. Fetching again..." + else + echo "telemetrygen metrics with value is present." + break + fi +done diff --git a/tests/e2e-openshift/otlp-metrics-traces/check_traces.sh b/tests/e2e-openshift/otlp-metrics-traces/check_traces.sh index 9761284aee..87f8dfb594 100755 --- a/tests/e2e-openshift/otlp-metrics-traces/check_traces.sh +++ b/tests/e2e-openshift/otlp-metrics-traces/check_traces.sh @@ -1,12 +1,15 @@ #!/bin/bash -JAEGER_URL=$(oc -n kuttl-otlp-metrics get route jaeger-allinone -o json | jq '.spec.host' -r) + +JAEGER_URL=$(oc -n chainsaw-otlp-metrics get route jaeger-allinone -o json | jq '.spec.host' -r) SERVICE_NAME="telemetrygen" -trace_exists=$(curl -ksSL "https://$JAEGER_URL/api/traces?service=$SERVICE_NAME&limit=1" | jq -r '.data | length') +while true; do + trace_exists=$(curl -ksSL "https://$JAEGER_URL/api/traces?service=$SERVICE_NAME&limit=1" | jq -r '.data | length') -if [[ $trace_exists -gt 0 ]]; then - echo "Traces for $SERVICE_NAME exist in Jaeger." -else - echo "Trace for $SERVICE_NAME does not exist in Jaeger." - exit 1 # Fail the test step if the trace doesn't exist -fi + if [[ $trace_exists -gt 0 ]]; then + echo "Traces for $SERVICE_NAME exist in Jaeger." + break + else + echo "Trace for $SERVICE_NAME does not exist in Jaeger. Fetching again..." + fi +done diff --git a/tests/e2e-openshift/otlp-metrics-traces/check_user_workload_monitoring.sh b/tests/e2e-openshift/otlp-metrics-traces/check_user_workload_monitoring.sh deleted file mode 100755 index 5ecaebe3df..0000000000 --- a/tests/e2e-openshift/otlp-metrics-traces/check_user_workload_monitoring.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -set -e - -check_replicas() { - replicas=$(oc get $1 $2 -n openshift-user-workload-monitoring -o 'jsonpath={.status.availableReplicas} {.status.readyReplicas} {.status.replicas}') - for count in $replicas; do - if [[ $count =~ ^[0-9]+$ ]]; then - if ((count < 1)); then - echo "The number of replicas is 0 for $1 $2" - exit 1 - fi - else - echo "Error: Replica count is not a valid number for $1 $2" - exit 1 - fi - done -} - -check_replicas deployment prometheus-operator -check_replicas statefulset prometheus-user-workload -check_replicas statefulset thanos-ruler-user-workload diff --git a/tests/e2e-prometheuscr/create-sm-prometheus-exporters/chainsaw-test.yaml b/tests/e2e-prometheuscr/create-sm-prometheus-exporters/chainsaw-test.yaml index affed8f745..efdef46a69 100755 --- a/tests/e2e-prometheuscr/create-sm-prometheus-exporters/chainsaw-test.yaml +++ b/tests/e2e-prometheuscr/create-sm-prometheus-exporters/chainsaw-test.yaml @@ -56,7 +56,7 @@ spec: kind: OpenTelemetryCollector name: simplest namespace: create-sm-prometheus - - apply: + - error: file: 07-error.yaml - name: step-08 try: diff --git a/tests/e2e-targetallocator/targetallocator-features/chainsaw-test.yaml b/tests/e2e-targetallocator/targetallocator-features/chainsaw-test.yaml index 555326724d..c72307fc1b 100755 --- a/tests/e2e-targetallocator/targetallocator-features/chainsaw-test.yaml +++ b/tests/e2e-targetallocator/targetallocator-features/chainsaw-test.yaml @@ -5,14 +5,26 @@ metadata: creationTimestamp: null name: targetallocator-features spec: - namespaceTemplate: - metadata: - annotations: - openshift.io/sa.scc.uid-range: 1000/1000 - openshift.io/sa.scc.supplemental-groups: 3000/1000 steps: - name: step-00 try: + # In OpenShift, when a namespace is created, all necessary SCC annotations are automatically added. However, if a namespace is created using a resource file with only selected SCCs, the other auto-added SCCs are not included. Therefore, the UID-range and supplemental groups SCC annotations must be set after the namespace is created. + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.uid-range=1000/1000 + - --overwrite + - command: + entrypoint: kubectl + args: + - annotate + - namespace + - ${NAMESPACE} + - openshift.io/sa.scc.supplemental-groups=3000/1000 + - --overwrite - apply: template: true file: 00-install.yaml diff --git a/tests/e2e/daemonset-features/chainsaw-test.yaml b/tests/e2e/daemonset-features/chainsaw-test.yaml index 10802fc758..3e64aabc9a 100755 --- a/tests/e2e/daemonset-features/chainsaw-test.yaml +++ b/tests/e2e/daemonset-features/chainsaw-test.yaml @@ -9,6 +9,7 @@ spec: - name: step-00 try: - script: + timeout: 1m content: ./add-scc-openshift.sh - name: step-01 try: @@ -21,6 +22,7 @@ spec: - name: step-03 try: - script: + timeout: 1m content: ./add-sa-collector.sh - assert: file: 03-assert.yaml diff --git a/tests/e2e/ingress-subdomains/chainsaw-test.yaml b/tests/e2e/ingress-subdomains/chainsaw-test.yaml index 32b38ccec6..00652607cd 100755 --- a/tests/e2e/ingress-subdomains/chainsaw-test.yaml +++ b/tests/e2e/ingress-subdomains/chainsaw-test.yaml @@ -15,6 +15,7 @@ spec: - name: step-01 try: - script: + timeout: 1m content: | #!/bin/bash set -ex