From f80fae977045a48710b61102aba6db9434df420c Mon Sep 17 00:00:00 2001 From: Michael Burman Date: Fri, 22 Mar 2024 18:47:29 +0200 Subject: [PATCH] Add timeout option to install --- pkg/helmutil/fetch.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/helmutil/fetch.go b/pkg/helmutil/fetch.go index 3cc40a3..ad4b70a 100644 --- a/pkg/helmutil/fetch.go +++ b/pkg/helmutil/fetch.go @@ -5,6 +5,7 @@ import ( "os" "path/filepath" "strings" + "time" "github.com/k8ssandra/k8ssandra-client/pkg/util" "helm.sh/helm/v3/pkg/action" @@ -129,13 +130,16 @@ func ListInstallations(cfg *action.Configuration) ([]*release.Release, error) { return listAction.Run() } -func Install(cfg *action.Configuration, releaseName, path, namespace string, values map[string]interface{}, devel bool, skipCRDs bool) (*release.Release, error) { +func Install(cfg *action.Configuration, releaseName, path, namespace string, values map[string]interface{}, devel bool, skipCRDs bool, timeout time.Duration) (*release.Release, error) { installAction := action.NewInstall(cfg) installAction.ReleaseName = releaseName installAction.Namespace = namespace installAction.CreateNamespace = true installAction.Atomic = true installAction.Wait = true + if timeout > 0 { + installAction.Timeout = timeout + } if skipCRDs { installAction.SkipCRDs = true }