diff --git a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KnativeConfig.java b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KnativeConfig.java index 940551d441e451..303fbe7edd86e9 100644 --- a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KnativeConfig.java +++ b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KnativeConfig.java @@ -24,13 +24,13 @@ public class KnativeConfig implements PlatformConfiguration { * The name of the application. This value will be used for naming Kubernetes * resources like: - Deployment - Service and so on ... */ - @ConfigItem(defaultValue = "${quarkus.container-image.name}") + @ConfigItem Optional name; /** * The version of the application. */ - @ConfigItem(defaultValue = "${quarkus.container-image.tag}") + @ConfigItem Optional version; /** diff --git a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesConfig.java b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesConfig.java index d5fd0a1782ad79..562e0ec70e1768 100644 --- a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesConfig.java +++ b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/KubernetesConfig.java @@ -45,13 +45,13 @@ public enum DeploymentResourceKind { * The name of the application. This value will be used for naming Kubernetes * resources like: - Deployment - Service and so on ... */ - @ConfigItem(defaultValue = "${quarkus.container-image.name}") + @ConfigItem Optional name; /** * The version of the application. */ - @ConfigItem(defaultValue = "${quarkus.container-image.tag}") + @ConfigItem Optional version; /** * The kind of the deployment resource to use. diff --git a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/OpenshiftConfig.java b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/OpenshiftConfig.java index 6f731816ac42a2..2f0443b148eddf 100644 --- a/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/OpenshiftConfig.java +++ b/extensions/kubernetes/vanilla/deployment/src/main/java/io/quarkus/kubernetes/deployment/OpenshiftConfig.java @@ -82,13 +82,13 @@ public static enum DeploymentResourceKind { * The name of the application. This value will be used for naming Kubernetes * resources like: 'Deployment', 'Service' and so on... */ - @ConfigItem(defaultValue = "${quarkus.container-image.name}") + @ConfigItem Optional name; /** * The version of the application. */ - @ConfigItem(defaultValue = "${quarkus.container-image.tag}") + @ConfigItem Optional version; /** diff --git a/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithDefaultApplicationVersionTest.java b/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithDefaultApplicationVersionTest.java index 2e547bb0d6415f..ef9e283164db22 100644 --- a/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithDefaultApplicationVersionTest.java +++ b/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithDefaultApplicationVersionTest.java @@ -20,7 +20,8 @@ public class KubernetesWithDefaultApplicationVersionTest { private static final String APP_NAME = "kubernetes-with-default-application-version"; - private static final String EXPECTED_VERSION = "latest"; + private static final String EXPECTED_LABEL_VERSION = "<>"; + private static final String EXPECTED_CONTAINER_IMAGE_VERSION = "latest"; @RegisterExtension static final QuarkusProdModeTest config = new QuarkusProdModeTest() @@ -46,7 +47,7 @@ public void assertGeneratedResources() throws IOException { assertThat(d.getMetadata()).satisfies(m -> { assertThat(m.getName()).isEqualTo(APP_NAME); assertThat(m.getLabels()).contains(entry("app.kubernetes.io/name", APP_NAME), - entry("app.kubernetes.io/version", EXPECTED_VERSION)); + entry("app.kubernetes.io/version", EXPECTED_LABEL_VERSION)); }); assertThat(d.getSpec()).satisfies(deploymentSpec -> { @@ -54,7 +55,7 @@ public void assertGeneratedResources() throws IOException { assertThat(t.getSpec()).satisfies(podSpec -> { assertThat(podSpec.getContainers()).singleElement().satisfies(container -> { // then, we should use `latest` and not `<< unset >>` which gives an exception. - assertThat(container.getImage()).endsWith(APP_NAME + ":" + EXPECTED_VERSION); + assertThat(container.getImage()).endsWith(APP_NAME + ":" + EXPECTED_CONTAINER_IMAGE_VERSION); }); }); }); diff --git a/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithHealthAndJibTest.java b/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithHealthAndJibTest.java index fb3d08f1fd02b4..d5b0d4cf6270ce 100644 --- a/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithHealthAndJibTest.java +++ b/integration-tests/kubernetes/quarkus-standard-way/src/test/java/io/quarkus/it/kubernetes/KubernetesWithHealthAndJibTest.java @@ -27,7 +27,8 @@ public class KubernetesWithHealthAndJibTest { .setApplicationVersion("0.1-SNAPSHOT") .setRun(true) .setLogFileName("k8s.log") - .withConfigurationResource("kubernetes-with-health-and-jib.properties") + .overrideConfigKey("quarkus.http.port", "9000") + .overrideConfigKey("quarkus.container-image.name", "with-health-and-jib") .setForcedDependencies(List.of( Dependency.of("io.quarkus", "quarkus-smallrye-health", Version.getVersion()), Dependency.of("io.quarkus", "quarkus-container-image-jib", Version.getVersion()))); @@ -45,7 +46,7 @@ public void assertGeneratedResources() throws IOException { .deserializeAsList(kubernetesDir.resolve("kubernetes.yml")); assertThat(kubernetesList.get(0)).isInstanceOfSatisfying(Deployment.class, d -> { assertThat(d.getMetadata()).satisfies(m -> { - assertThat(m.getName()).isEqualTo("with-health-and-jib"); + assertThat(m.getName()).isEqualTo("health-and-jib"); }); assertThat(d.getSpec()).satisfies(deploymentSpec -> { diff --git a/integration-tests/kubernetes/quarkus-standard-way/src/test/resources/kubernetes-with-health-and-jib.properties b/integration-tests/kubernetes/quarkus-standard-way/src/test/resources/kubernetes-with-health-and-jib.properties deleted file mode 100644 index 58f175a00a1014..00000000000000 --- a/integration-tests/kubernetes/quarkus-standard-way/src/test/resources/kubernetes-with-health-and-jib.properties +++ /dev/null @@ -1,2 +0,0 @@ -quarkus.http.port=9090 -quarkus.container-image.name=with-health-and-jib