From dcf69cad20642ffac3418b90ce9b7ea8c8ab29f1 Mon Sep 17 00:00:00 2001 From: Wenjun Ruan Date: Fri, 19 Jan 2024 10:29:46 +0800 Subject: [PATCH] Fix PostgresqlDatabaseContainerProvider get Image is incorrect (#15434) --- .../PostgresqlDatabaseContainerProvider.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dolphinscheduler-tools/src/test/java/org/apache/dolphinscheduler/tools/datasource/postgresql/PostgresqlDatabaseContainerProvider.java b/dolphinscheduler-tools/src/test/java/org/apache/dolphinscheduler/tools/datasource/postgresql/PostgresqlDatabaseContainerProvider.java index 91d4499cdb..c09b7fae01 100644 --- a/dolphinscheduler-tools/src/test/java/org/apache/dolphinscheduler/tools/datasource/postgresql/PostgresqlDatabaseContainerProvider.java +++ b/dolphinscheduler-tools/src/test/java/org/apache/dolphinscheduler/tools/datasource/postgresql/PostgresqlDatabaseContainerProvider.java @@ -40,12 +40,13 @@ public class PostgresqlDatabaseContainerProvider implements DatabaseContainerPro @Override public GenericContainer getContainer(DolphinSchedulerDatabaseContainer dataSourceContainer) { // todo: test with multiple pg version - GenericContainer postgresqlContainer = new PostgreSQLContainer(DockerImageName.parse("postgres:11.1")) - .withUsername("root") - .withPassword("root") - .withDatabaseName("dolphinscheduler") - .withNetwork(NETWORK) - .withExposedPorts(5432); + GenericContainer postgresqlContainer = + new PostgreSQLContainer(DockerImageName.parse(dataSourceContainer.imageName())) + .withUsername("root") + .withPassword("root") + .withDatabaseName("dolphinscheduler") + .withNetwork(NETWORK) + .withExposedPorts(5432); postgresqlContainer.setPortBindings(Lists.newArrayList("5432:5432")); return postgresqlContainer;