Skip to content

Commit

Permalink
deps: Quarkus native base image uses UBI 8.7
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Nuri <marc@marcnuri.com>
  • Loading branch information
manusa committed Jun 21, 2023
1 parent 909b378 commit b955075
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 24 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ void inOpenShift_shouldReturnS2iFrom() {
// When
final List<ImageConfiguration> result = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true);
// Then
assertBuildFrom(result, "quarkus/s2i");
assertThat(result).singleElement()
.extracting("buildConfiguration.from")
.isEqualTo("quarkus/s2i");
}
}

Expand All @@ -159,7 +161,9 @@ void inKubernetes_shouldReturnDockerFrom() {
// When
final List<ImageConfiguration> result = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true);
// Then
assertBuildFrom(result, "quarkus/docker");
assertThat(result).singleElement()
.extracting("buildConfiguration.from")
.isEqualTo("quarkus/docker");
}
}

Expand All @@ -170,9 +174,11 @@ void inOpenShift_shouldReturnNativeS2iFrom() throws IOException {
in(RuntimeMode.OPENSHIFT);
withNativeBinaryInTarget();
// When
final List<ImageConfiguration> resultImages = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true);
final List<ImageConfiguration> 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
Expand All @@ -182,9 +188,11 @@ void customize_inKubernetes_shouldReturnNativeUbiFrom() throws IOException {
in(RuntimeMode.KUBERNETES);
withNativeBinaryInTarget();
// When
final List<ImageConfiguration> resultImages = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true);
final List<ImageConfiguration> 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
Expand Down Expand Up @@ -223,9 +231,11 @@ void withConfiguredImage_shouldReturnConfigured() {
// Given
config.getConfig().put("quarkus", Collections.singletonMap("from", BASE_JAVA_IMAGE));
// When
List<ImageConfiguration> resultImages = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true);
List<ImageConfiguration> 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
Expand All @@ -235,9 +245,11 @@ void withConfiguredImageAndNativeArtifact_shouldReturnConfiguredNative() throws
config.getConfig().put("quarkus", Collections.singletonMap("from", BASE_NATIVE_IMAGE));
withNativeBinaryInTarget();
// When
List<ImageConfiguration> resultImages = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true);
List<ImageConfiguration> 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
Expand All @@ -246,9 +258,11 @@ void withConfiguredInProperties_shouldReturnConfigured() {
// Given
projectProps.put("jkube.generator.quarkus.from", BASE_JAVA_IMAGE);
// When
List<ImageConfiguration> resultImages = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true);
List<ImageConfiguration> 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
Expand All @@ -257,9 +271,11 @@ void withConfiguredInPropertiesAndNativeArtifact_shouldReturnConfiguredNative()
projectProps.put("jkube.generator.quarkus.from", BASE_NATIVE_IMAGE);
withNativeBinaryInTarget();
// When
List<ImageConfiguration> resultImages = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true);
List<ImageConfiguration> result = new QuarkusGenerator(ctx).customize(new ArrayList<>(), true);
// Then
assertBuildFrom(resultImages, BASE_NATIVE_IMAGE);
assertThat(result).singleElement()
.extracting("buildConfiguration.from")
.isEqualTo(BASE_NATIVE_IMAGE);
}
}

Expand Down Expand Up @@ -482,14 +498,6 @@ void withManualFastJarConfigAndLegacyInTarget_shouldThrowException() throws IOEx
}
}

private void assertBuildFrom (List<ImageConfiguration> 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"));
}
Expand Down
4 changes: 2 additions & 2 deletions jkube-kit/parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@
<image.helidon-native.upstream.docker>registry.access.redhat.com/ubi8/ubi-minimal:${version.image.ubi-minimal}</image.helidon-native.upstream.docker>
<image.helidon-native.upstream.istag>registry.access.redhat.com/ubi8/ubi-minimal:${version.image.ubi-minimal}</image.helidon-native.upstream.istag>

<!-- Quarkus --> <!-- TODO: Bump UBI minimal image -->
<!-- Quarkus -->
<image.quarkus-native.upstream.s2i>quay.io/quarkus/ubi-quarkus-native-binary-s2i:1.0</image.quarkus-native.upstream.s2i>
<image.quarkus-native.upstream.docker>registry.access.redhat.com/ubi8/ubi-minimal:8.6</image.quarkus-native.upstream.docker>
<image.quarkus-native.upstream.docker>registry.access.redhat.com/ubi8/ubi-minimal:${version.image.ubi-minimal}</image.quarkus-native.upstream.docker>
<image.quarkus-native.upstream.istag>quay.io/quarkus/ubi-quarkus-native-binary-s2i:1.0</image.quarkus-native.upstream.istag>

<!-- karaf -->
Expand Down

0 comments on commit b955075

Please sign in to comment.