From bc0702c1c6a36b655aed777f8696ef614377a028 Mon Sep 17 00:00:00 2001 From: Toshiya Kobayashi Date: Fri, 13 Dec 2024 01:09:10 +0900 Subject: [PATCH] =?UTF-8?q?[incubator-kie-issues-1682]=20Test=20cases=20in?= =?UTF-8?q?=20kogito=20repos=20GHA=20fail=20with=20=E2=80=A6=20(#3812)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [incubator-kie-issues-1682] Test cases in kogito repos GHA fail with "pull access denied for vectorized/redpanda" * Fix advertise-kafka-addr in script command --------- Co-authored-by: gmunozfe --- kogito-build/kogito-build-no-bom-parent/pom.xml | 2 +- .../kie/kogito/testcontainers/KogitoKafkaContainer.java | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/kogito-build/kogito-build-no-bom-parent/pom.xml b/kogito-build/kogito-build-no-bom-parent/pom.xml index afe76bd494e..2795ef00b81 100644 --- a/kogito-build/kogito-build-no-bom-parent/pom.xml +++ b/kogito-build/kogito-build-no-bom-parent/pom.xml @@ -50,7 +50,7 @@ infinispan/server:${version.org.infinispan} quay.io/keycloak/keycloak:${version.org.keycloak} - vectorized/redpanda:v21.11.8 + redpandadata/redpanda:v24.3.1 wurstmeister/kafka:${version.wurstmeister.kafka} library/mongo:${version.org.mongo-image} redislabs/redisearch:${version.org.redis} diff --git a/kogito-test-utils/src/main/java/org/kie/kogito/testcontainers/KogitoKafkaContainer.java b/kogito-test-utils/src/main/java/org/kie/kogito/testcontainers/KogitoKafkaContainer.java index 6bd3a3dce7e..72c594d4f8f 100644 --- a/kogito-test-utils/src/main/java/org/kie/kogito/testcontainers/KogitoKafkaContainer.java +++ b/kogito-test-utils/src/main/java/org/kie/kogito/testcontainers/KogitoKafkaContainer.java @@ -53,14 +53,13 @@ public KogitoKafkaContainer() { @Override protected void containerIsStarting(InspectContainerResponse containerInfo, boolean reused) { super.containerIsStarting(containerInfo, reused); - String brokerAdvertisedListener = brokerAdvertisedListener(containerInfo); // Start and configure the advertised address String command = "#!/bin/bash\n"; command += "/usr/bin/rpk redpanda start --check=false --node-id 0 --smp 1 "; command += "--memory 1G --overprovisioned --reserve-memory 0M "; command += "--kafka-addr PLAINTEXT://0.0.0.0:29092,OUTSIDE://0.0.0.0:9092 "; - command += format("--advertise-kafka-addr %s ", String.join(",", getBootstrapServers(), brokerAdvertisedListener)); + command += "--advertise-kafka-addr PLAINTEXT://kafka:29092,OUTSIDE://" + getHost() + ":" + getMappedPort(KAFKA_PORT) + " "; command += "--set redpanda.enable_idempotence=true "; command += "--set redpanda.enable_transactions=true "; @@ -73,10 +72,6 @@ public void start() { LOGGER.info("Kafka servers: {}", getBootstrapServers()); } - protected String brokerAdvertisedListener(InspectContainerResponse containerInfo) { - return String.format("PLAINTEXT://%s:29092", containerInfo.getConfig().getHostName()); - } - public String getBootstrapServers() { return format("OUTSIDE://%s:%d", getHost(), getMappedPort(KAFKA_PORT)); }