Skip to content
Open
Show file tree
Hide file tree
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
26 changes: 26 additions & 0 deletions flux_local/helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,21 @@ class Options:
registry_config: str | None = None
"""Value of the helm --registry-config flag."""

is_upgrade: bool = False
"""Set .Release.IsUpgrade instead of .Release.IsInstall."""

include_crds: bool = False
"""Include CRDs in the helm template output."""

no_hooks: bool = False
"""Exclude hook-annotated templates from the output."""

show_only: list[str] | None = None
"""Render only specific template files."""

enable_dns: bool = False
"""Enable DNS lookups during rendering."""

skip_invalid_paths: bool = False
"""Skip HelmReleases with invalid local paths."""

Expand All @@ -263,6 +278,17 @@ def template_args(self) -> list[str]:
args.extend(["--kube-version", self.kube_version])
if self.api_versions:
args.extend(["--api-versions", self.api_versions])
if self.is_upgrade:
args.append("--is-upgrade")
if self.include_crds:
args.append("--include-crds")
if self.no_hooks:
args.append("--no-hooks")
if self.show_only:
for template in self.show_only:
args.extend(["--show-only", template])
if self.enable_dns:
args.append("--enable-dns")
return args

@property
Expand Down
35 changes: 35 additions & 0 deletions flux_local/tool/selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,36 @@ def add_helm_options_flags(args: ArgumentParser) -> None:
action=BooleanOptionalAction,
help="When true, skip helm releases with local paths that do not exist",
)
args.add_argument(
"--is-upgrade",
default=False,
action=BooleanOptionalAction,
help="Set .Release.IsUpgrade instead of .Release.IsInstall during helm template",
)
args.add_argument(
"--include-crds",
default=False,
action=BooleanOptionalAction,
help="Include CRDs in the helm template output",
)
args.add_argument(
"--no-hooks",
default=False,
action="store_true",
help="Exclude hook-annotated templates from the output",
)
args.add_argument(
"--show-only",
"-s",
action="append",
help="Only show manifests rendered from the given templates",
)
args.add_argument(
"--enable-dns",
default=False,
action=BooleanOptionalAction,
help="Enable DNS lookups during helm template rendering",
)


def build_helm_options(**kwargs) -> helm.Options: # type: ignore[no-untyped-def]
Expand All @@ -251,6 +281,11 @@ def build_helm_options(**kwargs) -> helm.Options: # type: ignore[no-untyped-def
kube_version=kwargs.get("kube_version"),
api_versions=kwargs.get("api_versions"),
registry_config=kwargs.get("registry_config"),
is_upgrade=kwargs.get("is_upgrade", False),
include_crds=kwargs.get("include_crds", False),
no_hooks=kwargs.get("no_hooks", False),
show_only=kwargs.get("show_only"),
enable_dns=kwargs.get("enable_dns", False),
skip_invalid_paths=kwargs.get("skip_invalid_helm_release_paths", False),
)

Expand Down