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
4 changes: 4 additions & 0 deletions pyhelm3/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
9 changes: 7 additions & 2 deletions pyhelm3/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -546,8 +547,12 @@ async def install_or_upgrade(
# We send the values in on stdin
"--values", "-",
]
if atomic:
command.append("--atomic")
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:
Expand Down