From 25351e4eed1710d2416d90d00d5b1c2401197ea8 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Thu, 5 Sep 2024 09:35:05 +0200 Subject: [PATCH] Add support for CentOS Stream 10 valkey imagestreams Signed-off-by: Petr "Stone" Hracek --- Makefile | 7 ++- charts/centos/valkey-imagestreams/OWNERS | 9 ++++ .../centos/valkey-imagestreams/src/Chart.yaml | 13 ++++++ .../src/templates/imagestreams.yaml | 43 +++++++++++++++++++ tests/test_valkey_imagestreams.py | 29 +++++++++++++ 5 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 charts/centos/valkey-imagestreams/OWNERS create mode 100644 charts/centos/valkey-imagestreams/src/Chart.yaml create mode 100644 charts/centos/valkey-imagestreams/src/templates/imagestreams.yaml create mode 100644 tests/test_valkey_imagestreams.py diff --git a/Makefile b/Makefile index 85a1f09..c16c92f 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: test test-httpd test-php test-perl test-mariadb test-mysql test-nginx test-postgresql test-redis test-all test-nodejs test-ruby test-python +.PHONY: test test-httpd test-php test-perl test-mariadb test-mysql test-nginx test-postgresql test-redis test-all test-nodejs test-ruby test-python test-valkey test: cd tests && PYTHONPATH=$(CURDIR) python3.12 -m pytest --color=yes -s -rA --verbose -vv --showlocals test_varnish_*.py @@ -36,7 +36,10 @@ test-python: test-ruby: cd tests && PYTHONPATH=$(CURDIR) python3.12 -m pytest --color=yes -s -rA --verbose -vv --showlocals test_ruby_*.py -test-all: test test-php test-httpd test-mariadb test-mysql test-nginx test-postgresql test-redis test-perl test-python test-ruby test-nodejs +test-valkey: + cd tests && PYTHONPATH=$(CURDIR) python3.12 -m pytest --color=yes -s -rA --verbose -vv --showlocals test_valkey_*.py + +test-all: test test-php test-httpd test-mariadb test-mysql test-nginx test-postgresql test-redis test-perl test-python test-ruby test-nodejs test-valkey test-nons2i: test test-httpd test-mariadb test-mysql test-nginx test-postgresql test-redis diff --git a/charts/centos/valkey-imagestreams/OWNERS b/charts/centos/valkey-imagestreams/OWNERS new file mode 100644 index 0000000..aa12b4b --- /dev/null +++ b/charts/centos/valkey-imagestreams/OWNERS @@ -0,0 +1,9 @@ +chart: + name: valkey-imagestreams + description: This is the CentOS Valkey imagestream chart +publicPgpKey: null +users: + - githubUsername: phracek +vendor: + label: centos + name: Cent OS diff --git a/charts/centos/valkey-imagestreams/src/Chart.yaml b/charts/centos/valkey-imagestreams/src/Chart.yaml new file mode 100644 index 0000000..ec05f69 --- /dev/null +++ b/charts/centos/valkey-imagestreams/src/Chart.yaml @@ -0,0 +1,13 @@ +description: |- + This content is experimental, do not use it in production. Provides a Valkey database on CentOS Stream imagestreams. + For more information about Valkey container see https://github.com/sclorg/valkey-container/. +annotations: + charts.openshift.io/name: Provides a Valkey database on CentOS imagestreams (experimental) +apiVersion: v2 +appVersion: 0.0.1 +kubeVersion: '>=1.20.0' +name: valkey-imagestreams +tags: builder,valkey +sources: + - https://github.com/sclorg/helm-charts +version: 0.0.1 diff --git a/charts/centos/valkey-imagestreams/src/templates/imagestreams.yaml b/charts/centos/valkey-imagestreams/src/templates/imagestreams.yaml new file mode 100644 index 0000000..5e441fa --- /dev/null +++ b/charts/centos/valkey-imagestreams/src/templates/imagestreams.yaml @@ -0,0 +1,43 @@ +apiVersion: image.openshift.io/v1 +kind: ImageStream +metadata: + annotations: + openshift.io/display-name: Valkey + name: valkey +spec: + tags: + - annotations: + description: >- + Provides a Valkey 7 database on CentOS Stream 10. For more information + about using this database image, including OpenShift considerations, see + https://github.com/sclorg/valkey-container/tree/master/7/README.md. + + WARNING: By selecting this tag, your application will automatically + update to use the latest version of Valkey available on OpenShift, + including major version updates. + iconClass: icon-valkey + openshift.io/display-name: Valkey (Latest) + openshift.io/provider-display-name: Red Hat, Inc. + tags: valkey + from: + kind: ImageStreamTag + name: 7-c10s + referencePolicy: + type: Local + name: latest + - annotations: + description: >- + Provides a Valkey 7 database on CentOS Stream 10. For more information about + using this database image, including OpenShift considerations, see + https://github.com/sclorg/valkey-container/tree/master/6/README.md. + iconClass: icon-valkey + openshift.io/display-name: Valkey 7 (CentOS Stream 10) + openshift.io/provider-display-name: Red Hat, Inc. + tags: valkey + version: "7" + from: + kind: DockerImage + name: quay.io/sclorg/valkey-7-c10s:latest + referencePolicy: + type: Local + name: 7-el10 diff --git a/tests/test_valkey_imagestreams.py b/tests/test_valkey_imagestreams.py new file mode 100644 index 0000000..0ae8840 --- /dev/null +++ b/tests/test_valkey_imagestreams.py @@ -0,0 +1,29 @@ +import os + +import pytest +from pathlib import Path + +from container_ci_suite.helm import HelmChartsAPI + +test_dir = Path(os.path.abspath(os.path.dirname(__file__))) + +class TestHelmCentOSValkeyImageStreams: + + def setup_method(self): + package_name = "valkey-imagestreams" + path = test_dir / "../charts/centos" + self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir) + + def teardown_method(self): + self.hc_api.delete_project() + + @pytest.mark.parametrize( + "version,registry,expected", + [ + ("7-el10", "quay.io/sclorg/valkey-7-c10s:latest", True), + ], + ) + def test_package_imagestream(self, version, registry, expected): + assert self.hc_api.helm_package() + assert self.hc_api.helm_installation() + assert self.hc_api.check_imagestreams(version=version, registry=registry) == expected