From b32c855e4af40eb6f7652dc9326fc16845c35689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20=C5=9Awi=C4=85tek?= Date: Thu, 15 Feb 2024 19:58:46 +0100 Subject: [PATCH] Ensure unique names for ClusterRoles in e2e tests (#2625) --- .../create-sm-prometheus-exporters/08-install.yaml | 4 ++-- .../00-promreceiver-allocatorconfig.yaml | 4 ++-- tests/e2e/smoke-targetallocator/00-install.yaml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/e2e-prometheuscr/create-sm-prometheus-exporters/08-install.yaml b/tests/e2e-prometheuscr/create-sm-prometheus-exporters/08-install.yaml index 7b85e4fb26..7c808af177 100644 --- a/tests/e2e-prometheuscr/create-sm-prometheus-exporters/08-install.yaml +++ b/tests/e2e-prometheuscr/create-sm-prometheus-exporters/08-install.yaml @@ -8,7 +8,7 @@ automountServiceAccountToken: true apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: ta + name: create-sm-prometheus rules: - apiGroups: [""] resources: @@ -60,7 +60,7 @@ rules: apiVersion: kuttl.dev/v1beta1 kind: TestStep commands: - - command: kubectl create clusterrolebinding simplest-targetallocator-create-sm-prometheus --clusterrole=ta --serviceaccount=create-sm-prometheus:ta + - command: kubectl create clusterrolebinding simplest-targetallocator-create-sm-prometheus --clusterrole=create-sm-prometheus --serviceaccount=create-sm-prometheus:ta --- apiVersion: opentelemetry.io/v1alpha1 kind: OpenTelemetryCollector diff --git a/tests/e2e/prometheus-config-validation/00-promreceiver-allocatorconfig.yaml b/tests/e2e/prometheus-config-validation/00-promreceiver-allocatorconfig.yaml index a7f534e673..c57c26f167 100644 --- a/tests/e2e/prometheus-config-validation/00-promreceiver-allocatorconfig.yaml +++ b/tests/e2e/prometheus-config-validation/00-promreceiver-allocatorconfig.yaml @@ -7,7 +7,7 @@ automountServiceAccountToken: true apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: pod-view + name: promreceiver-allocatorconfig rules: - apiGroups: [""] resources: [ "pods", "namespaces" ] @@ -16,7 +16,7 @@ rules: apiVersion: kuttl.dev/v1beta1 kind: TestStep commands: - - command: kubectl -n $NAMESPACE create clusterrolebinding default-view-$NAMESPACE --clusterrole=pod-view --serviceaccount=$NAMESPACE:ta + - command: kubectl -n $NAMESPACE create clusterrolebinding default-view-$NAMESPACE --clusterrole=promreceiver-allocatorconfig --serviceaccount=$NAMESPACE:ta --- apiVersion: opentelemetry.io/v1alpha1 kind: OpenTelemetryCollector diff --git a/tests/e2e/smoke-targetallocator/00-install.yaml b/tests/e2e/smoke-targetallocator/00-install.yaml index 6938d30ea6..1e87777118 100644 --- a/tests/e2e/smoke-targetallocator/00-install.yaml +++ b/tests/e2e/smoke-targetallocator/00-install.yaml @@ -7,7 +7,7 @@ automountServiceAccountToken: true apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: pod-view + name: smoke-targetallocator rules: - apiGroups: [""] resources: [ "pods", "namespaces" ] @@ -16,7 +16,7 @@ rules: apiVersion: kuttl.dev/v1beta1 kind: TestStep commands: - - command: kubectl -n $NAMESPACE create clusterrolebinding default-view-$NAMESPACE --clusterrole=pod-view --serviceaccount=$NAMESPACE:ta + - command: kubectl -n $NAMESPACE create clusterrolebinding default-view-$NAMESPACE --clusterrole=smoke-targetallocator --serviceaccount=$NAMESPACE:ta --- apiVersion: opentelemetry.io/v1alpha1 kind: OpenTelemetryCollector