Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pyhelm3/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
FilePath,
AnyUrl as PydanticAnyUrl,
HttpUrl as PydanticHttpUrl,
UrlConstraints as PydanticUrlConstraints,
constr,
field_validator
)
from pydantic.functional_validators import AfterValidator
from typing_extensions import Annotated

from .command import Command, SafeLoader

Expand Down Expand Up @@ -46,6 +48,10 @@ def __init__(self, _command: Command, **kwargs):
SemVerVersion = constr(pattern = r"^v?\d+\.\d+\.\d+(-[a-zA-Z0-9\.\-]+)?(\+[a-zA-Z0-9\.\-]+)?$")


#: Type for an OCI scheme URI
OciUrl = Annotated[PydanticAnyUrl, PydanticUrlConstraints(allowed_schemes=["oci"], host_required=True)]


#: Type variables for forward references to the chart and release types
ChartType = t.TypeVar("ChartType", bound = "Chart")
ReleaseType = t.TypeVar("ReleaseType", bound = "Release")
Expand Down Expand Up @@ -195,7 +201,7 @@ class Chart(ModelWithCommand):
"""
Model for a reference to a chart.
"""
ref: t.Union[DirectoryPath, FilePath, HttpUrl, Name] = Field(
ref: t.Union[DirectoryPath, FilePath, HttpUrl, OciUrl, Name] = Field(
...,
description = (
"The chart reference. "
Expand Down