diff --git a/pkg/downloader/manager.go b/pkg/downloader/manager.go index dc6508d42..9a830c4d5 100644 --- a/pkg/downloader/manager.go +++ b/pkg/downloader/manager.go @@ -320,6 +320,8 @@ func (m *Manager) getRepoNames(deps []*chartutil.Dependency) (map[string]string, if _, err = os.Stat(depPath); os.IsNotExist(err) { return nil, fmt.Errorf("directory %s not found", depPath) + } else if err != nil { + return nil, err } fmt.Fprintf(m.Out, "Repository from local path: %s\n", dd.Repository) @@ -516,13 +518,20 @@ func writeLock(chartpath string, lock *chartutil.RequirementsLock) error { // archive a dep chart from local directory and save it into charts/ func tarFromLocalDir(chartpath string, name string, repo string, version string) (string, error) { destPath := filepath.Join(chartpath, "charts") - origPath, err := filepath.Abs(repo[7:]) + + if !strings.HasPrefix(repo, "file://") { + return "", fmt.Errorf("wrong format: chart %s repository %s", name, repo) + } + + origPath, err := filepath.Abs(strings.TrimPrefix(repo, "file://")) if err != nil { return "", err } if _, err = os.Stat(origPath); os.IsNotExist(err) { return "", fmt.Errorf("directory %s not found: %s", origPath, err) + } else if err != nil { + return "", err } ch, err := chartutil.LoadDir(origPath) diff --git a/pkg/resolver/resolver.go b/pkg/resolver/resolver.go index b0b2000fb..b6654a8ac 100644 --- a/pkg/resolver/resolver.go +++ b/pkg/resolver/resolver.go @@ -65,6 +65,8 @@ func (r *Resolver) Resolve(reqs *chartutil.Requirements, repoNames map[string]st if _, err = os.Stat(depPath); os.IsNotExist(err) { return nil, fmt.Errorf("directory %s not found", depPath) + } else if err != nil { + return nil, err } locked[i] = &chartutil.Dependency{