From 4f67aa36afb34a95ee4674dbb2c9edcf7313166d Mon Sep 17 00:00:00 2001 From: Jonathan Dowland Date: Tue, 26 Nov 2024 16:56:48 +0000 Subject: [PATCH] [OPENJDK-3038] echo out Tech Preview warning The jlink feature will initially ship as TP. Repurpose older unit test to check for the TP warning (older test is redundant as it only worked if jmods are installed). The test depends upon this being merged first: https://github.com/cekit/behave-test-steps/pull/73 https://issues.redhat.com/browse/OPENJDK-3038 Signed-off-by: Jonathan Dowland --- .../opt/jboss/container/java/jlink/preflight.sh | 11 +++++++++++ modules/jlink/tests/features/jlink.feature | 8 ++++---- modules/s2i/bash/artifacts/usr/local/s2i/assemble | 1 + 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/modules/jlink/artifacts/opt/jboss/container/java/jlink/preflight.sh b/modules/jlink/artifacts/opt/jboss/container/java/jlink/preflight.sh index ab7aba35..67154d01 100644 --- a/modules/jlink/artifacts/opt/jboss/container/java/jlink/preflight.sh +++ b/modules/jlink/artifacts/opt/jboss/container/java/jlink/preflight.sh @@ -1,3 +1,14 @@ +jlink_techpreview_warning() +{ + { + echo "WARNING WARNING WARNING" + echo " Jlink integration is a Tech Preview feature!" + echo " See " + echo " for more information." + echo "WARNING WARNING WARNING" + } >&2 +} + jlink_preflight_check() { # preflight check: do we have what we need? diff --git a/modules/jlink/tests/features/jlink.feature b/modules/jlink/tests/features/jlink.feature index 89c61800..12d2a1ac 100644 --- a/modules/jlink/tests/features/jlink.feature +++ b/modules/jlink/tests/features/jlink.feature @@ -1,12 +1,12 @@ @ubi9/openjdk-17 @ubi9/openjdk-21 Feature: Openshift OpenJDK S2I tests (jlink specific) -Scenario: Ensure jlinked builder is used to build the containerized application image - Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from quarkus-quickstarts/getting-started-3.0.1.Final-nos2i + + Scenario: tech preview warning is printed (OPENJDK-3038) + Given failing s2i build https://github.com/jboss-container-images/openjdk-test-applications from spring-boot-sample-simple/target using master | variable | value | | S2I_ENABLE_JLINK | true | - | QUARKUS_PACKAGE_TYPE| uber-jar | - Then run ls /tmp/jre in container and check its output for bin + Then s2i build log should contain Jlink integration is a Tech Preview feature Scenario: Ensure S2I_ENABLE_JLINK is not set to true Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from quarkus-quickstarts/getting-started-3.0.1.Final-nos2i diff --git a/modules/s2i/bash/artifacts/usr/local/s2i/assemble b/modules/s2i/bash/artifacts/usr/local/s2i/assemble index 76999b56..e2f1e4ef 100644 --- a/modules/s2i/bash/artifacts/usr/local/s2i/assemble +++ b/modules/s2i/bash/artifacts/usr/local/s2i/assemble @@ -22,6 +22,7 @@ setup_java_app_and_lib if [ "$S2I_ENABLE_JLINK" = "true" ]; then source "${JBOSS_CONTAINER_JAVA_JLINK_MODULE}/preflight.sh" + jlink_techpreview_warning jlink_preflight_check source "${JBOSS_CONTAINER_JAVA_JLINK_MODULE}/mkdeps.sh"