Skip to content

Commit 7c0300f

Browse files
committed
Add disableWait property on Helm Release Uninstall
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 <samuelpirestores@gmail.com>
1 parent dedffc0 commit 7c0300f

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:"wait,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
@@ -506,6 +506,10 @@ spec:
506506
operation (like Jobs for hooks) during the performance of a
507507
Helm uninstall action. Defaults to 'HelmReleaseSpec.Timeout'.
508508
type: string
509+
wait:
510+
description: DisableWait disables the waiting for resources to
511+
be deleted before finalizing the Helm Release.
512+
type: boolean
509513
type: object
510514
upgrade:
511515
description: Upgrade holds the configuration for Helm upgrade actions

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>wait</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)