diff --git a/flux_local/helm.py b/flux_local/helm.py index 3116e3c5..c7331d5d 100644 --- a/flux_local/helm.py +++ b/flux_local/helm.py @@ -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.""" @@ -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 diff --git a/flux_local/tool/selector.py b/flux_local/tool/selector.py index 8a424a9b..1c21a121 100644 --- a/flux_local/tool/selector.py +++ b/flux_local/tool/selector.py @@ -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] @@ -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), )