Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use getHost instead of getContainerIpAddress #25584

Merged
merged 1 commit into from
May 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/kafka-schema-registry-avro.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ public class KafkaAndSchemaRegistryTestResource implements QuarkusTestResourceLi
registry.start();
Map<String, String> properties = new HashMap<>();
properties.put("mp.messaging.connector.smallrye-kafka.apicurio.registry.url",
"http://" + registry.getContainerIpAddress() + ":" + registry.getMappedPort(8080) + "/apis/registry/v2");
"http://" + registry.getHost() + ":" + registry.getMappedPort(8080) + "/apis/registry/v2");
properties.put("kafka.bootstrap.servers", kafka.getBootstrapServers());
return properties;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ public class KafkaAndSchemaRegistryTestResource implements QuarkusTestResourceLi
private static GenericContainer<?> registry;

public static String getConfluentSchemaRegistryUrl() {
return "http://" + registry.getContainerIpAddress() + ":" + registry.getMappedPort(8080) + "/api/ccompat";
return "http://" + registry.getHost() + ":" + registry.getMappedPort(8080) + "/api/ccompat";
}

public static String getApicurioSchemaRegistryUrl() {
return "http://" + registry.getContainerIpAddress() + ":" + registry.getMappedPort(8080) + "/api";
return "http://" + registry.getHost() + ":" + registry.getMappedPort(8080) + "/api";
}

@Override
Expand All @@ -27,9 +27,9 @@ public Map<String, String> start() {
registry.start();
Map<String, String> properties = new HashMap<>();
properties.put("schema.url.confluent",
"http://" + registry.getContainerIpAddress() + ":" + registry.getMappedPort(8080) + "/api/ccompat");
"http://" + registry.getHost() + ":" + registry.getMappedPort(8080) + "/api/ccompat");
properties.put("schema.url.apicurio",
"http://" + registry.getContainerIpAddress() + ":" + registry.getMappedPort(8080) + "/api");
"http://" + registry.getHost() + ":" + registry.getMappedPort(8080) + "/api");
return properties;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Map<String, String> start() {
.withNetworkAliases("kafka")
.withServerProperties(MountableFile.forClasspathResource("kafkaServer.properties"))
.withBootstrapServers(
c -> String.format("JWT://%s:%s", c.getContainerIpAddress(), c.getMappedPort(KAFKA_PORT)));
c -> String.format("JWT://%s:%s", c.getHost(), c.getMappedPort(KAFKA_PORT)));
this.kafka.start();
log.info(this.kafka.getLogs());
properties.put("kafka.bootstrap.servers", this.kafka.getBootstrapServers());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Map<String, String> start() {
//Start kafka container
kafka = new StrimziKafkaContainer()
.withBootstrapServers(
c -> String.format("SASL_PLAINTEXT://%s:%s", c.getContainerIpAddress(), c.getMappedPort(KAFKA_PORT)))
c -> String.format("SASL_PLAINTEXT://%s:%s", c.getHost(), c.getMappedPort(KAFKA_PORT)))
.withPort(KAFKA_PORT)
.withServerProperties(MountableFile.forClasspathResource("kafkaServer.properties"))
.withCopyFileToContainer(MountableFile.forClasspathResource("krb5KafkaBroker.conf"), "/etc/krb5.conf")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class KafkaSASLTestResource implements QuarkusTestResourceLifecycleManage
private final StrimziKafkaContainer kafka = new StrimziKafkaContainer()
.withServerProperties(MountableFile.forClasspathResource("server.properties"))
.withBootstrapServers(
container -> String.format("SASL_PLAINTEXT://%s:%s", container.getContainerIpAddress(),
container -> String.format("SASL_PLAINTEXT://%s:%s", container.getHost(),
container.getMappedPort(KAFKA_PORT)));

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public class KafkaSSLTestResource implements QuarkusTestResourceLifecycleManager {

private final StrimziKafkaContainer kafka = new StrimziKafkaContainer()
.withBootstrapServers(c -> String.format("SSL://%s:%s", c.getContainerIpAddress(), c.getMappedPort(KAFKA_PORT)))
.withBootstrapServers(c -> String.format("SSL://%s:%s", c.getHost(), c.getMappedPort(KAFKA_PORT)))
.withServerProperties(MountableFile.forClasspathResource("server.properties"))
.withCopyFileToContainer(MountableFile.forClasspathResource("kafka-keystore.p12"),
"/opt/kafka/config/kafka-keystore.p12")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class KafkaSSLTestResource implements QuarkusTestResourceLifecycleManager

private static final StrimziKafkaContainer kafka = new StrimziKafkaContainer()
.withServerProperties(MountableFile.forClasspathResource("server.properties"))
.withBootstrapServers(c -> String.format("SSL://%s:%s", c.getContainerIpAddress(), c.getMappedPort(KAFKA_PORT)))
.withBootstrapServers(c -> String.format("SSL://%s:%s", c.getHost(), c.getMappedPort(KAFKA_PORT)))
.withCopyFileToContainer(MountableFile.forClasspathResource("ks-keystore.p12"),
"/opt/kafka/config/kafka-keystore.p12")
.withCopyFileToContainer(MountableFile.forClasspathResource("ks-truststore.p12"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public Map<String, String> start() {
server.start();
HashMap<String, String> properties = new HashMap<>();
properties.put("quarkus.mailer.port", Integer.toString(server.getMappedPort(1025)));
properties.put("quarkus.mailer.host", server.getContainerIpAddress());
properties.put("fake.mailer", server.getContainerIpAddress() + ":" + server.getMappedPort(1080));
properties.put("quarkus.mailer.host", server.getHost());
properties.put("fake.mailer", server.getHost() + ":" + server.getMappedPort(1080));
// properties.put("quarkus.mailer.port", Integer.toString(32787));
// properties.put("quarkus.mailer.host", "localhost");
// properties.put("fake.mailer", "localhost" + ":" + 32786);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public Map<String, String> start() {
Map<String, String> properties = new HashMap<>();

coordinatorEndpoint = String.format("http://%s:%d/%s",
registry.getContainerIpAddress(),
registry.getHost(),
registry.getFirstMappedPort(),
LRAConstants.COORDINATOR_PATH_NAME);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public Map<String, String> start() {
HOTROD_PORT, USER, PASSWORD);
INFINISPAN.start();

final String hosts = INFINISPAN.getContainerIpAddress() + ":" + INFINISPAN.getMappedPort(HOTROD_PORT);
final String hosts = INFINISPAN.getHost() + ":" + INFINISPAN.getMappedPort(HOTROD_PORT);
return Collections.singletonMap("quarkus.infinispan-client.server-list", hosts);
}

Expand Down