Skip to content

Commit

Permalink
Add disableWait property on Helm Release Uninstall
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 <samuelpirestores@gmail.com>
  • Loading branch information
samueltorres committed Feb 15, 2022
1 parent dedffc0 commit 7c0300f
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:"wait,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 @@ -506,6 +506,10 @@ spec:
operation (like Jobs for hooks) during the performance of a
Helm uninstall action. Defaults to 'HelmReleaseSpec.Timeout'.
type: string
wait:
description: DisableWait disables the waiting for resources to
be deleted before finalizing the Helm Release.
type: boolean
type: object
upgrade:
description: Upgrade holds the configuration for Helm upgrade actions
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>wait</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 7c0300f

Please sign in to comment.