From e304a56801a94764e47553ccfd61639a113d67e8 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Fri, 15 Nov 2024 13:24:54 +0100 Subject: [PATCH] Add support for NodeJS-22 imagestreams. RHEL-9.5.0 reached GA and imagestream is present in registry. The commit allows to test it. Signed-off-by: Petr "Stone" Hracek --- imagestreams/imagestreams.yaml | 21 +++++-- imagestreams/nodejs-centos.json | 65 ++++++++++++++++++-- imagestreams/nodejs-rhel-aarch64.json | 65 ++++++++++++++++++-- imagestreams/nodejs-rhel.json | 65 ++++++++++++++++++-- test/run-openshift-remote-cluster | 5 -- test/test_latest_imagestreams.py | 4 -- test/test_nodejs_ex_templates.py | 4 -- test/test_shared_helm_nodejs_application.py | 10 +-- test/test_shared_helm_nodejs_imagestreams.py | 6 +- 9 files changed, 204 insertions(+), 41 deletions(-) diff --git a/imagestreams/imagestreams.yaml b/imagestreams/imagestreams.yaml index 29f93e2d..80a2e1fd 100644 --- a/imagestreams/imagestreams.yaml +++ b/imagestreams/imagestreams.yaml @@ -9,13 +9,13 @@ https://github.com/sclorg/s2i-nodejs-container/blob/master/APP_VERSION/README.md. imagestream_files: - filename: nodejs-centos.json - latest: "20-ubi9" + latest: "22-ubi9" distros: - name: UBI 8 app_versions: ["18", "18-minimal", "20", "20-minimal"] - name: UBI 9 - app_versions: ["18", "18-minimal", "20", "20-minimal"] + app_versions: ["18", "18-minimal", "20", "20-minimal", "22", "22-minimal"] custom_tags: - name: "18-ubi8-minimal" distro: UBI 8 @@ -29,15 +29,18 @@ - name: "20-ubi9-minimal" distro: UBI 9 app_version: "20-minimal" + - name: "22-ubi9-minimal" + distro: UBI 9 + app_version: "22-minimal" - filename: nodejs-rhel.json - latest: "20-ubi9" + latest: "22-ubi9" distros: - name: UBI 8 app_versions: ["18", "18-minimal", "20", "20-minimal"] - name: UBI 9 - app_versions: ["18", "18-minimal", "20", "20-minimal"] + app_versions: ["18", "18-minimal", "20", "20-minimal", "22", "22-minimal"] # these are non standard tags, maintained for backwards compatibility custom_tags: - name: "18-ubi8-minimal" @@ -52,15 +55,18 @@ - name: "20-ubi9-minimal" distro: UBI 9 app_version: "20-minimal" + - name: "22-ubi9-minimal" + distro: UBI 9 + app_version: "22-minimal" - filename: nodejs-rhel-aarch64.json - latest: "20-ubi9" + latest: "22-ubi9" distros: - name: UBI 8 app_versions: ["18", "18-minimal", "20", "20-minimal"] - name: UBI 9 - app_versions: ["18", "18-minimal", "20", "20-minimal"] + app_versions: ["18", "18-minimal", "20", "20-minimal", "22", "22-minimal"] custom_tags: - name: "18-ubi8-minimal" distro: UBI 8 @@ -74,4 +80,7 @@ - name: "20-ubi9-minimal" distro: UBI 9 app_version: "20-minimal" + - name: "22-ubi9-minimal" + distro: UBI 9 + app_version: "22-minimal" ... diff --git a/imagestreams/nodejs-centos.json b/imagestreams/nodejs-centos.json index 3398baab..9a11ddbb 100644 --- a/imagestreams/nodejs-centos.json +++ b/imagestreams/nodejs-centos.json @@ -161,6 +161,44 @@ "type": "Local" } }, + { + "name": "22-ubi9", + "annotations": { + "openshift.io/display-name": "Node.js 22 (UBI 9)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run Node.js 22 applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/22/README.md.", + "iconClass": "icon-nodejs", + "tags": "builder,nodejs", + "version": "22", + "sampleRepo": "https://github.com/sclorg/nodejs-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/ubi9/nodejs-22:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, + { + "name": "22-minimal-ubi9", + "annotations": { + "openshift.io/display-name": "Node.js 22-minimal (UBI 9)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run Node.js 22-minimal applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/22-minimal/README.md.", + "iconClass": "icon-nodejs", + "tags": "builder,nodejs", + "version": "22-minimal", + "sampleRepo": "https://github.com/sclorg/nodejs-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/ubi9/nodejs-22-minimal:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, { "name": "18-ubi8-minimal", "annotations": { @@ -237,20 +275,39 @@ "type": "Local" } }, + { + "name": "22-ubi9-minimal", + "annotations": { + "openshift.io/display-name": "Node.js 22-minimal (UBI 9)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run Node.js 22-minimal applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/22-minimal/README.md.", + "iconClass": "icon-nodejs", + "tags": "builder,nodejs", + "version": "22-minimal", + "sampleRepo": "https://github.com/sclorg/nodejs-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/ubi9/nodejs-22-minimal:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, { "name": "latest", "annotations": { - "openshift.io/display-name": "Node.js 20 (Latest)", + "openshift.io/display-name": "Node.js 22 (Latest)", "openshift.io/provider-display-name": "Red Hat, Inc.", - "description": "Build and run Node.js 20 applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/20/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", + "description": "Build and run Node.js 22 applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/22/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", "iconClass": "icon-nodejs", "tags": "builder,nodejs", - "version": "20", + "version": "22", "sampleRepo": "https://github.com/sclorg/nodejs-ex.git" }, "from": { "kind": "ImageStreamTag", - "name": "20-ubi9" + "name": "22-ubi9" }, "referencePolicy": { "type": "Local" diff --git a/imagestreams/nodejs-rhel-aarch64.json b/imagestreams/nodejs-rhel-aarch64.json index 02b1b0d4..7dbd3b5c 100644 --- a/imagestreams/nodejs-rhel-aarch64.json +++ b/imagestreams/nodejs-rhel-aarch64.json @@ -161,6 +161,44 @@ "type": "Local" } }, + { + "name": "22-ubi9", + "annotations": { + "openshift.io/display-name": "Node.js 22 (UBI 9)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run Node.js 22 applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/22/README.md.", + "iconClass": "icon-nodejs", + "tags": "builder,nodejs", + "version": "22", + "sampleRepo": "https://github.com/sclorg/nodejs-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.redhat.io/ubi9/nodejs-22:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, + { + "name": "22-minimal-ubi9", + "annotations": { + "openshift.io/display-name": "Node.js 22-minimal (UBI 9)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run Node.js 22-minimal applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/22-minimal/README.md.", + "iconClass": "icon-nodejs", + "tags": "builder,nodejs", + "version": "22-minimal", + "sampleRepo": "https://github.com/sclorg/nodejs-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.redhat.io/ubi9/nodejs-22-minimal:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, { "name": "18-ubi8-minimal", "annotations": { @@ -237,20 +275,39 @@ "type": "Local" } }, + { + "name": "22-ubi9-minimal", + "annotations": { + "openshift.io/display-name": "Node.js 22-minimal (UBI 9)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run Node.js 22-minimal applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/22-minimal/README.md.", + "iconClass": "icon-nodejs", + "tags": "builder,nodejs", + "version": "22-minimal", + "sampleRepo": "https://github.com/sclorg/nodejs-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.redhat.io/ubi9/nodejs-22-minimal:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, { "name": "latest", "annotations": { - "openshift.io/display-name": "Node.js 20 (Latest)", + "openshift.io/display-name": "Node.js 22 (Latest)", "openshift.io/provider-display-name": "Red Hat, Inc.", - "description": "Build and run Node.js 20 applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/20/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", + "description": "Build and run Node.js 22 applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/22/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", "iconClass": "icon-nodejs", "tags": "builder,nodejs", - "version": "20", + "version": "22", "sampleRepo": "https://github.com/sclorg/nodejs-ex.git" }, "from": { "kind": "ImageStreamTag", - "name": "20-ubi9" + "name": "22-ubi9" }, "referencePolicy": { "type": "Local" diff --git a/imagestreams/nodejs-rhel.json b/imagestreams/nodejs-rhel.json index 02b1b0d4..7dbd3b5c 100644 --- a/imagestreams/nodejs-rhel.json +++ b/imagestreams/nodejs-rhel.json @@ -161,6 +161,44 @@ "type": "Local" } }, + { + "name": "22-ubi9", + "annotations": { + "openshift.io/display-name": "Node.js 22 (UBI 9)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run Node.js 22 applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/22/README.md.", + "iconClass": "icon-nodejs", + "tags": "builder,nodejs", + "version": "22", + "sampleRepo": "https://github.com/sclorg/nodejs-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.redhat.io/ubi9/nodejs-22:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, + { + "name": "22-minimal-ubi9", + "annotations": { + "openshift.io/display-name": "Node.js 22-minimal (UBI 9)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run Node.js 22-minimal applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/22-minimal/README.md.", + "iconClass": "icon-nodejs", + "tags": "builder,nodejs", + "version": "22-minimal", + "sampleRepo": "https://github.com/sclorg/nodejs-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.redhat.io/ubi9/nodejs-22-minimal:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, { "name": "18-ubi8-minimal", "annotations": { @@ -237,20 +275,39 @@ "type": "Local" } }, + { + "name": "22-ubi9-minimal", + "annotations": { + "openshift.io/display-name": "Node.js 22-minimal (UBI 9)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run Node.js 22-minimal applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/22-minimal/README.md.", + "iconClass": "icon-nodejs", + "tags": "builder,nodejs", + "version": "22-minimal", + "sampleRepo": "https://github.com/sclorg/nodejs-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.redhat.io/ubi9/nodejs-22-minimal:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, { "name": "latest", "annotations": { - "openshift.io/display-name": "Node.js 20 (Latest)", + "openshift.io/display-name": "Node.js 22 (Latest)", "openshift.io/provider-display-name": "Red Hat, Inc.", - "description": "Build and run Node.js 20 applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/20/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", + "description": "Build and run Node.js 22 applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/22/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", "iconClass": "icon-nodejs", "tags": "builder,nodejs", - "version": "20", + "version": "22", "sampleRepo": "https://github.com/sclorg/nodejs-ex.git" }, "from": { "kind": "ImageStreamTag", - "name": "20-ubi9" + "name": "22-ubi9" }, "referencePolicy": { "type": "Local" diff --git a/test/run-openshift-remote-cluster b/test/run-openshift-remote-cluster index 8c755665..136fec0f 100755 --- a/test/run-openshift-remote-cluster +++ b/test/run-openshift-remote-cluster @@ -46,11 +46,6 @@ test -n "${VERSION-}" || false 'make sure $VERSION is defined' export CT_OCP4_TEST=true export CT_SKIP_UPLOAD_IMAGE=true -# TODO VERSION 22 is not supported at all -if [ "${VERSION}" == "22" ] || [ "${VERSION}" == "22-minimal" ]; then - exit 0 -fi - TEST_SUMMARY='' TEST_SET=${TESTS:-$TEST_LIST} ct_run_tests_from_testset "openshift-remote-cluster" diff --git a/test/test_latest_imagestreams.py b/test/test_latest_imagestreams.py index 370ed15c..2dc389cf 100644 --- a/test/test_latest_imagestreams.py +++ b/test/test_latest_imagestreams.py @@ -22,10 +22,6 @@ def setup_method(self): print(TEST_DIR.parent.parent) def test_latest_imagestream(self): - # TODO VERSION 22 is not supported at all - if VERSION.startswith("22"): - pass - self.latest_version = self.isc.get_latest_version() assert self.latest_version != "" self.isc.check_imagestreams(self.latest_version) diff --git a/test/test_nodejs_ex_templates.py b/test/test_nodejs_ex_templates.py index ae4e9f70..863fff37 100644 --- a/test/test_nodejs_ex_templates.py +++ b/test/test_nodejs_ex_templates.py @@ -42,10 +42,6 @@ def teardown_method(self): ] ) def test_nodejs_ex_template_inside_cluster(self, template): - # TODO VERSION 22 is not supported at all - if VERSION.startswith("22"): - pass - service_name = "nodejs-testing" template_url = self.oc_api.get_raw_url_for_json( container="nodejs-ex", dir="openshift/templates", filename=template, branch="master" diff --git a/test/test_shared_helm_nodejs_application.py b/test/test_shared_helm_nodejs_application.py index f1503173..94f991fb 100644 --- a/test/test_shared_helm_nodejs_application.py +++ b/test/test_shared_helm_nodejs_application.py @@ -27,9 +27,9 @@ class TestHelmNodeJSApplication: def setup_method(self): - package_name = "nodejs-application" + package_name = "redhat-nodejs-application" path = test_dir - self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir, remote=True) + self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir) self.hc_api.clone_helm_chart_repo( repo_url="https://github.com/sclorg/helm-charts", repo_name="helm-charts", subdir="charts/redhat" @@ -39,9 +39,6 @@ def teardown_method(self): self.hc_api.delete_project() def test_curl_connection(self): - # TODO VERSION 22 is not supported at all - if VERSION.startswith("22"): - pass if self.hc_api.oc_api.shared_cluster: pytest.skip("Do NOT test on shared cluster") self.hc_api.package_name = "nodejs-imagestreams" @@ -62,9 +59,6 @@ def test_curl_connection(self): ) def test_by_helm_test(self): - # TODO VERSION 22 is not supported at all - if VERSION.startswith("22"): - pass self.hc_api.package_name = "nodejs-imagestreams" self.hc_api.helm_package() assert self.hc_api.helm_installation() diff --git a/test/test_shared_helm_nodejs_imagestreams.py b/test/test_shared_helm_nodejs_imagestreams.py index ec593e9a..72bf80a4 100644 --- a/test/test_shared_helm_nodejs_imagestreams.py +++ b/test/test_shared_helm_nodejs_imagestreams.py @@ -17,9 +17,9 @@ class TestHelmRHELNodeJSImageStreams: def setup_method(self): - package_name = "nodejs-imagestreams" + package_name = "redhat-nodejs-imagestreams" path = test_dir - self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir, remote=True) + self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir) self.hc_api.clone_helm_chart_repo( repo_url="https://github.com/sclorg/helm-charts", repo_name="helm-charts", subdir="charts/redhat" @@ -31,6 +31,8 @@ def teardown_method(self): @pytest.mark.parametrize( "version,registry", [ + ("22-ubi9", "registry.redhat.io/ubi9/nodejs-22:latest"), + ("22-ubi9-minimal", "registry.redhat.io/ubi9/nodejs-22-minimal:latest"), ("20-ubi9", "registry.redhat.io/ubi9/nodejs-20:latest"), ("20-ubi9-minimal", "registry.redhat.io/ubi9/nodejs-20-minimal:latest"), ("20-ubi8", "registry.redhat.io/ubi8/nodejs-20:latest"),