Bug 1974338 - [OCP4.7] maven image doesn't use JAVA_HOME env variable
Summary: [OCP4.7] maven image doesn't use JAVA_HOME env variable
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Jenkins
Version: 4.6
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: ---
: 4.9.0
Assignee: Akram Ben Aissi
QA Contact: Jitendar Singh
Rolfe Dlugy-Hegwer
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-21 12:12 UTC by Mario Abajo
Modified: 2023-09-15 01:10 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-18 17:35:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift jenkins pull 1307 0 None open Bug 1974338: Update README.md with USE_JAVA_VERSION env var explanation 2021-07-13 14:37:18 UTC
Red Hat Issue Tracker RHDEVDOCS-3177 0 Medium Open Tracker for 1861266 - [DOCS] New USE_JAVA_VERSION variable not documented 2021-07-23 11:14:59 UTC
Red Hat Product Errata RHSA-2021:3759 0 None None None 2021-10-18 17:36:09 UTC

Description Mario Abajo 2021-06-21 12:12:31 UTC
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:

Comment 1 Adam Kaplan 2021-06-21 17:58:00 UTC
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

Comment 7 Jitendar Singh 2021-09-06 05:27:47 UTC
VERIFIED

Comment 11 errata-xmlrpc 2021-10-18 17:35:50 UTC
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

Comment 12 Red Hat Bugzilla 2023-09-15 01:10:14 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days


Note You need to log in before you can comment on or make changes to this bug.