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

Function updateHelmDependencies

helm/coder/tests/chart_test.go:270–287  ·  view source on GitHub ↗

updateHelmDependencies runs `helm dependency update .` on the given chartDir.

(t testing.TB, helmPath, chartDir string)

Source from the content-addressed store, hash-verified

268
269// updateHelmDependencies runs `helm dependency update .` on the given chartDir.
270func updateHelmDependencies(t testing.TB, helmPath, chartDir string) error {
271 // Remove charts/ from chartDir if it exists.
272 err := os.RemoveAll(filepath.Join(chartDir, "charts"))
273 if err != nil {
274 return xerrors.Errorf("failed to remove charts/ directory: %w", err)
275 }
276
277 // Regenerate the chart dependencies.
278 cmd := exec.Command(helmPath, "dependency", "update", "--skip-refresh", ".")
279 cmd.Dir = chartDir
280 t.Logf("exec command: %v", cmd.Args)
281 out, err := cmd.CombinedOutput()
282 if err != nil {
283 return xerrors.Errorf("failed to run `helm dependency build`: %w\noutput: %s", err, out)
284 }
285
286 return nil
287}
288
289// runHelmTemplate runs helm template on the given chart with the given values and
290// returns the raw output.

Callers 2

TestRenderChartFunction · 0.70
TestUpdateGoldenFilesFunction · 0.70

Calls 4

RemoveAllMethod · 0.80
CommandMethod · 0.80
LogfMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected