From b94d72202850b2bb5dadb2e1b39ff097f22a416aaf04fdb54283e08a154f739e Mon Sep 17 00:00:00 2001 From: e-minguez Date: Tue, 2 Sep 2025 17:33:39 +0200 Subject: [PATCH] fix: Allow helm chart metadata icon to be file --- .../0001-icon-metadata-allow-fileurl.patch | 39 +++++++++++++++++++ python-pyhelm3/pyhelm3.spec | 5 ++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 python-pyhelm3/0001-icon-metadata-allow-fileurl.patch diff --git a/python-pyhelm3/0001-icon-metadata-allow-fileurl.patch b/python-pyhelm3/0001-icon-metadata-allow-fileurl.patch new file mode 100644 index 0000000..0b231a9 --- /dev/null +++ b/python-pyhelm3/0001-icon-metadata-allow-fileurl.patch @@ -0,0 +1,39 @@ +From 2e89940b44d4be1d115aed987b4c610ed7173d66 Mon Sep 17 00:00:00 2001 +From: e-minguez +Date: Tue, 2 Sep 2025 18:03:50 +0200 +Subject: [PATCH] fix: Allow icon metadata to be file + +Fix #34 +--- + pyhelm3/models.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/pyhelm3/models.py b/pyhelm3/models.py +index d03fdc6..adb2c88 100644 +--- a/pyhelm3/models.py ++++ b/pyhelm3/models.py +@@ -14,6 +14,7 @@ + FilePath, + AnyUrl as PydanticAnyUrl, + HttpUrl as PydanticHttpUrl, ++ FileUrl as PydanticFileUrl, + constr, + field_validator + ) +@@ -65,6 +66,7 @@ def validate_str_as(validate_type): + #: Annotated string types for URLs + AnyUrl = t.Annotated[str, AfterValidator(validate_str_as(PydanticAnyUrl))] + HttpUrl = t.Annotated[str, AfterValidator(validate_str_as(PydanticHttpUrl))] ++FileUrl = t.Annotated[str, AfterValidator(validate_str_as(PydanticFileUrl))] + + + class ChartDependency(BaseModel): +@@ -173,7 +175,7 @@ class ChartMetadata(BaseModel): + default_factory = list, + description = "List of maintainers for the chart." + ) +- icon: t.Optional[HttpUrl] = Field( ++ icon: t.Optional[HttpUrl | FileUrl] = Field( + None, + description = "URL to an SVG or PNG image to be used as an icon." + ) diff --git a/python-pyhelm3/pyhelm3.spec b/python-pyhelm3/pyhelm3.spec index dee282e..bb1d4d9 100644 --- a/python-pyhelm3/pyhelm3.spec +++ b/python-pyhelm3/pyhelm3.spec @@ -16,12 +16,15 @@ Name: python-pyhelm3 Version: 0.4.0 -Release: 0 +Release: 1 Summary: Python library for managing Helm releases using Helm 3 License: Apache-2.0 URL: https://github.com/azimuth-cloud/pyhelm3 #!RemoteAsset Source: https://files.pythonhosted.org/packages/source/p/pyhelm3/pyhelm3-%{version}.tar.gz +# Allow icon metadata to be file:// as well as http/https:// +# https://github.com/azimuth-cloud/pyhelm3/pull/35 +Patch: 0001-icon-metadata-allow-fileurl.patch BuildRequires: python-rpm-macros BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools >= 42} -- 2.49.0