From 025c2b1b2adc2c6862c22f564983185337137fb8 Mon Sep 17 00:00:00 2001 From: Jonathan Dowland Date: Fri, 8 Dec 2023 16:24:39 +0000 Subject: [PATCH] [OPENJDK-2588] install tar in the runtime images `oc rsync` requires either `tar` or `rsync` to be present in the container images. `oc cp` requires `tar`. Install `tar` in the runtime images so that both `oc` commands function. This results in a negligible (+0.6MiB) increase in container size. `tar` and `rsync` are already present in the builder images. Signed-off-by: Jonathan Dowland --- modules/tar/module.yaml | 8 ++++++++ tests/features/java/openjdk.feature | 7 +++++++ ubi8-openjdk-11-runtime.yaml | 5 +++-- ubi8-openjdk-17-runtime.yaml | 5 +++-- ubi8-openjdk-21-runtime.yaml | 1 + ubi8-openjdk-8-runtime.yaml | 1 + 6 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 modules/tar/module.yaml diff --git a/modules/tar/module.yaml b/modules/tar/module.yaml new file mode 100644 index 00000000..b73487c5 --- /dev/null +++ b/modules/tar/module.yaml @@ -0,0 +1,8 @@ +schema_version: 1 +name: jboss.container.tar +version: '1.0' +description: Installs the Tar RPM to enable `oc cp` and `oc rsync` + +packages: + install: + - tar diff --git a/tests/features/java/openjdk.feature b/tests/features/java/openjdk.feature index 69ea5728..ae268ba2 100644 --- a/tests/features/java/openjdk.feature +++ b/tests/features/java/openjdk.feature @@ -118,3 +118,10 @@ Feature: Miscellaneous OpenJDK-related unit tests Then container log should not contain libpwquality Then container log should not contain libxkbcommon Then container log should not contain kbd + + @ubi8 + Scenario: Ensure tar is installed (OPENJDK-2588) + When container is started with args + | arg | value | + | command | tar | + Then available container log should not contain command not found diff --git a/ubi8-openjdk-11-runtime.yaml b/ubi8-openjdk-11-runtime.yaml index d2595cc9..8e0d6a55 100644 --- a/ubi8-openjdk-11-runtime.yaml +++ b/ubi8-openjdk-11-runtime.yaml @@ -45,10 +45,11 @@ modules: repositories: - path: modules install: + - name: jboss.container.util.pkg-update - name: jboss.container.openjdk.jre version: "11" - - name: jboss.container.java.jre.run - - name: jboss.container.util.pkg-update + - name: jboss.container.tar + - name: jboss.container.java.jre.run help: add: true diff --git a/ubi8-openjdk-17-runtime.yaml b/ubi8-openjdk-17-runtime.yaml index cdb9dc7b..dc8aa304 100644 --- a/ubi8-openjdk-17-runtime.yaml +++ b/ubi8-openjdk-17-runtime.yaml @@ -45,10 +45,11 @@ modules: repositories: - path: modules install: + - name: jboss.container.util.pkg-update - name: jboss.container.openjdk.jre version: "17" - - name: jboss.container.java.jre.run - - name: jboss.container.util.pkg-update + - name: jboss.container.tar + - name: jboss.container.java.jre.run help: add: true diff --git a/ubi8-openjdk-21-runtime.yaml b/ubi8-openjdk-21-runtime.yaml index bcb94d18..5340bc55 100644 --- a/ubi8-openjdk-21-runtime.yaml +++ b/ubi8-openjdk-21-runtime.yaml @@ -46,6 +46,7 @@ modules: - path: modules install: - name: jboss.container.util.pkg-update + - name: jboss.container.tar - name: jboss.container.openjdk.jre version: "21" - name: jboss.container.java.jre.run diff --git a/ubi8-openjdk-8-runtime.yaml b/ubi8-openjdk-8-runtime.yaml index c380802b..25f95f05 100644 --- a/ubi8-openjdk-8-runtime.yaml +++ b/ubi8-openjdk-8-runtime.yaml @@ -48,6 +48,7 @@ modules: - name: jboss.container.openjdk.jre version: "8" - name: jboss.container.java.jre.run + - name: jboss.container.tar - name: jboss.container.util.pkg-update help: