Skip to content

Commit

Permalink
Allow the Helm timeout to be set on uninstall
Browse files Browse the repository at this point in the history
Signed-off-by: Maartje Eyskens <[email protected]>
  • Loading branch information
meyskens authored and michi-covalent committed Apr 27, 2023
1 parent 4b91b5f commit 90431a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions defaults/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ const (
ConnectTimeout = 2 * time.Second
RequestTimeout = 10 * time.Second

UninstallTimeout = 5 * time.Minute

IngressClassName = "cilium"
IngressService = "cilium-ingress"
IngressControllerName = "cilium.io/ingress-controller"
Expand Down
2 changes: 2 additions & 0 deletions install/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type UninstallParameters struct {
RedactHelmCertKeys bool
HelmChartDirectory string
WorkerCount int
Timeout time.Duration
}

type K8sUninstaller struct {
Expand Down Expand Up @@ -60,6 +61,7 @@ func (k *K8sUninstaller) UninstallWithHelm(k8sClient genericclioptions.RESTClien
}
helmClient := action.NewUninstall(&actionConfig)
helmClient.Wait = k.params.Wait
helmClient.Timeout = k.params.Timeout
_, err := helmClient.Run(defaults.HelmReleaseName)
return err
}
Expand Down
2 changes: 2 additions & 0 deletions internal/cli/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ func newCmdUninstallWithHelm() *cobra.Command {
}

addCommonUninstallFlags(cmd, &params)

cmd.Flags().DurationVar(&params.Timeout, "timeout", defaults.UninstallTimeout, "Maximum time to wait resources to be deleted")
return cmd
}

Expand Down

0 comments on commit 90431a1

Please sign in to comment.