mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-11-22 07:00:19 +00:00
feat(helm): add cleanup_on_fail option (#1206)
* feat(helm): add cleanup_on_fail option atomic rolls back to the last successful revision but can leave behind resources the failed upgrade created; helm accepts both flags together so the rollback also drops those orphans. Rejected with replace=true, since that deploys via helm install, which has no --cleanup-on-fail. No version gate: the flag exists in helm 3.0.0, the module's minimum, and was not renamed in v4. * refactor(tests): share helm command-building test helpers The new cleanup_on_fail tests copied setUp and _run_with_version verbatim from the atomic tests, which SonarQube flagged as duplication on new code. Extract both to module level so the two classes share them. Scoped to the classes involved in that duplication; the other test classes in this file keep their own fixtures. * test(helm): align cleanup_on_fail assertions with review feedback Adjust the Helm unit tests to assert the expected flags for cleanup_on_fail on Helm v3 and v4, matching the behavior clarified in review feedback. Co-authored-by: abikouo <abikouo@users.noreply.github.com> --------- Co-authored-by: abikouo <abikouo@users.noreply.github.com>
This commit is contained in:
co-authored by
abikouo
parent
ec8942dd90
commit
d4ef10fc80
@@ -0,0 +1,3 @@
|
||||
---
|
||||
minor_changes:
|
||||
- helm - add the ``cleanup_on_fail`` option, mapping to the ``--cleanup-on-fail`` flag, to allow deletion of new resources created during a failed upgrade. It complements ``atomic`` and can be combined with it, but cannot be used with ``replace``, since that deploys through ``helm install`` which does not accept the flag (https://github.com/ansible-collections/kubernetes.core/pull/1206).
|
||||
Reference in New Issue
Block a user