From 10ec5e4f76f8083a5a1358556b5ca9f8cda2e63f Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 27 Sep 2021 09:19:35 +0300 Subject: [PATCH] Reinstate ability to set an empty container-image group Fixes: #20376 --- .../container/image/deployment/ContainerImageConfig.java | 2 ++ .../src/main/resources/application.properties | 3 ++- .../src/it/container-build-jib/verify.groovy | 7 +++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/extensions/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/ContainerImageConfig.java b/extensions/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/ContainerImageConfig.java index 986326cfe50c7..df6d5f6de9794 100644 --- a/extensions/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/ContainerImageConfig.java +++ b/extensions/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/ContainerImageConfig.java @@ -110,6 +110,8 @@ public Optional getEffectiveGroup() { return Optional.empty(); } return Optional.of(originalGroup.toLowerCase().replace(' ', '-')); + } else if (originalGroup.isEmpty()) { + return Optional.empty(); } } return group; diff --git a/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib/src/main/resources/application.properties b/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib/src/main/resources/application.properties index 3c1ac56a1ad0a..8a62001cee00c 100644 --- a/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib/src/main/resources/application.properties +++ b/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib/src/main/resources/application.properties @@ -1,2 +1,3 @@ # Configuration file -# key = value \ No newline at end of file +# key = value +quarkus.container-image.group= diff --git a/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib/verify.groovy b/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib/verify.groovy index f80a537dcdf76..5e11627791e4e 100644 --- a/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib/verify.groovy +++ b/integration-tests/container-image/maven-invoker-way/src/it/container-build-jib/verify.groovy @@ -11,9 +11,8 @@ try { return } -String group = System.getProperty("user.name") -assert ExecUtil.exec("docker", "images", group + "/container-build-jib") -assert ExecUtil.exec("docker", "rmi", group + "/container-build-jib:0.1-SNAPSHOT") +assert ExecUtil.exec("docker", "images", "container-build-jib") +assert ExecUtil.exec("docker", "rmi", "container-build-jib:0.1-SNAPSHOT") Path pathInIT = Paths.get("target", "it", "container-build-jib", "target") @@ -36,7 +35,7 @@ propertiesFile.withInputStream { } assert properties.type == 'jar-container' -assert properties."metadata.container-image" == group + "/container-build-jib:0.1-SNAPSHOT" +assert properties."metadata.container-image" == "container-build-jib:0.1-SNAPSHOT" assert Files.exists(target.resolve("jib-image.digest"))