MCPcopy Index your code
hub / github.com/coder/coder / runHelmTemplate

Function runHelmTemplate

helm/coder/tests/chart_test.go:291–301  ·  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

289// runHelmTemplate runs helm template on the given chart with the given values and
290// returns the raw output.
291func runHelmTemplate(t testing.TB, helmPath, chartDir, valuesFilePath, namespace string) (string, error) {
292 // Ensure that valuesFilePath exists
293 if _, err := os.Stat(valuesFilePath); err != nil {
294 return "", xerrors.Errorf("values file %q does not exist: %w", valuesFilePath, err)
295 }
296
297 cmd := exec.Command(helmPath, "template", chartDir, "-f", valuesFilePath, "--namespace", namespace)
298 t.Logf("exec command: %v", cmd.Args)
299 out, err := cmd.CombinedOutput()
300 return string(out), err
301}
302
303// lookupHelm ensures that Helm is available in $PATH and returns the path to the
304// 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