From 9664c54b939fa86fa649a0a041084bdd9b652297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Goinvic?= Date: Wed, 4 Feb 2026 11:41:21 +0100 Subject: [PATCH 1/2] Helm 4: Support --rollback-on-failure `--atomic` is deprecated in helmv4 and is now `--rollback-on-failure`. --- pyhelm3/client.py | 4 ++++ pyhelm3/command.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/pyhelm3/client.py b/pyhelm3/client.py index 7039e52..0fe4707 100644 --- a/pyhelm3/client.py +++ b/pyhelm3/client.py @@ -219,6 +219,7 @@ async def install_or_upgrade_release( chart: Chart, *values: t.Dict[str, t.Any], atomic: bool = False, + rollback_on_failure: bool = False, cleanup_on_fail: bool = False, create_namespace: bool = True, description: t.Optional[str] = None, @@ -243,6 +244,7 @@ async def install_or_upgrade_release( chart.ref, mergeconcat(*values) if values else None, atomic = atomic, + rollback_on_failure = rollback_on_failure, cleanup_on_fail = cleanup_on_fail, create_namespace = create_namespace, description = description, @@ -344,6 +346,7 @@ async def ensure_release( chart: Chart, *values: t.Dict[str, t.Any], atomic: bool = False, + rollback_on_failure: bool = False, cleanup_on_fail: bool = False, create_namespace: bool = True, description: t.Optional[str] = None, @@ -381,6 +384,7 @@ async def ensure_release( chart, values, atomic = atomic, + rollback_on_failure = rollback_on_failure, cleanup_on_fail = cleanup_on_fail, create_namespace = create_namespace, description = description, diff --git a/pyhelm3/command.py b/pyhelm3/command.py index 23b852d..4c4f1c8 100644 --- a/pyhelm3/command.py +++ b/pyhelm3/command.py @@ -513,6 +513,7 @@ async def install_or_upgrade( values: t.Optional[t.Dict[str, t.Any]] = None, *, atomic: bool = False, + rollback_on_failure: bool = False, cleanup_on_fail: bool = False, create_namespace: bool = True, description: t.Optional[str] = None, @@ -548,6 +549,8 @@ async def install_or_upgrade( ] if atomic: command.append("--atomic") + if rollback_on_failure: + command.append("--rollback-on-failure") if cleanup_on_fail: command.append("--cleanup-on-fail") if create_namespace: From 10cd26570736972135fe4c243dffb8e02362bd6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Goinvic?= Date: Wed, 4 Feb 2026 11:57:20 +0100 Subject: [PATCH 2/2] detect helm version and adjust args parameters --- pyhelm3/command.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pyhelm3/command.py b/pyhelm3/command.py index 4c4f1c8..ab51826 100644 --- a/pyhelm3/command.py +++ b/pyhelm3/command.py @@ -547,10 +547,12 @@ async def install_or_upgrade( # We send the values in on stdin "--values", "-", ] - if atomic: - command.append("--atomic") - if rollback_on_failure: - command.append("--rollback-on-failure") + if atomic or rollback_on_failure: + helm_binary_version = await self.version() + if helm_binary_version.startswith("v4"): + command.append("--rollback-on-failure") + else: + command.append("--atomic") if cleanup_on_fail: command.append("--cleanup-on-fail") if create_namespace: