MCPcopy Create free account
hub / github.com/coder/coder / runHelmTemplate

Function runHelmTemplate

helm/provisioner/tests/chart_test.go:237–247  ·  view source on GitHub ↗

runHelmTemplate runs helm template on the given chart with the given values and returns the raw output.

(t testing.TB, helmPath, chartDir, valuesFilePath, namespace string)

Source from the content-addressed store, hash-verified

235// runHelmTemplate runs helm template on the given chart with the given values and
236// returns the raw output.
237func runHelmTemplate(t testing.TB, helmPath, chartDir, valuesFilePath, namespace string) (string, error) {
238 // Ensure that valuesFilePath exists
239 if _, err := os.Stat(valuesFilePath); err != nil {
240 return "", xerrors.Errorf("values file %q does not exist: %w", valuesFilePath, err)
241 }
242
243 cmd := exec.Command(helmPath, "template", chartDir, "-f", valuesFilePath, "--namespace", namespace)
244 t.Logf("exec command: %v", cmd.Args)
245 out, err := cmd.CombinedOutput()
246 return string(out), err
247}
248
249// lookupHelm ensures that Helm is available in $PATH and returns the path to the
250// Helm executable.

Callers 2

TestRenderChartFunction · 0.70
TestUpdateGoldenFilesFunction · 0.70

Calls 3

CommandMethod · 0.80
LogfMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected