From b955075740fb4f9a0f68123130eb0c3da5627731 Mon Sep 17 00:00:00 2001 From: Marc Nuri Date: Wed, 21 Jun 2023 06:51:36 +0200 Subject: [PATCH] deps: Quarkus native base image uses UBI 8.7 Signed-off-by: Marc Nuri --- CHANGELOG.md | 1 + .../generator/QuarkusGeneratorTest.java | 52 +++++++++++-------- jkube-kit/parent/pom.xml | 4 +- 3 files changed, 33 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 550cf93d46..8b3179e58b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ Usage: * Fix #1714: Add HelidonGenerator to add opinionated container image for Helidon applications * Fix #1985: Update outdated methods in Spring Boot CRD Maven Quickstart * Fix #2224: Quarkus native base image read from properties (configurable) +* Fix #2228: Quarkus native base image uses UBI 8.7 ### 1.13.1 (2023-06-16) * Fix #2212: Bump Kubernetes Client version to 6.7.2 (fixes issues when trace-logging OpenShift builds -regression in 6.7.1-) diff --git a/jkube-kit/jkube-kit-quarkus/src/test/java/org/eclipse/jkube/quarkus/generator/QuarkusGeneratorTest.java b/jkube-kit/jkube-kit-quarkus/src/test/java/org/eclipse/jkube/quarkus/generator/QuarkusGeneratorTest.java index cb318c8056..1241545134 100644 --- a/jkube-kit/jkube-kit-quarkus/src/test/java/org/eclipse/jkube/quarkus/generator/QuarkusGeneratorTest.java +++ b/jkube-kit/jkube-kit-quarkus/src/test/java/org/eclipse/jkube/quarkus/generator/QuarkusGeneratorTest.java @@ -145,7 +145,9 @@ void inOpenShift_shouldReturnS2iFrom() { // When final List result = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true); // Then - assertBuildFrom(result, "quarkus/s2i"); + assertThat(result).singleElement() + .extracting("buildConfiguration.from") + .isEqualTo("quarkus/s2i"); } } @@ -159,7 +161,9 @@ void inKubernetes_shouldReturnDockerFrom() { // When final List result = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true); // Then - assertBuildFrom(result, "quarkus/docker"); + assertThat(result).singleElement() + .extracting("buildConfiguration.from") + .isEqualTo("quarkus/docker"); } } @@ -170,9 +174,11 @@ void inOpenShift_shouldReturnNativeS2iFrom() throws IOException { in(RuntimeMode.OPENSHIFT); withNativeBinaryInTarget(); // When - final List resultImages = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true); + final List result = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true); // Then - assertBuildFrom(resultImages, "quay.io/quarkus/ubi-quarkus-native-binary-s2i:1.0"); + assertThat(result).singleElement() + .extracting("buildConfiguration.from") + .isEqualTo("quay.io/quarkus/ubi-quarkus-native-binary-s2i:1.0"); } @Test @@ -182,9 +188,11 @@ void customize_inKubernetes_shouldReturnNativeUbiFrom() throws IOException { in(RuntimeMode.KUBERNETES); withNativeBinaryInTarget(); // When - final List resultImages = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true); + final List result = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true); // Then - assertBuildFrom(resultImages, "registry.access.redhat.com/ubi8/ubi-minimal:8.6"); + assertThat(result).singleElement() + .extracting("buildConfiguration.from").asString() + .startsWith("registry.access.redhat.com/ubi8/ubi-minimal:"); } @Test @@ -223,9 +231,11 @@ void withConfiguredImage_shouldReturnConfigured() { // Given config.getConfig().put("quarkus", Collections.singletonMap("from", BASE_JAVA_IMAGE)); // When - List resultImages = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true); + List result = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true); // Then - assertBuildFrom(resultImages, BASE_JAVA_IMAGE); + assertThat(result).singleElement() + .extracting("buildConfiguration.from") + .isEqualTo(BASE_JAVA_IMAGE); } @Test @@ -235,9 +245,11 @@ void withConfiguredImageAndNativeArtifact_shouldReturnConfiguredNative() throws config.getConfig().put("quarkus", Collections.singletonMap("from", BASE_NATIVE_IMAGE)); withNativeBinaryInTarget(); // When - List resultImages = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true); + List result = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true); // Then - assertBuildFrom(resultImages, BASE_NATIVE_IMAGE); + assertThat(result).singleElement() + .extracting("buildConfiguration.from") + .isEqualTo(BASE_NATIVE_IMAGE); } @Test @@ -246,9 +258,11 @@ void withConfiguredInProperties_shouldReturnConfigured() { // Given projectProps.put("jkube.generator.quarkus.from", BASE_JAVA_IMAGE); // When - List resultImages = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true); + List result = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true); // Then - assertBuildFrom(resultImages, BASE_JAVA_IMAGE); + assertThat(result).singleElement() + .extracting("buildConfiguration.from") + .isEqualTo(BASE_JAVA_IMAGE); } @Test @@ -257,9 +271,11 @@ void withConfiguredInPropertiesAndNativeArtifact_shouldReturnConfiguredNative() projectProps.put("jkube.generator.quarkus.from", BASE_NATIVE_IMAGE); withNativeBinaryInTarget(); // When - List resultImages = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true); + List result = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true); // Then - assertBuildFrom(resultImages, BASE_NATIVE_IMAGE); + assertThat(result).singleElement() + .extracting("buildConfiguration.from") + .isEqualTo(BASE_NATIVE_IMAGE); } } @@ -482,14 +498,6 @@ void withManualFastJarConfigAndLegacyInTarget_shouldThrowException() throws IOEx } } - private void assertBuildFrom (List resultImages, String baseImage) { - assertThat(resultImages) - .isNotNull() - .hasSize(1) - .extracting("buildConfiguration.from") - .containsExactly(baseImage); - } - private void withNativeBinaryInTarget() throws IOException { Files.createFile(targetDir.toPath().resolve("sample-runner")); } diff --git a/jkube-kit/parent/pom.xml b/jkube-kit/parent/pom.xml index 15ea283d98..60b642f827 100644 --- a/jkube-kit/parent/pom.xml +++ b/jkube-kit/parent/pom.xml @@ -106,9 +106,9 @@ registry.access.redhat.com/ubi8/ubi-minimal:${version.image.ubi-minimal} registry.access.redhat.com/ubi8/ubi-minimal:${version.image.ubi-minimal} - + quay.io/quarkus/ubi-quarkus-native-binary-s2i:1.0 - registry.access.redhat.com/ubi8/ubi-minimal:8.6 + registry.access.redhat.com/ubi8/ubi-minimal:${version.image.ubi-minimal} quay.io/quarkus/ubi-quarkus-native-binary-s2i:1.0