Skip to content

Commit

Permalink
[LRA] Fix test when running with DOCKER_HOST (apache#6042)
Browse files Browse the repository at this point in the history
  • Loading branch information
avano authored and zhfeng committed Apr 26, 2024
1 parent 15124c0 commit 97b3777
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,18 @@ public Map<String, String> start() {
lraPort = container.getMappedPort(LRA_PORT);
}

// If the test runs with a remote docker, it needs to know the IP of the machine where the test app runs
if (System.getenv("DOCKER_HOST") != null) {
hostname = System.getProperty("lra.appNode.ip");
if (hostname == null) {
throw new RuntimeException(
"You need to supply application node IP when running LRA test with a remote docker instance using lra.appNode.ip property");
}
}

return CollectionHelper.mapOf(
// In case of remote docker, expose the endpoint at 0.0.0.0, as the default is "localhost" only
"quarkus.http.host", "0.0.0.0",
"camel.lra.coordinator-url",
String.format("http://%s:%d", container.getHost(), lraPort),
"camel.lra.local-participant-url",
Expand Down

0 comments on commit 97b3777

Please sign in to comment.