From 89ed4df14817d6be225996f5c7b52c42133041b4 Mon Sep 17 00:00:00 2001 From: Igor Yova Date: Fri, 8 Nov 2024 11:18:07 +0100 Subject: [PATCH] Fixed assign network to vertica container (#2077) * Fixed assign network to vertica container * update aerospike version --- .../embedded-enterprise-aerospike.properties | 2 +- .../aerospike/AerospikeProperties.java | 2 +- ...EmbeddedVerticaBootstrapConfiguration.java | 23 ++++++++----------- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/embedded-aerospike-enterprise/src/main/resources/embedded-enterprise-aerospike.properties b/embedded-aerospike-enterprise/src/main/resources/embedded-enterprise-aerospike.properties index fc1ea40cb..2b0ba611c 100644 --- a/embedded-aerospike-enterprise/src/main/resources/embedded-enterprise-aerospike.properties +++ b/embedded-aerospike-enterprise/src/main/resources/embedded-enterprise-aerospike.properties @@ -1 +1 @@ -embedded.aerospike.dockerImage=aerospike/aerospike-server-enterprise:6.3.0.16_1 +embedded.aerospike.dockerImage=aerospike/aerospike-server-enterprise:6.3.0.31_1 diff --git a/embedded-aerospike/src/main/java/com/playtika/testcontainer/aerospike/AerospikeProperties.java b/embedded-aerospike/src/main/java/com/playtika/testcontainer/aerospike/AerospikeProperties.java index 31f7e0d2b..49b149252 100644 --- a/embedded-aerospike/src/main/java/com/playtika/testcontainer/aerospike/AerospikeProperties.java +++ b/embedded-aerospike/src/main/java/com/playtika/testcontainer/aerospike/AerospikeProperties.java @@ -27,6 +27,6 @@ public AerospikeProperties() { @Override public String getDefaultDockerImage() { - return "aerospike/aerospike-server:6.2"; + return "aerospike/aerospike-server:6.3.0.31_1"; } } diff --git a/embedded-vertica/src/main/java/com/playtika/testcontainer/vertica/EmbeddedVerticaBootstrapConfiguration.java b/embedded-vertica/src/main/java/com/playtika/testcontainer/vertica/EmbeddedVerticaBootstrapConfiguration.java index 49551471b..e90496b20 100644 --- a/embedded-vertica/src/main/java/com/playtika/testcontainer/vertica/EmbeddedVerticaBootstrapConfiguration.java +++ b/embedded-vertica/src/main/java/com/playtika/testcontainer/vertica/EmbeddedVerticaBootstrapConfiguration.java @@ -59,22 +59,19 @@ ToxiproxyContainer.ContainerProxy verticaContainerProxy(ToxiproxyContainer toxip public GenericContainer embeddedVertica(ConfigurableEnvironment environment, VerticaProperties properties, Optional network) { - GenericContainer verticaContainer = configureCommonsAndStart(createContainer(properties), properties, log) + + GenericContainer vertica = new GenericContainer<>(ContainerUtils.getDockerImageName(properties)) + .withExposedPorts(properties.getPort()) + .withEnv("DATABASE_NAME", properties.getDatabase()) + .withEnv("DATABASE_PASSWORD", properties.getPassword()) + .waitingFor(new HostPortWaitStrategy()) .withNetworkAliases(VERTICA_NETWORK_ALIAS); - network.ifPresent(verticaContainer::withNetwork); - registerVerticaEnvironment(verticaContainer, environment, properties); - return verticaContainer; - } - private GenericContainer createContainer(VerticaProperties properties) { - LinkedHashMap map = new LinkedHashMap<>(); - map.put("DATABASE_NAME", properties.getDatabase()); - map.put("DATABASE_PASSWORD", properties.getPassword()); + network.ifPresent(vertica::withNetwork); - return new GenericContainer<>(ContainerUtils.getDockerImageName(properties)) - .withExposedPorts(properties.getPort()) - .withEnv(map) - .waitingFor(new HostPortWaitStrategy()); + GenericContainer verticaContainer = configureCommonsAndStart(vertica, properties, log); + registerVerticaEnvironment(verticaContainer, environment, properties); + return verticaContainer; } private void registerVerticaEnvironment(GenericContainer verticaContainer,