From cf81292249ab52f3cd36a81fb0789135c1d81949 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Mon, 26 Sep 2022 13:36:46 +0200 Subject: [PATCH] Dev Services - Mark configured images as compatible with default ones Fixes #27862 --- .../common/deployment/DevServicesElasticsearchProcessor.java | 4 ++-- .../kafka/client/deployment/DevServicesKafkaProcessor.java | 2 +- .../devservice/DevServicesApicurioRegistryProcessor.java | 3 ++- .../amqp/deployment/AmqpDevServicesProcessor.java | 2 +- .../rabbitmq/deployment/RabbitMQDevServicesProcessor.java | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/extensions/elasticsearch-rest-client-common/deployment/src/main/java/io/quarkus/elasticsearch/restclient/common/deployment/DevServicesElasticsearchProcessor.java b/extensions/elasticsearch-rest-client-common/deployment/src/main/java/io/quarkus/elasticsearch/restclient/common/deployment/DevServicesElasticsearchProcessor.java index 44803e7d84ca2..fae32662211ac 100644 --- a/extensions/elasticsearch-rest-client-common/deployment/src/main/java/io/quarkus/elasticsearch/restclient/common/deployment/DevServicesElasticsearchProcessor.java +++ b/extensions/elasticsearch-rest-client-common/deployment/src/main/java/io/quarkus/elasticsearch/restclient/common/deployment/DevServicesElasticsearchProcessor.java @@ -176,7 +176,7 @@ private DevServicesResultBuildItem.RunningDevService startElasticsearch( throw new BuildException("Dev services for Elasticsearch didn't support Opensearch", Collections.emptyList()); } - // Hibernate search Elasticsearch have a version configuration property, we need to check that it is coherent + // Hibernate Search Elasticsearch have a version configuration property, we need to check that it is coherent // with the image we are about to launch if (buildItemConfig.version != null) { String containerTag = config.imageName.substring(config.imageName.indexOf(':') + 1); @@ -197,7 +197,7 @@ private DevServicesResultBuildItem.RunningDevService startElasticsearch( // Starting the server final Supplier defaultElasticsearchSupplier = () -> { ElasticsearchContainer container = new ElasticsearchContainer( - DockerImageName.parse(config.imageName)); + DockerImageName.parse(config.imageName).asCompatibleSubstituteFor("elasticsearch/elasticsearch")); ConfigureUtil.configureSharedNetwork(container, "elasticsearch"); if (config.serviceName != null) { container.withLabel(DEV_SERVICE_LABEL, config.serviceName); diff --git a/extensions/kafka-client/deployment/src/main/java/io/quarkus/kafka/client/deployment/DevServicesKafkaProcessor.java b/extensions/kafka-client/deployment/src/main/java/io/quarkus/kafka/client/deployment/DevServicesKafkaProcessor.java index 319ff7d521d45..0bbe4d8112266 100644 --- a/extensions/kafka-client/deployment/src/main/java/io/quarkus/kafka/client/deployment/DevServicesKafkaProcessor.java +++ b/extensions/kafka-client/deployment/src/main/java/io/quarkus/kafka/client/deployment/DevServicesKafkaProcessor.java @@ -246,7 +246,7 @@ private RunningDevService startKafka(DockerStatusBuildItem dockerStatusBuildItem KAFKA_BOOTSTRAP_SERVERS, container.getBootstrapServers()); } else { RedPandaKafkaContainer container = new RedPandaKafkaContainer( - DockerImageName.parse(config.imageName), + DockerImageName.parse(config.imageName).asCompatibleSubstituteFor("vectorized/redpanda"), config.fixedExposedPort, launchMode.getLaunchMode() == LaunchMode.DEVELOPMENT ? config.serviceName : null, useSharedNetwork, config.redpanda); diff --git a/extensions/schema-registry/devservice/deployment/src/main/java/io/quarkus/apicurio/registry/devservice/DevServicesApicurioRegistryProcessor.java b/extensions/schema-registry/devservice/deployment/src/main/java/io/quarkus/apicurio/registry/devservice/DevServicesApicurioRegistryProcessor.java index 79e659a5562e5..7698a26f35537 100644 --- a/extensions/schema-registry/devservice/deployment/src/main/java/io/quarkus/apicurio/registry/devservice/DevServicesApicurioRegistryProcessor.java +++ b/extensions/schema-registry/devservice/deployment/src/main/java/io/quarkus/apicurio/registry/devservice/DevServicesApicurioRegistryProcessor.java @@ -173,7 +173,8 @@ private RunningDevService startApicurioRegistry(DockerStatusBuildItem dockerStat getRegistryUrlConfigs("http://" + address.getUrl()))) .orElseGet(() -> { ApicurioRegistryContainer container = new ApicurioRegistryContainer( - DockerImageName.parse(config.imageName), config.fixedExposedPort, + DockerImageName.parse(config.imageName).asCompatibleSubstituteFor("apicurio/apicurio-registry-mem"), + config.fixedExposedPort, launchMode.getLaunchMode() == LaunchMode.DEVELOPMENT ? config.serviceName : null, useSharedNetwork); timeout.ifPresent(container::withStartupTimeout); diff --git a/extensions/smallrye-reactive-messaging-amqp/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/amqp/deployment/AmqpDevServicesProcessor.java b/extensions/smallrye-reactive-messaging-amqp/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/amqp/deployment/AmqpDevServicesProcessor.java index d6c6fa0146adb..99fdf9a906bf9 100644 --- a/extensions/smallrye-reactive-messaging-amqp/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/amqp/deployment/AmqpDevServicesProcessor.java +++ b/extensions/smallrye-reactive-messaging-amqp/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/amqp/deployment/AmqpDevServicesProcessor.java @@ -176,7 +176,7 @@ private RunningDevService startAmqpBroker(DockerStatusBuildItem dockerStatusBuil final Supplier defaultAmqpBrokerSupplier = () -> { // Starting the broker ArtemisContainer container = new ArtemisContainer( - DockerImageName.parse(config.imageName), + DockerImageName.parse(config.imageName).asCompatibleSubstituteFor("artemiscloud/activemq-artemis-broker"), config.extra, config.fixedExposedPort, launchMode.getLaunchMode() == LaunchMode.DEVELOPMENT ? config.serviceName : null); diff --git a/extensions/smallrye-reactive-messaging-rabbitmq/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/rabbitmq/deployment/RabbitMQDevServicesProcessor.java b/extensions/smallrye-reactive-messaging-rabbitmq/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/rabbitmq/deployment/RabbitMQDevServicesProcessor.java index 85763f737ae33..39d102ff57582 100644 --- a/extensions/smallrye-reactive-messaging-rabbitmq/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/rabbitmq/deployment/RabbitMQDevServicesProcessor.java +++ b/extensions/smallrye-reactive-messaging-rabbitmq/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/rabbitmq/deployment/RabbitMQDevServicesProcessor.java @@ -176,7 +176,7 @@ private RunningDevService startRabbitMQBroker(DockerStatusBuildItem dockerStatus } ConfiguredRabbitMQContainer container = new ConfiguredRabbitMQContainer( - DockerImageName.parse(config.imageName), + DockerImageName.parse(config.imageName).asCompatibleSubstituteFor("rabbitmq"), config.fixedExposedPort, config.fixedExposedHttpPort, launchMode.getLaunchMode() == LaunchMode.DEVELOPMENT ? config.serviceName : null);