Description of problem: As of version of openshift 4.5 maven agent image was built using Rhel 7 with maven version 3.5. It was possible to switch java version to 1.8 just adding the JAVA_HOME variable to the pod running the image. But starting with OCP 4.6, the images are now based on rhel 8 and maven 3.6, with this change in version there is also a "/etc/java/maven.conf" containing the JAVA_HOME variable already set to java-11. This seams to take any precedence so setting env variables in the pod to switch the java version is no longer possible. Version-Release number of selected component (if applicable): OCP 4.6 How reproducible: Always Steps to Reproduce: 1. 2. 3. Actual results: Java-11 is always used Expected results: Java-11 used by default but possibility to change to java-8 would be expected as with previous versions. Additional info:
JAVA_HOME is not listed as one of the environment variables available to the maven agent image [1]. The maven agent image supports switching the java version via the USE_JAVA_VERSION environment variable. However, this env var is not documented [2]. See also Bug #1861266. [1] https://docs.openshift.com/container-platform/4.7/openshift_images/using_images/images-other-jenkins-agent.html#images-other-jenkins-agent-env-var_images-other-jenkins-agent [2] https://github.com/openshift/jenkins/blob/master/slave-base/contrib/bin/run-jnlp-client#L16
VERIFIED
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: OpenShift Container Platform 4.9.0 bug fix and security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2021:3759
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days