Skip to content

Commit

Permalink
Add disableWait property on Helm Release Unnstall
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
samueltorres committed Feb 15, 2022
1 parent dedffc0 commit 72ccc74
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/v2beta1/helmrelease_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,11 @@ type Uninstall struct {
// release as deleted, but retain the release history.
// +optional
KeepHistory bool `json:"keepHistory,omitempty"`

// DisableWait disables the waiting for resources to be deleted before
// finalizing the Helm Release.
// +optional
DisableWait bool `json:"disableWait,omitempty"`
}

// GetTimeout returns the configured timeout for the Helm uninstall action, or
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,10 @@ spec:
description: DisableHooks prevents hooks from running during the
Helm rollback action.
type: boolean
disableWait:
description: DisableWait disables the waiting for resources to
be deleted before finalizing the Helm Release.
type: boolean
keepHistory:
description: KeepHistory tells Helm to remove all associated resources
and mark the release as deleted, but retain the release history.
Expand Down
13 changes: 13 additions & 0 deletions docs/api/helmrelease.md
Original file line number Diff line number Diff line change
Expand Up @@ -1755,6 +1755,19 @@ bool
release as deleted, but retain the release history.</p>
</td>
</tr>
<tr>
<td>
<code>disableWait</code><br>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>DisableWait disables the waiting for resources to be deleted before
finalizing the Helm Release.</p>
</td>
</tr>
</tbody>
</table>
</div>
Expand Down
1 change: 1 addition & 0 deletions internal/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ func (r *Runner) Uninstall(hr v2.HelmRelease) error {
uninstall.Timeout = hr.Spec.GetUninstall().GetTimeout(hr.GetTimeout()).Duration
uninstall.DisableHooks = hr.Spec.GetUninstall().DisableHooks
uninstall.KeepHistory = hr.Spec.GetUninstall().KeepHistory
uninstall.Wait = !hr.Spec.GetUninstall().DisableWait

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

0 comments on commit 72ccc74

Please sign in to comment.