Skip to content

Commit

Permalink
make namespace configurable in wait_for_consumer_group
Browse files Browse the repository at this point in the history
Issue: ZENKO-4286
  • Loading branch information
Kerkesni committed Jan 28, 2025
1 parent b6e9ea7 commit df09662
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions .github/scripts/end2end/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/end2end/configure-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit df09662

Please sign in to comment.