From df096620d6b2a2001f446fab33685f6e9413aa38 Mon Sep 17 00:00:00 2001 From: Kerkesni Date: Tue, 28 Jan 2025 12:22:34 +0100 Subject: [PATCH] make namespace configurable in wait_for_consumer_group Issue: ZENKO-4286 --- .github/scripts/end2end/common.sh | 13 +++++++------ .github/scripts/end2end/configure-e2e.sh | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/scripts/end2end/common.sh b/.github/scripts/end2end/common.sh index 4d1c00311..65ab7117e 100644 --- a/.github/scripts/end2end/common.sh +++ b/.github/scripts/end2end/common.sh @@ -64,14 +64,15 @@ wait_for_all_pods_behind_services() { # wait for consumer group to be in a stable state (no rebance + at least one consumer connected) wait_for_consumer_group() { + namespace=$1 # Getting the name of the first kafka pod - kafka_pod=$(kubectl get pods -l brokerId=0,kafka_cr=end2end-base-queue,app=kafka -o jsonpath='{.items[0].metadata.name}') - consumer_group=$1 + kafka_pod=$(kubectl get pods -n $namespace -l brokerId=0,kafka_cr=end2end-base-queue,app=kafka -o jsonpath='{.items[0].metadata.name}') + consumer_group=$2 # When a pod is restarted the previous consumer is kept in the group until the session timeout expires - expected_members=$2 - timeout_s=$3 - interval_s=${4:-5} - kubectl exec -it $kafka_pod -- bash -c ' + expected_members=$3 + timeout_s=$4 + interval_s=${5:-5} + kubectl exec -it $kafka_pod -n $namespace -- bash -c ' export KAFKA_OPTS= consumer_group=$1 expected_members=$2 diff --git a/.github/scripts/end2end/configure-e2e.sh b/.github/scripts/end2end/configure-e2e.sh index a2ac09f71..1cdc9e47e 100755 --- a/.github/scripts/end2end/configure-e2e.sh +++ b/.github/scripts/end2end/configure-e2e.sh @@ -111,4 +111,4 @@ kubectl wait --for condition=DeploymentFailure=false --timeout 25m -n ${NAMESPAC kubectl wait --for condition=DeploymentInProgress=false --timeout 25m -n ${NAMESPACE} zenko/${ZENKO_NAME} # wait for ingestion processor to start consuming from Kafka -wait_for_consumer_group $UUID.backbeat-ingestion-group 1 300 +wait_for_consumer_group $NAMESPACE $UUID.backbeat-ingestion-group 1 300