From 25a64fd09741c99991d687c30c12ae05a2abe047 Mon Sep 17 00:00:00 2001 From: JMatt Peterson Date: Wed, 30 Jun 2021 12:38:35 -0700 Subject: [PATCH] [INF-911] Use WithEnv for setting env variable. (#8) modified: helm/helm.go --- helm/helm.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helm/helm.go b/helm/helm.go index e124f50..1609c1f 100644 --- a/helm/helm.go +++ b/helm/helm.go @@ -109,7 +109,6 @@ func (h *Helm) repoNameForChart(s string) string { } func (h *Helm) S3Setup(ctx context.Context) error { - os.Setenv("HELM_S3_MODE", "3") if !strings.HasPrefix(h.s3individualChartPrefix(), `s3://`) { return fmt.Errorf("no S3 prefix for chart repo. Maybe not s3") } @@ -143,7 +142,8 @@ func (h *Helm) S3Setup(ctx context.Context) error { continue } if h.initS3Repo() { - if err := pipe.NewPiped("helm", "s3", "init", h.repoURLForChart(c)).Run(ctx); err != nil { + if err := pipe.NewPiped("helm", "s3", "init", h.repoURLForChart(c)). + WithEnv(h.Env.AddEnv("HELM_S3_MODE=3")).Run(ctx); err != nil { fmt.Printf("uanble to init s3 repo. This is sometimes OK if the repo is already init: %v\n", err) } }