From 8be0003fe4227d0f1e48e583eed62bcba59132d1 Mon Sep 17 00:00:00 2001 From: Tomer Gabel Date: Wed, 18 Jun 2025 16:48:13 +0300 Subject: [PATCH 1/2] Allow underscores in names --- pyhelm3/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyhelm3/models.py b/pyhelm3/models.py index d03fdc6..f882fb3 100644 --- a/pyhelm3/models.py +++ b/pyhelm3/models.py @@ -43,7 +43,7 @@ def __init__(self, _command: Command, **kwargs): #: Type for a name (chart or release) -Name = constr(pattern = r"^[a-z0-9-]+$") +Name = constr(pattern = r"^[a-z0-9_-]+$") #: Type for a SemVer version @@ -273,7 +273,7 @@ class Release(ModelWithCommand): ) namespace: Name = Field( ..., - description = "The namespace of the release." + description = "The namespace of the release." ) async def current_revision(self) -> ReleaseRevisionType: @@ -642,7 +642,7 @@ async def chart_metadata(self) -> ChartMetadata: ) self.chart_metadata_ = ChartMetadata(**metadata) return self.chart_metadata_ - + async def hooks(self) -> t.Iterable[Hook]: """ Returns the hooks that were executed as part of this revision. From b465731968b7481837abf975586bb04468510cd4 Mon Sep 17 00:00:00 2001 From: Tomer Gabel Date: Mon, 7 Jul 2025 17:40:23 +0300 Subject: [PATCH 2/2] Enable dependency names to include underscores Aliases may sometimes include underscores, and in turn may be returned a dependency name when using helm.get_current_revision(...).chart_metadata(). --- pyhelm3/models.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pyhelm3/models.py b/pyhelm3/models.py index f882fb3..902e131 100644 --- a/pyhelm3/models.py +++ b/pyhelm3/models.py @@ -43,7 +43,10 @@ def __init__(self, _command: Command, **kwargs): #: Type for a name (chart or release) -Name = constr(pattern = r"^[a-z0-9_-]+$") +Name = constr(pattern = r"^[a-z0-9-]+$") + +#: Type for a dependency name +DependencyNameOrAlias = constr(pattern = r"^[a-z0-9_-]+$") #: Type for a SemVer version @@ -71,9 +74,9 @@ class ChartDependency(BaseModel): """ Model for a chart dependency. """ - name: Name = Field( + name: DependencyNameOrAlias = Field( ..., - description = "The name of the chart." + description = "The name of the chart (or alias, in case of an already-installed dependency)." ) version: NonEmptyString = Field( ...,