fix: Allow helm chart metadata icon to be file #255

Merged
eminguez merged 1 commits from eminguez/suse-edge-factory:pyhelm3-icon-allow-file into main 2025-09-03 13:47:25 +02:00
2 changed files with 43 additions and 1 deletions

View File

@@ -0,0 +1,39 @@
From 2e89940b44d4be1d115aed987b4c610ed7173d66 Mon Sep 17 00:00:00 2001
From: e-minguez <e.minguez@gmail.com>
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."
)

View File

@@ -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}