From 78fc39447cca61485c51d13bfee8feab5b0c18d3 Mon Sep 17 00:00:00 2001 From: Paolo Dettori Date: Wed, 14 Feb 2024 23:00:06 -0500 Subject: [PATCH] use temp dir for repo config in helm installer Signed-off-by: Paolo Dettori --- pkg/helm/installer.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/helm/installer.go b/pkg/helm/installer.go index 483c7e9..d76d0fa 100644 --- a/pkg/helm/installer.go +++ b/pkg/helm/installer.go @@ -46,6 +46,10 @@ import ( clog "sigs.k8s.io/controller-runtime/pkg/log" ) +const ( + repoFile = "helm.repo" +) + type HelmHandler struct { URL string RepoName string @@ -66,7 +70,8 @@ func Init(ctx context.Context, handler *HelmHandler) error { handler.log = clog.FromContext(ctx) handler.settings = cli.New() handler.settings.SetNamespace(handler.Namespace) - handler.settings.RegistryConfig = "/tmp" + handler.settings.RegistryConfig = os.TempDir() + handler.settings.RepositoryConfig = filepath.Join(os.TempDir(), repoFile) return nil }