Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update codestarts to use openjdk container images 1.15 #32753

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -16,7 +16,7 @@ void testImageWithJava11() {
Path path = getPath("openjdk-11-runtime");
var result = sut.determine(path);
assertThat(result).hasValueSatisfying(v -> {
assertThat(v.getBaseImage()).isEqualTo("registry.access.redhat.com/ubi8/openjdk-11-runtime:1.14");
assertThat(v.getBaseImage()).isEqualTo("registry.access.redhat.com/ubi8/openjdk-11-runtime:1.15");
assertThat(v.getJavaVersion()).isEqualTo(11);
});
}
Expand All @@ -26,7 +26,7 @@ void testImageWithJava17() {
Path path = getPath("openjdk-17-runtime");
var result = sut.determine(path);
assertThat(result).hasValueSatisfying(v -> {
assertThat(v.getBaseImage()).isEqualTo("registry.access.redhat.com/ubi8/openjdk-17-runtime:1.14");
assertThat(v.getBaseImage()).isEqualTo("registry.access.redhat.com/ubi8/openjdk-17-runtime:1.15");
assertThat(v.getJavaVersion()).isEqualTo(17);
});
}
Expand Down
@@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi8/openjdk-11-runtime:1.14
FROM registry.access.redhat.com/ubi8/openjdk-11-runtime:1.15

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'

Expand Down
@@ -1,5 +1,5 @@
# Use Java 17 base image
FROM registry.access.redhat.com/ubi8/openjdk-17-runtime:1.14
FROM registry.access.redhat.com/ubi8/openjdk-17-runtime:1.15

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'

