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

Function updateHelmDependencies

helm/provisioner/tests/chart_test.go:216–233  ·  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

214
215// updateHelmDependencies runs `helm dependency update .` on the given chartDir.
216func updateHelmDependencies(t testing.TB, helmPath, chartDir string) error {
217 // Remove charts/ from chartDir if it exists.
218 err := os.RemoveAll(filepath.Join(chartDir, "charts"))
219 if err != nil {
220 return xerrors.Errorf("failed to remove charts/ directory: %w", err)
221 }
222
223 // Regenerate the chart dependencies.
224 cmd := exec.Command(helmPath, "dependency", "update", "--skip-refresh", ".")
225 cmd.Dir = chartDir
226 t.Logf("exec command: %v", cmd.Args)
227 out, err := cmd.CombinedOutput()
228 if err != nil {
229 return xerrors.Errorf("failed to run `helm dependency build`: %w\noutput: %s", err, out)
230 }
231
232 return nil
233}
234
235// runHelmTemplate runs helm template on the given chart with the given values and
236// 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