From a2b25b7f2a58b8518d4d0d7e4d75ff872eea021e Mon Sep 17 00:00:00 2001 From: Jeff Valore Date: Wed, 4 Mar 2020 21:30:04 -0500 Subject: [PATCH] fix 'helm dep build' command when chart contains 'git:' dependencies Signed-off-by: Jeff Valore --- pkg/downloader/git_downloader.go | 1 - pkg/downloader/manager.go | 5 +++++ pkg/getter/httpgetter.go | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/downloader/git_downloader.go b/pkg/downloader/git_downloader.go index a6b8694bb..28f7c42fe 100644 --- a/pkg/downloader/git_downloader.go +++ b/pkg/downloader/git_downloader.go @@ -50,7 +50,6 @@ func (g *GitDownloader) ensureGitDirIgnored(repoPath string) error { // DownloadTo will create a temp directory, then fetch a git repo into it. // The git repo will be archived into a chart and copied to the destPath. func (g *GitDownloader) DownloadTo(gitURL string, ref string, destPath string) error { - // the git archive command returns a tgz archive. we need to extract it to get the actual chart files. tmpDir, err := ioutil.TempDir("", "helm") if err != nil { return err diff --git a/pkg/downloader/manager.go b/pkg/downloader/manager.go index ea16e9df2..3983dca9b 100644 --- a/pkg/downloader/manager.go +++ b/pkg/downloader/manager.go @@ -367,6 +367,11 @@ Loop: continue } + // If repo is from git url, continue + if strings.HasPrefix(dd.Repository, "git:") { + continue + } + if dd.Repository == "" { continue } diff --git a/pkg/getter/httpgetter.go b/pkg/getter/httpgetter.go index 320013541..cdca34242 100644 --- a/pkg/getter/httpgetter.go +++ b/pkg/getter/httpgetter.go @@ -27,7 +27,7 @@ import ( "helm.sh/helm/v3/internal/version" ) -// HTTPGetter is the efault HTTP(/S) backend handler +// HTTPGetter is the default HTTP(/S) backend handler type HTTPGetter struct { client *http.Client opts options