mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-11-21 14:48:37 +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
@@ -157,6 +157,29 @@ Parameters
|
||||
<div>Chart version to install. If this is not specified, the latest version is installed.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||
<b>cleanup_on_fail</b>
|
||||
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
|
||||
<div style="font-size: small">
|
||||
<span style="color: purple">boolean</span>
|
||||
</div>
|
||||
<div style="font-style: italic; font-size: small; color: darkgreen">added in 6.6.0</div>
|
||||
</td>
|
||||
<td>
|
||||
<ul style="margin: 0; padding: 0"><b>Choices:</b>
|
||||
<li><div style="color: blue"><b>no</b> ←</div></li>
|
||||
<li>yes</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
<div>Allow deletion of new resources created during a failed upgrade.</div>
|
||||
<div>Maps to the <code>--cleanup-on-fail</code> flag, which is available since helm 3.0.0 and was not renamed in Helm v4.</div>
|
||||
<div>Complements O(atomic) rather than replacing it, and the two can be combined so that a rollback also drops resources orphaned by the failed upgrade.</div>
|
||||
<div>Helm only accepts this flag on <code>helm upgrade</code>, so it cannot be used together with O(replace), which deploys through <code>helm install</code>.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div class="ansibleOptionAnchor" id="parameter-"></div>
|
||||
|
||||
Reference in New Issue
Block a user