From a6e3cbf8a5a3106967de481e6bc7a41a60b26be1 Mon Sep 17 00:00:00 2001 From: Ales Justin Date: Mon, 16 Jan 2023 19:50:55 +0100 Subject: [PATCH] Fix DB devservice restart, issue #30390 --- .../devservices/DevServicesDatasourceProcessor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extensions/datasource/deployment/src/main/java/io/quarkus/datasource/deployment/devservices/DevServicesDatasourceProcessor.java b/extensions/datasource/deployment/src/main/java/io/quarkus/datasource/deployment/devservices/DevServicesDatasourceProcessor.java index 468fff82eae9d..f10a51ffe2f2e 100644 --- a/extensions/datasource/deployment/src/main/java/io/quarkus/datasource/deployment/devservices/DevServicesDatasourceProcessor.java +++ b/extensions/datasource/deployment/src/main/java/io/quarkus/datasource/deployment/devservices/DevServicesDatasourceProcessor.java @@ -8,6 +8,7 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; import org.eclipse.microprofile.config.ConfigProvider; @@ -45,6 +46,10 @@ public class DevServicesDatasourceProcessor { private static final Logger log = Logger.getLogger(DevServicesDatasourceProcessor.class); private static final int DOCKER_PS_ID_LENGTH = 12; + // list of devservices properties we should not check for restart + // see issue #30390 + private static final Set EXCLUDED_PROPERTIES = Set.of("quarkus.datasource.devservices.enabled"); + static volatile List databases; static volatile Map cachedProperties; @@ -81,7 +86,7 @@ DevServicesDatasourceResultBuildItem launchDatabases(CurateOutcomeBuildItem cura //devservices properties may have been added for (var name : ConfigProvider.getConfig().getPropertyNames()) { if (name.startsWith("quarkus.datasource.") && name.contains(".devservices.") - && !cachedProperties.containsKey(name)) { + && !cachedProperties.containsKey(name) && !EXCLUDED_PROPERTIES.contains(name)) { restartRequired = true; break; }