From 9129a4da67e67fd1ad56010346e0e6305603b0ce Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Tue, 23 May 2023 17:41:30 +0300 Subject: [PATCH] Don't ignore invalid config in quarkus.container-image.name Fixes: #33552 --- .../container/image/deployment/ContainerImageConfig.java | 2 +- .../container/image/deployment/ContainerImageProcessor.java | 3 +-- 2 files changed, 2 insertions(+), 3 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 f093801383318..9db9a56e09fc7 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 @@ -24,7 +24,7 @@ public class ContainerImageConfig { */ @ConfigItem(defaultValue = "${quarkus.application.name:unset}") @ConvertWith(TrimmedStringConverter.class) - public Optional name; + public String name; /** * The tag of the container image. If not set defaults to the application version diff --git a/extensions/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/ContainerImageProcessor.java b/extensions/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/ContainerImageProcessor.java index 0558bd01afc5f..742e2a718e54e 100644 --- a/extensions/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/ContainerImageProcessor.java +++ b/extensions/container-image/deployment/src/main/java/io/quarkus/container/image/deployment/ContainerImageProcessor.java @@ -89,8 +89,7 @@ public void publishImageInfo(ApplicationInfoBuildItem app, } String effectiveName = containerImageCustomName.map(ContainerImageCustomNameBuildItem::getName) - .or(() -> containerImageConfig.name) - .orElse(app.getName()); + .orElse(containerImageConfig.name); String repository = (containerImageConfig.getEffectiveGroup().map(s -> s + "/").orElse("")) + effectiveName; if (!ImageReference.isValidRepository(repository)) { throw new IllegalArgumentException("The supplied combination of container-image group '"