Skip to content

Commit 72ccc74

Browse files
committed
Add disableWait property on Helm Release Unnstall
Users can now tell Helm Controller to not for all the Helm managed resources to be deleted before finalizing the Helm Release resource. Signed-off-by: Samuel Torres <samuelpirestorres@gmail.com>
1 parent dedffc0 commit 72ccc74

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

api/v2beta1/helmrelease_types.go

+5
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,11 @@ type Uninstall struct {
754754
// release as deleted, but retain the release history.
755755
// +optional
756756
KeepHistory bool `json:"keepHistory,omitempty"`
757+
758+
// DisableWait disables the waiting for resources to be deleted before
759+
// finalizing the Helm Release.
760+
// +optional
761+
DisableWait bool `json:"disableWait,omitempty"`
757762
}
758763

759764
// GetTimeout returns the configured timeout for the Helm uninstall action, or

config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,10 @@ spec:
497497
description: DisableHooks prevents hooks from running during the
498498
Helm rollback action.
499499
type: boolean
500+
disableWait:
501+
description: DisableWait disables the waiting for resources to
502+
be deleted before finalizing the Helm Release.
503+
type: boolean
500504
keepHistory:
501505
description: KeepHistory tells Helm to remove all associated resources
502506
and mark the release as deleted, but retain the release history.

docs/api/helmrelease.md

+13
Original file line numberDiff line numberDiff line change
@@ -1755,6 +1755,19 @@ bool
17551755
release as deleted, but retain the release history.</p>
17561756
</td>
17571757
</tr>
1758+
<tr>
1759+
<td>
1760+
<code>disableWait</code><br>
1761+
<em>
1762+
bool
1763+
</em>
1764+
</td>
1765+
<td>
1766+
<em>(Optional)</em>
1767+
<p>DisableWait disables the waiting for resources to be deleted before
1768+
finalizing the Helm Release.</p>
1769+
</td>
1770+
</tr>
17581771
</tbody>
17591772
</table>
17601773
</div>

internal/runner/runner.go

+1
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ func (r *Runner) Uninstall(hr v2.HelmRelease) error {
375375
uninstall.Timeout = hr.Spec.GetUninstall().GetTimeout(hr.GetTimeout()).Duration
376376
uninstall.DisableHooks = hr.Spec.GetUninstall().DisableHooks
377377
uninstall.KeepHistory = hr.Spec.GetUninstall().KeepHistory
378+
uninstall.Wait = !hr.Spec.GetUninstall().DisableWait
378379

379380
_, err := uninstall.Run(hr.GetReleaseName())
380381
return wrapActionErr(r.logBuffer, err)

0 commit comments

Comments
 (0)