Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add uninstall disableWait flag #416

Merged
merged 2 commits into from
Feb 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 waiting for all the resources to be deleted after
// a Helm uninstall is performed.
// +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 waiting for all the resources
to be deleted after a Helm uninstall is performed.
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 waiting for all the resources to be deleted after
a Helm uninstall is performed.</p>
</td>
</tr>
</tbody>
</table>
</div>
Expand Down
9 changes: 7 additions & 2 deletions docs/spec/v2beta1/helmreleases.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,11 @@ type Uninstall struct {
// release as deleted, but retain the release history.
// +optional
KeepHistory bool `json:"keepHistory,omitempty"`

// DisableWait disables waiting for all the resources to be deleted after
// a Helm uninstall is performed.
// +optional
DisableWait bool `json:"disableWait,omitempty"`
}

// Kustomize Helm PostRenderer specification.
Expand Down Expand Up @@ -786,8 +791,8 @@ kubectl get all --all-namespaces \

### Disabling resource waiting

For install, upgrade, and rollback actions resource waiting is enabled by default,
but can be disabled by setting `spec.<action>.disableWait`.
For install, upgrade, rollback, and uninstall actions resource waiting is
enabled by default, but can be disabled by setting `spec.<action>.disableWait`.

Waiting for jobs to complete is enabled by default,
but can be disabled by setting `spec.<action>.disableWaitForJobs`.
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