From 95a025a7ae9e1294f8105ff90aef4d9be4df451d Mon Sep 17 00:00:00 2001 From: Jacek Wysocki Date: Fri, 7 Jan 2022 13:01:51 +0100 Subject: [PATCH] fix: bypass repo exsits warning (#730) --- cmd/kubectl-testkube/commands/install.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/kubectl-testkube/commands/install.go b/cmd/kubectl-testkube/commands/install.go index f0afcaa4122..25dd3aefabb 100644 --- a/cmd/kubectl-testkube/commands/install.go +++ b/cmd/kubectl-testkube/commands/install.go @@ -3,6 +3,7 @@ package commands import ( "fmt" "os/exec" + "strings" "github.com/kubeshop/testkube/pkg/process" "github.com/kubeshop/testkube/pkg/ui" @@ -32,7 +33,9 @@ func NewInstallCmd() *cobra.Command { ui.ExitOnError("checking helm installation path", err) _, err = process.Execute(helmPath, "repo", "add", "kubeshop", "https://kubeshop.github.io/helm-charts") - ui.WarnOnError("adding testkube repo", err) + if !strings.Contains(err.Error(), "Error: repository name (kubeshop) already exists, please specify a different name") { + ui.WarnOnError("adding testkube repo", err) + } _, err = process.Execute(helmPath, "repo", "update") ui.ExitOnError("updating helm repositories", err)