HelmChartInflationGenerator: inherit environment variables to helm command

This commit is contained in:
Jan-Otto Kröpke
2021-03-09 18:29:32 +01:00
committed by Jan-Otto Kröpke
parent 9e8e7a7fe9
commit a5e6295923
3 changed files with 4 additions and 2 deletions

View File

@@ -76,7 +76,7 @@ func (p *HelmChartInflationGeneratorPlugin) Config(h *resmap.PluginHelpers, conf
cmd := exec.Command(p.HelmBin, args...)
cmd.Stdout = stdout
cmd.Stderr = stderr
cmd.Env = append(cmd.Env,
cmd.Env = append(os.Environ(),
fmt.Sprintf("HELM_CONFIG_HOME=%s", p.HelmHome),
fmt.Sprintf("HELM_CACHE_HOME=%s/.cache", p.HelmHome),
fmt.Sprintf("HELM_DATA_HOME=%s/.data", p.HelmHome),

View File

@@ -84,7 +84,7 @@ func (p *HelmChartInflationGeneratorPlugin) Config(h *resmap.PluginHelpers, conf
cmd := exec.Command(p.HelmBin, args...)
cmd.Stdout = stdout
cmd.Stderr = stderr
cmd.Env = append(cmd.Env,
cmd.Env = append(os.Environ(),
fmt.Sprintf("HELM_CONFIG_HOME=%s", p.HelmHome),
fmt.Sprintf("HELM_CACHE_HOME=%s/.cache", p.HelmHome),
fmt.Sprintf("HELM_DATA_HOME=%s/.data", p.HelmHome),

View File

@@ -12,6 +12,8 @@ import (
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
)
//add tests for https://github.com/kubernetes-sigs/kustomize/pull/3713 if you plan to re-enable tests
func TestHelmChartInflationGenerator(t *testing.T) {
th := kusttest_test.MakeEnhancedHarness(t).
PrepBuiltin("HelmChartInflationGenerator")