Skip to content

Commit

Permalink
🐛 support env for export (#4135)
Browse files Browse the repository at this point in the history
Signed-off-by: cuisongliu <[email protected]>
  • Loading branch information
cuisongliu authored Oct 22, 2023
1 parent a271984 commit fef14be
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/clusterfile/pre_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ package clusterfile
import (
"bytes"
"errors"
"os"
"strings"

"helm.sh/helm/v3/pkg/cli/values"
"helm.sh/helm/v3/pkg/getter"
Expand Down Expand Up @@ -46,6 +48,13 @@ func (c *ClusterFile) Process() (err error) {
}
c.once.Do(func() {
err = func() error {
for i := range c.customEnvs {
kv := strings.SplitN(c.customEnvs[i], "=", 2)
if len(kv) == 2 {
logger.Debug("set env: %s=%s", kv[0], kv[1])
_ = os.Setenv(kv[0], kv[1])
}
}
clusterFileData, err := c.loadClusterFile()
if err != nil {
return err
Expand Down

0 comments on commit fef14be

Please sign in to comment.