Skip to content

Commit

Permalink
Improved HelmRelease delete
Browse files Browse the repository at this point in the history
  • Loading branch information
slysunkin committed Aug 27, 2024
1 parent ee22e2b commit 76dcb18
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions internal/controller/deployment_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,15 @@ func (r *DeploymentReconciler) Delete(ctx context.Context, l logr.Logger, deploy
}
return ctrl.Result{}, err
}
uninstall := hr.GetUninstall()
if !uninstall.DisableHooks {
uninstall.DisableHooks = true
hr.Spec.Uninstall = &uninstall
l.Info("Disabling hooks for HelmRelease")
if err := r.Client.Update(ctx, hr); err != nil {
return ctrl.Result{}, err
}
}
err = helm.DeleteHelmRelease(ctx, r.Client, deployment.Name, deployment.Namespace)
if err != nil {
return ctrl.Result{}, err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ spec:
apiServer:
default: false
description: APIServer indicates if the Kubernetes API Server log
(kube-apiserver) shoulkd be enabled
(kube-apiserver) should be enabled
type: boolean
audit:
default: false
Expand Down Expand Up @@ -2352,7 +2352,7 @@ spec:
apiServer:
default: false
description: APIServer indicates if the Kubernetes API Server log
(kube-apiserver) shoulkd be enabled
(kube-apiserver) should be enabled
type: boolean
audit:
default: false
Expand Down

0 comments on commit 76dcb18

Please sign in to comment.