Skip to content

Commit

Permalink
Pass OCIRepository chart ref tag to helm --version
Browse files Browse the repository at this point in the history
  • Loading branch information
allenporter committed Mar 3, 2025
1 parent f105f6b commit fff977d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions flux_local/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,13 @@ async def template(
release.chart.version,
]
)
elif isinstance(repo, OCIRepository) and repo.ref_tag:
args.extend(
[
"--version",
repo.ref_tag,
]
)
if release.values:
values_path = self._tmp_dir / f"{release.release_name}-values.yaml"
async with aiofiles.open(values_path, mode="w") as values_file:
Expand Down
5 changes: 5 additions & 0 deletions flux_local/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ class OCIRepository(BaseManifest):
url: str
"""The URL to the repository."""

ref_tag: str | None = None
"""The version tag of the repository."""

@classmethod
def parse_doc(cls, doc: dict[str, Any]) -> "OCIRepository":
"""Parse a HelmRepository from a kubernetes resource."""
Expand All @@ -374,10 +377,12 @@ def parse_doc(cls, doc: dict[str, Any]) -> "OCIRepository":
raise InputException(f"Invalid {cls} missing spec: {doc}")
if not (url := spec.get("url")):
raise InputException(f"Invalid {cls} missing spec.url: {doc}")
ref_tag = spec.get("ref", {}).get("tag")
return cls(
name=name,
namespace=namespace,
url=url,
ref_tag=ref_tag,
)

@property
Expand Down

0 comments on commit fff977d

Please sign in to comment.