diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/DockerComposeConnectionDetailsFactory.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/DockerComposeConnectionDetailsFactory.java index 6d29c8bb0247..55da4dfaccfd 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/DockerComposeConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/DockerComposeConnectionDetailsFactory.java @@ -79,6 +79,10 @@ private boolean hasRequiredClasses() { .allMatch((requiredClassName) -> ClassUtils.isPresent(requiredClassName, null)); } + protected static Predicate connectionName(String connectionName) { + return new ConnectionNamePredicate(connectionName); + } + /** * Get the {@link ConnectionDetails} from the given {@link RunningService} * {@code source}. May return {@code null} if no connection can be created. Result diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/cassandra/CassandraDockerComposeConnectionDetailsFactory.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/cassandra/CassandraDockerComposeConnectionDetailsFactory.java index aa5d86d8b899..1b4ba7f20bc4 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/cassandra/CassandraDockerComposeConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/cassandra/CassandraDockerComposeConnectionDetailsFactory.java @@ -35,7 +35,7 @@ class CassandraDockerComposeConnectionDetailsFactory private static final int CASSANDRA_PORT = 9042; CassandraDockerComposeConnectionDetailsFactory() { - super("cassandra"); + super(connectionName("cassandra").or(connectionName("bitnami/cassandra"))); } @Override diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/elasticsearch/ElasticsearchDockerComposeConnectionDetailsFactory.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/elasticsearch/ElasticsearchDockerComposeConnectionDetailsFactory.java index 1304bef2b2c6..a29233de55fb 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/elasticsearch/ElasticsearchDockerComposeConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/elasticsearch/ElasticsearchDockerComposeConnectionDetailsFactory.java @@ -38,7 +38,7 @@ class ElasticsearchDockerComposeConnectionDetailsFactory private static final int ELASTICSEARCH_PORT = 9200; protected ElasticsearchDockerComposeConnectionDetailsFactory() { - super("elasticsearch"); + super(connectionName("elasticsearch").or(connectionName("bitnami/elasticsearch"))); } @Override diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mariadb/MariaDbJdbcDockerComposeConnectionDetailsFactory.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mariadb/MariaDbJdbcDockerComposeConnectionDetailsFactory.java index f5c2e85a5511..901338b89033 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mariadb/MariaDbJdbcDockerComposeConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mariadb/MariaDbJdbcDockerComposeConnectionDetailsFactory.java @@ -34,7 +34,7 @@ class MariaDbJdbcDockerComposeConnectionDetailsFactory extends DockerComposeConnectionDetailsFactory { protected MariaDbJdbcDockerComposeConnectionDetailsFactory() { - super("mariadb"); + super(connectionName("mariadb").or(connectionName("bitnami/mariadb"))); } @Override diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mariadb/MariaDbR2dbcDockerComposeConnectionDetailsFactory.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mariadb/MariaDbR2dbcDockerComposeConnectionDetailsFactory.java index 06b2f1a74245..6b11809f29cb 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mariadb/MariaDbR2dbcDockerComposeConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mariadb/MariaDbR2dbcDockerComposeConnectionDetailsFactory.java @@ -36,7 +36,7 @@ class MariaDbR2dbcDockerComposeConnectionDetailsFactory extends DockerComposeConnectionDetailsFactory { MariaDbR2dbcDockerComposeConnectionDetailsFactory() { - super("mariadb", "io.r2dbc.spi.ConnectionFactoryOptions"); + super(connectionName("mariadb").or(connectionName("bitnami/mariadb")), "io.r2dbc.spi.ConnectionFactoryOptions"); } @Override diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mongo/MongoDockerComposeConnectionDetailsFactory.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mongo/MongoDockerComposeConnectionDetailsFactory.java index 34e748c143e7..54cce33012d3 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mongo/MongoDockerComposeConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mongo/MongoDockerComposeConnectionDetailsFactory.java @@ -37,7 +37,7 @@ class MongoDockerComposeConnectionDetailsFactory extends DockerComposeConnection private static final int MONGODB_PORT = 27017; protected MongoDockerComposeConnectionDetailsFactory() { - super("mongo", "com.mongodb.ConnectionString"); + super(connectionName("mongo").or(connectionName("bitnami/mongodb")), "com.mongodb.ConnectionString"); } @Override diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mysql/MySqlJdbcDockerComposeConnectionDetailsFactory.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mysql/MySqlJdbcDockerComposeConnectionDetailsFactory.java index 5977911879d8..2bba473baef9 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mysql/MySqlJdbcDockerComposeConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mysql/MySqlJdbcDockerComposeConnectionDetailsFactory.java @@ -34,7 +34,7 @@ class MySqlJdbcDockerComposeConnectionDetailsFactory extends DockerComposeConnectionDetailsFactory { protected MySqlJdbcDockerComposeConnectionDetailsFactory() { - super("mysql"); + super(connectionName("mysql").or(connectionName("bitnami/mysql"))); } @Override diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mysql/MySqlR2dbcDockerComposeConnectionDetailsFactory.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mysql/MySqlR2dbcDockerComposeConnectionDetailsFactory.java index 6869007a6e84..9ff9388a8e94 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mysql/MySqlR2dbcDockerComposeConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/mysql/MySqlR2dbcDockerComposeConnectionDetailsFactory.java @@ -36,7 +36,7 @@ class MySqlR2dbcDockerComposeConnectionDetailsFactory extends DockerComposeConnectionDetailsFactory { MySqlR2dbcDockerComposeConnectionDetailsFactory() { - super("mysql", "io.r2dbc.spi.ConnectionFactoryOptions"); + super(connectionName("mysql").or(connectionName("bitnami/mysql")), "io.r2dbc.spi.ConnectionFactoryOptions"); } @Override diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/postgres/PostgresJdbcDockerComposeConnectionDetailsFactory.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/postgres/PostgresJdbcDockerComposeConnectionDetailsFactory.java index 2330a3dc81cf..df593bf90c68 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/postgres/PostgresJdbcDockerComposeConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/postgres/PostgresJdbcDockerComposeConnectionDetailsFactory.java @@ -34,7 +34,7 @@ class PostgresJdbcDockerComposeConnectionDetailsFactory extends DockerComposeConnectionDetailsFactory { protected PostgresJdbcDockerComposeConnectionDetailsFactory() { - super("postgres"); + super(connectionName("postgres").or(connectionName("bitnami/postgresql"))); } @Override diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/postgres/PostgresR2dbcDockerComposeConnectionDetailsFactory.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/postgres/PostgresR2dbcDockerComposeConnectionDetailsFactory.java index 835bd1fe63fa..1d0c2c7a53ba 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/postgres/PostgresR2dbcDockerComposeConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/postgres/PostgresR2dbcDockerComposeConnectionDetailsFactory.java @@ -36,7 +36,8 @@ class PostgresR2dbcDockerComposeConnectionDetailsFactory extends DockerComposeConnectionDetailsFactory { PostgresR2dbcDockerComposeConnectionDetailsFactory() { - super("postgres", "io.r2dbc.spi.ConnectionFactoryOptions"); + super(connectionName("postgres").or(connectionName("bitnami/postgresql")), + "io.r2dbc.spi.ConnectionFactoryOptions"); } @Override diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/rabbit/RabbitDockerComposeConnectionDetailsFactory.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/rabbit/RabbitDockerComposeConnectionDetailsFactory.java index 7bc79b1d129f..7c8664a0f92b 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/rabbit/RabbitDockerComposeConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/rabbit/RabbitDockerComposeConnectionDetailsFactory.java @@ -37,7 +37,7 @@ class RabbitDockerComposeConnectionDetailsFactory private static final int RABBITMQ_PORT = 5672; protected RabbitDockerComposeConnectionDetailsFactory() { - super("rabbitmq"); + super(connectionName("rabbitmq").or(connectionName("bitnami/rabbitmq"))); } @Override diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/redis/RedisDockerComposeConnectionDetailsFactory.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/redis/RedisDockerComposeConnectionDetailsFactory.java index 9503bde010ac..47e9fcea4c2f 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/redis/RedisDockerComposeConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/redis/RedisDockerComposeConnectionDetailsFactory.java @@ -34,7 +34,7 @@ class RedisDockerComposeConnectionDetailsFactory extends DockerComposeConnection private static final int REDIS_PORT = 6379; RedisDockerComposeConnectionDetailsFactory() { - super("redis"); + super(connectionName("redis").or(connectionName("bitnami/redis"))); } @Override diff --git a/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/cassandra/cassandra-bitnami-compose.yaml b/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/cassandra/cassandra-bitnami-compose.yaml index 9058951b0c64..893bc6de6f7d 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/cassandra/cassandra-bitnami-compose.yaml +++ b/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/cassandra/cassandra-bitnami-compose.yaml @@ -6,5 +6,3 @@ services: environment: - 'CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch' - 'CASSANDRA_DC=dc1' - labels: - org.springframework.boot.service-connection: cassandra diff --git a/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/elasticsearch/elasticsearch-bitnami-compose.yaml b/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/elasticsearch/elasticsearch-bitnami-compose.yaml index 4a9aaa9dc10e..b68a393757fd 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/elasticsearch/elasticsearch-bitnami-compose.yaml +++ b/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/elasticsearch/elasticsearch-bitnami-compose.yaml @@ -7,5 +7,3 @@ services: ports: - '9200' - '9300' - labels: - org.springframework.boot.service-connection: elasticsearch diff --git a/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/mariadb/mariadb-bitnami-compose.yaml b/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/mariadb/mariadb-bitnami-compose.yaml index 011e13a2bc7c..64406055b950 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/mariadb/mariadb-bitnami-compose.yaml +++ b/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/mariadb/mariadb-bitnami-compose.yaml @@ -8,5 +8,3 @@ services: - 'MARIADB_USER=myuser' - 'MARIADB_PASSWORD=secret' - 'MARIADB_DATABASE=mydatabase' - labels: - org.springframework.boot.service-connection: mariadb diff --git a/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/mongo/mongo-bitnami-compose.yaml b/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/mongo/mongo-bitnami-compose.yaml index 63966c812bc4..8f92465ac2d2 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/mongo/mongo-bitnami-compose.yaml +++ b/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/mongo/mongo-bitnami-compose.yaml @@ -7,5 +7,3 @@ services: - 'MONGO_INITDB_ROOT_USERNAME=root' - 'MONGO_INITDB_ROOT_PASSWORD=secret' - 'MONGO_INITDB_DATABASE=mydatabase' - labels: - org.springframework.boot.service-connection: mongo diff --git a/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/mysql/mysql-bitnami-compose.yaml b/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/mysql/mysql-bitnami-compose.yaml index c4042b208e86..b0340ed3ed48 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/mysql/mysql-bitnami-compose.yaml +++ b/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/mysql/mysql-bitnami-compose.yaml @@ -8,5 +8,3 @@ services: - 'MYSQL_USER=myuser' - 'MYSQL_PASSWORD=secret' - 'MYSQL_DATABASE=mydatabase' - labels: - org.springframework.boot.service-connection: mysql diff --git a/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/postgres/postgres-bitnami-compose.yaml b/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/postgres/postgres-bitnami-compose.yaml index 528052a03ce4..cb721c823b23 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/postgres/postgres-bitnami-compose.yaml +++ b/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/postgres/postgres-bitnami-compose.yaml @@ -7,5 +7,3 @@ services: - 'POSTGRES_USER=myuser' - 'POSTGRES_DB=mydatabase' - 'POSTGRES_PASSWORD=secret' - labels: - org.springframework.boot.service-connection: postgres diff --git a/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/rabbit/rabbit-bitnami-compose.yaml b/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/rabbit/rabbit-bitnami-compose.yaml index 4c88461f0941..1951fba4bb08 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/rabbit/rabbit-bitnami-compose.yaml +++ b/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/rabbit/rabbit-bitnami-compose.yaml @@ -6,5 +6,3 @@ services: - 'RABBITMQ_DEFAULT_PASS=secret' ports: - '5672' - labels: - org.springframework.boot.service-connection: rabbitmq diff --git a/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/redis/redis-bitnami-compose.yaml b/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/redis/redis-bitnami-compose.yaml index 3aae094c0bc3..c4d6aeb291f8 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/redis/redis-bitnami-compose.yaml +++ b/spring-boot-project/spring-boot-docker-compose/src/test/resources/org/springframework/boot/docker/compose/service/connection/redis/redis-bitnami-compose.yaml @@ -5,5 +5,3 @@ services: - '6379' environment: - 'ALLOW_EMPTY_PASSWORD=yes' - labels: - org.springframework.boot.service-connection: redis