From 8a7643d0f3eccd9fb4abb43f80f88e2394db06fe Mon Sep 17 00:00:00 2001 From: Jacob Baskin Date: Tue, 1 Nov 2022 15:13:57 -0400 Subject: [PATCH] Expose test containers' hostnames on custom networks --- .../java/io/trino/testing/containers/BaseTestContainer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/trino-testing-containers/src/main/java/io/trino/testing/containers/BaseTestContainer.java b/testing/trino-testing-containers/src/main/java/io/trino/testing/containers/BaseTestContainer.java index b03c9d72a12b..66f17bcd045a 100644 --- a/testing/trino-testing-containers/src/main/java/io/trino/testing/containers/BaseTestContainer.java +++ b/testing/trino-testing-containers/src/main/java/io/trino/testing/containers/BaseTestContainer.java @@ -87,7 +87,7 @@ protected void setupContainer() .withStartupCheckStrategy(new IsRunningStartupCheckStrategy()) .waitingFor(Wait.forListeningPort()) .withStartupTimeout(Duration.ofMinutes(5)); - network.ifPresent(container::withNetwork); + network.ifPresent(net -> container.withNetwork(net).withNetworkAliases(hostName)); } protected void withRunCommand(List runCommand)