quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.53k stars 2.61k forks source link

`quarkus image build` overrides `container-image.group` with the docker username #41968

Closed thmasker closed 1 month ago

thmasker commented 1 month ago

Describe the bug

I have the following property in application.properties: quarkus.container-image.group=custom-group

Doing quarkus build generates both target/kubernetes/kubernetes.json and target/kubernetes/kubernetes.yml generates the correct image group: */custom-group/*. However, doing quarkus image build generates both files with the default image group: */docker-username/*

Expected behavior

Both target/kubernetes/kubernetes.json and target/kubernetes/kubernetes.yml are generated using the specified image group:

Actual behavior

Both target/kubernetes/kubernetes.json and target/kubernetes/kubernetes.yml are generated using the default image group (my docker username):

How to Reproduce?

No response

Output of uname -a or ver

Linux 6.5.0-44-generic #44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jun 18 14:36:16 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "17.0.11" 2024-04-16

Quarkus version or git rev

3.12.3

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.6.3

Additional information

No response

quarkus-bot[bot] commented 1 month ago

/cc @geoand (kubernetes), @iocanel (kubernetes)

iocanel commented 1 month ago

I think this a bug in the ImageOptions class that is used from the CLI. As it uses a default value. Later in in the process its impossible to discern whether the group is provided or a fallback value and thus it overrides whats found in the application.properties.

This should be a trivial fix, as I think we just need to remove the default value from the ImageOptions class. @thmasker would you be interested in providing a pull request for that?

thmasker commented 1 month ago

I'll try to do it asap. Thanks for your answer