Skip to content

Commit 5163b5d

Browse files
committed
Add uninstall wait flag
Add a uninstall wait property on Helm Release Uninstall API. So users can set whether Helm Controller waits for all the Helm managed resources to be deleted before finalizing the Helm Release resource.
1 parent ff258dd commit 5163b5d

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-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+
// Wait tells Helm to wait for all the resources are deleted before finalizing
759+
// the resource. It will wait for as long as the configured uninstall timeout.
760+
// +optional
761+
Wait 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

+5
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,11 @@ 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: Wait tells Helm to wait for all the resources are
511+
deleted before finalizing the resource. It will wait for as
512+
long as the configured uninstall timeout.
513+
type: boolean
509514
type: object
510515
upgrade:
511516
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>Wait tells Helm to wait for all the resources are deleted before finalizing
1768+
the resource. It will wait for as long as the configured uninstall timeout.</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().Wait
378379

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

0 commit comments

Comments
 (0)