Skip to content

Commit

Permalink
Use host.docker.internal for acceptance testing on macs (#12791)
Browse files Browse the repository at this point in the history
* Use `host.docker.internal` for acceptance testing

* Lint

* conditional hostname for mac only
  • Loading branch information
evantahler authored May 11, 2022
1 parent feb0d2f commit 5ff96ab
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ public class AcceptanceTests {
private static final boolean IS_KUBE = System.getenv().containsKey("KUBE");
private static final boolean IS_MINIKUBE = System.getenv().containsKey("IS_MINIKUBE");
private static final boolean IS_GKE = System.getenv().containsKey("IS_GKE");
private static final boolean IS_MAC = System.getProperty("os.name").startsWith("Mac");
private static final boolean USE_EXTERNAL_DEPLOYMENT =
System.getenv("USE_EXTERNAL_DEPLOYMENT") != null && System.getenv("USE_EXTERNAL_DEPLOYMENT").equalsIgnoreCase("true");

Expand Down Expand Up @@ -1548,6 +1549,8 @@ private Map<Object, Object> localConfig(final PostgreSQLContainer psql, final bo
// used on a single node with docker driver
dbConfig.put("host", "host.docker.internal");
}
} else if (IS_MAC) {
dbConfig.put("host", "host.docker.internal");
} else {
dbConfig.put("host", "localhost");
}
Expand Down

0 comments on commit 5ff96ab

Please sign in to comment.