Expand Down
Expand Up @@ -16,9 +16,9 @@ public class JibConfig {
/**
* The base image to be used when a container image is being produced for the jar build.
*
* When the application is built against Java 17 or higher, {@code registry.access.redhat.com/ubi8/openjdk-17-runtime:1.14}
* When the application is built against Java 17 or higher, {@code registry.access.redhat.com/ubi8/openjdk-17-runtime:1.15}
* is used as the default.
* Otherwise {@code registry.access.redhat.com/ubi8/openjdk-11-runtime:1.14} is used as the default.
* Otherwise {@code registry.access.redhat.com/ubi8/openjdk-11-runtime:1.15} is used as the default.
*/
@ConfigItem
public Optional<String> baseJvmImage;
Expand Down
Expand Up @@ -89,8 +89,8 @@ public class JibProcessor {
private static final IsClassPredicate IS_CLASS_PREDICATE = new IsClassPredicate();
private static final String BINARY_NAME_IN_CONTAINER = "application";

private static final String JAVA_17_BASE_IMAGE = "registry.access.redhat.com/ubi8/openjdk-17-runtime:1.14";
private static final String JAVA_11_BASE_IMAGE = "registry.access.redhat.com/ubi8/openjdk-11-runtime:1.14";
private static final String JAVA_17_BASE_IMAGE = "registry.access.redhat.com/ubi8/openjdk-17-runtime:1.15";
private static final String JAVA_11_BASE_IMAGE = "registry.access.redhat.com/ubi8/openjdk-11-runtime:1.15";
private static final String DEFAULT_BASE_IMAGE_USER = "185";

private static final String OPENTELEMETRY_CONTEXT_CONTEXT_STORAGE_PROVIDER_SYS_PROP = "io.opentelemetry.context.contextStorageProvider";
Expand Down
Expand Up @@ -15,8 +15,8 @@
@ConfigRoot(phase = ConfigPhase.BUILD_TIME)
public class OpenshiftConfig {

public static final String DEFAULT_BASE_JVM_JDK11_IMAGE = "registry.access.redhat.com/ubi8/openjdk-11:1.14";
public static final String DEFAULT_BASE_JVM_JDK17_IMAGE = "registry.access.redhat.com/ubi8/openjdk-17:1.14";
public static final String DEFAULT_BASE_JVM_JDK11_IMAGE = "registry.access.redhat.com/ubi8/openjdk-11:1.15";
public static final String DEFAULT_BASE_JVM_JDK17_IMAGE = "registry.access.redhat.com/ubi8/openjdk-17:1.15";
public static final String DEFAULT_BASE_NATIVE_IMAGE = "quay.io/quarkus/ubi-quarkus-native-binary-s2i:2.0";
public static final String DEFAULT_NATIVE_TARGET_FILENAME = "application";

Expand Down Expand Up @@ -46,9 +46,9 @@ public static String getDefaultJvmImage(CompiledJavaVersionBuildItem.JavaVersion
/**
* The base image to be used when a container image is being produced for the jar build.
*
* When the application is built against Java 17 or higher, {@code registry.access.redhat.com/ubi8/openjdk-17:1.14}
* When the application is built against Java 17 or higher, {@code registry.access.redhat.com/ubi8/openjdk-17:1.15}
* is used as the default.
* Otherwise {@code registry.access.redhat.com/ubi8/openjdk-11:1.14} is used as the default.
* Otherwise {@code registry.access.redhat.com/ubi8/openjdk-11:1.15} is used as the default.
*/
@ConfigItem
public Optional<String> baseJvmImage;
Expand Down
Expand Up @@ -12,8 +12,8 @@
@ConfigRoot(phase = ConfigPhase.BUILD_TIME)
public class S2iConfig {

public static final String DEFAULT_BASE_JVM_JDK11_IMAGE = "registry.access.redhat.com/ubi8/openjdk-11:1.14";
public static final String DEFAULT_BASE_JVM_JDK17_IMAGE = "registry.access.redhat.com/ubi8/openjdk-17:1.14";
public static final String DEFAULT_BASE_JVM_JDK11_IMAGE = "registry.access.redhat.com/ubi8/openjdk-11:1.15";
public static final String DEFAULT_BASE_JVM_JDK17_IMAGE = "registry.access.redhat.com/ubi8/openjdk-17:1.15";
public static final String DEFAULT_BASE_NATIVE_IMAGE = "quay.io/quarkus/ubi-quarkus-native-binary-s2i:2.0";
public static final String DEFAULT_NATIVE_TARGET_FILENAME = "application";

Expand Down Expand Up @@ -41,9 +41,9 @@ public static String getDefaultJvmImage(CompiledJavaVersionBuildItem.JavaVersion
/**
* The base image to be used when a container image is being produced for the jar build.
*
* When the application is built against Java 17 or higher, {@code registry.access.redhat.com/ubi8/openjdk-17:1.14}
* When the application is built against Java 17 or higher, {@code registry.access.redhat.com/ubi8/openjdk-17:1.15}
* is used as the default.
* Otherwise {@code registry.access.redhat.com/ubi8/openjdk-11:1.14} is used as the default.
* Otherwise {@code registry.access.redhat.com/ubi8/openjdk-11:1.15} is used as the default.
*/
@ConfigItem
public Optional<String> baseJvmImage;
Expand Down
Expand Up @@ -77,7 +77,7 @@
# accessed directly. (example: "foo.example.com,bar.example.com")
#
###
FROM registry.access.redhat.com/ubi8/openjdk-{java.version}:1.14
FROM registry.access.redhat.com/ubi8/openjdk-{java.version}:1.15

ENV LANGUAGE='en_US:en'

Expand Down
Expand Up @@ -297,13 +297,13 @@ private void checkDockerfilesWithMaven(Path projectDir) {
assertThat(projectDir.resolve("src/main/docker/Dockerfile.jvm")).exists()
.satisfies(checkContains("./mvnw package"))
.satisfies(checkContains("docker build -f src/main/docker/Dockerfile.jvm"))
.satisfies(checkContains("registry.access.redhat.com/ubi8/openjdk-11:1.14"))//TODO: make a teste to java17
.satisfies(checkContains("registry.access.redhat.com/ubi8/openjdk-11:1.15"))//TODO: make a test for java17
.satisfies(checkContains("ENV JAVA_APP_JAR=\"/deployments/quarkus-run.jar\""))
.satisfies(checkNotContains("ENTRYPOINT"));
assertThat(projectDir.resolve("src/main/docker/Dockerfile.legacy-jar")).exists()
.satisfies(checkContains("./mvnw package -Dquarkus.package.type=legacy-jar"))
.satisfies(checkContains("docker build -f src/main/docker/Dockerfile.legacy-jar"))
.satisfies(checkContains("registry.access.redhat.com/ubi8/openjdk-11:1.14"))
.satisfies(checkContains("registry.access.redhat.com/ubi8/openjdk-11:1.15"))
.satisfies(checkContains("EXPOSE 8080"))
.satisfies(checkContains("USER 185"))
.satisfies(checkContains("ENV JAVA_APP_JAR=\"/deployments/quarkus-run.jar\""))
Expand Down