From cf906c71d6916b17e09b94a1cff0d9ffd663f830 Mon Sep 17 00:00:00 2001 From: Jonathan Dowland Date: Tue, 13 Feb 2024 11:15:40 +0000 Subject: [PATCH 1/2] [OPENJDK-2587] Ensure pkg-update runs before tzdata module The tzdata module, which calls "microdnf reinstall tzdata", may fail if the base image has an installed tzdata RPM that is no longer available on the mirrors / is out-of-date. For example base image installed RPM: tzdata-2023d-1.el8.noarch attempt to build ubi8-openjdk-17 (where tzdata module is first) "Installed package tzdata-2023d-1.el8.noarch not available" The fix is to move the pkg-update module to be earlier. Do this for all images, for consistency, place pkg-update first. (This matches the ubi9 images) I have not included a unit test as I am not sure how to approach mocking older/newer RPM versions in a controllable way. Signed-off-by: Jonathan Dowland --- ubi8-openjdk-11.yaml | 2 +- ubi8-openjdk-17.yaml | 2 +- ubi8-openjdk-8-runtime.yaml | 2 +- ubi8-openjdk-8.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ubi8-openjdk-11.yaml b/ubi8-openjdk-11.yaml index 83e56157..297e7ac4 100644 --- a/ubi8-openjdk-11.yaml +++ b/ubi8-openjdk-11.yaml @@ -47,6 +47,7 @@ modules: repositories: - path: modules install: + - name: jboss.container.util.pkg-update - name: jboss.container.openjdk.jdk version: "11" - name: jboss.container.prometheus @@ -55,7 +56,6 @@ modules: - name: jboss.container.maven version: "3.8.11" - name: jboss.container.java.s2i.bash - - name: jboss.container.util.pkg-update - name: jboss.container.util.tzdata # required due to jolokia - name: jboss.container.java.singleton-jdk diff --git a/ubi8-openjdk-17.yaml b/ubi8-openjdk-17.yaml index 1e1c6609..0284a3af 100644 --- a/ubi8-openjdk-17.yaml +++ b/ubi8-openjdk-17.yaml @@ -47,6 +47,7 @@ modules: repositories: - path: modules install: + - name: jboss.container.util.pkg-update - name: jboss.container.openjdk.jdk version: "17" - name: jboss.container.prometheus @@ -55,7 +56,6 @@ modules: version: "3.8.17" - name: jboss.container.util.tzdata - name: jboss.container.java.s2i.bash - - name: jboss.container.util.pkg-update help: add: true diff --git a/ubi8-openjdk-8-runtime.yaml b/ubi8-openjdk-8-runtime.yaml index cc5e490f..325990f8 100644 --- a/ubi8-openjdk-8-runtime.yaml +++ b/ubi8-openjdk-8-runtime.yaml @@ -45,11 +45,11 @@ modules: repositories: - path: modules install: + - name: jboss.container.util.pkg-update - name: jboss.container.openjdk.jre version: "8" - name: jboss.container.java.jre.run - name: jboss.container.tar - - name: jboss.container.util.pkg-update - name: jboss.container.util.tzdata help: diff --git a/ubi8-openjdk-8.yaml b/ubi8-openjdk-8.yaml index 8ddeed35..c2753e45 100644 --- a/ubi8-openjdk-8.yaml +++ b/ubi8-openjdk-8.yaml @@ -47,6 +47,7 @@ modules: repositories: - path: modules install: + - name: jboss.container.util.pkg-update - name: jboss.container.openjdk.jdk version: "8" - name: jboss.container.prometheus @@ -55,7 +56,6 @@ modules: - name: jboss.container.maven version: "3.8.8" - name: jboss.container.java.s2i.bash - - name: jboss.container.util.pkg-update - name: jboss.container.util.tzdata help: From 95d3bc4d15fe7e21d5f2515d4722143a7ccee0aa Mon Sep 17 00:00:00 2001 From: Jonathan Dowland Date: Tue, 13 Feb 2024 11:46:38 +0000 Subject: [PATCH 2/2] [OPENJDK-2587] tzdata module depend upon pkg-update Document (as a comment) the issue of ordering pkg-update and tzdata modules. Depend upon the pkg-update module from tzdata, to ensure it runs first always. This has no effect on the container images as they stand now, since they have pkg-config occurring first already, but if that changed, this would catch it. Signed-off-by: Jonathan Dowland --- modules/util/tzdata/module.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/util/tzdata/module.yaml b/modules/util/tzdata/module.yaml index bc669456..dd0d1a11 100644 --- a/modules/util/tzdata/module.yaml +++ b/modules/util/tzdata/module.yaml @@ -1,7 +1,14 @@ schema_version: 1 name: jboss.container.util.tzdata version: '1.0' -description: Reinstall the tzdata package, to ensure zoneinfo is present +description: Reinstall the tzdata package, to ensure zoneinfo is present. + +# if the base image tzdata version is not available on the RPM mirrors (such as +# when it has been updated), the reinstall action will fail. To prevent this, +# run pkg-update first. +modules: + install: + - name: jboss.container.util.pkg-update execute: - script: execute.sh