From 679598897cc695bb73665ab65649203fec75975c Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Mon, 22 Feb 2021 14:05:46 -0500 Subject: [PATCH] fix(pkg/downloader): Use system generated temp directory Signed-off-by: Josh Soref --- pkg/downloader/manager.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/downloader/manager.go b/pkg/downloader/manager.go index d2d3e9f31..c2aba8417 100644 --- a/pkg/downloader/manager.go +++ b/pkg/downloader/manager.go @@ -247,7 +247,11 @@ func (m *Manager) downloadAll(deps []*chart.Dependency) error { } destPath := filepath.Join(m.ChartPath, "charts") - tmpPath := filepath.Join(m.ChartPath, "tmpcharts") + tmpPath, err := ioutil.TempDir("", "tmpcharts-*") + if err != nil { + return errors.Wrap(err, "failed to create tmpcharts dir") + } + os.Remove(tmpPath) // Create 'charts' directory if it doesn't already exist. if fi, err := os.Stat(destPath); err != nil {