Skip to content

Commit

Permalink
[INF-911] Use WithEnv for setting env variable. (#8)
Browse files Browse the repository at this point in the history
modified:   helm/helm.go
  • Loading branch information
jmatt authored Jun 30, 2021
1 parent 4daf907 commit 25a64fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helm/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 25a64fd

Please sign in to comment.