fix: Ignore absolute path when RepoUrl is provided

Signed-off-by: Mohammad Forutan <mforutan@users.noreply.github.com>
pull/7874/head
Mohammad Forutan 6 years ago
parent c12a9aee02
commit 1dd6e70489

@ -728,7 +728,7 @@ OUTER:
// This does not ensure that the chart is well-formed; only that the requested filename exists.
//
// Order of resolution:
// - relative to current working directory
// - relative to current working directory when --repo flag is not presented
// - if path is absolute or begins with '.', error out here
// - URL
//
@ -737,6 +737,7 @@ func (c *ChartPathOptions) LocateChart(name string, settings *cli.EnvSettings) (
name = strings.TrimSpace(name)
version := strings.TrimSpace(c.Version)
if c.RepoURL == "" {
if _, err := os.Stat(name); err == nil {
abs, err := filepath.Abs(name)
if err != nil {
@ -752,6 +753,7 @@ func (c *ChartPathOptions) LocateChart(name string, settings *cli.EnvSettings) (
if filepath.IsAbs(name) || strings.HasPrefix(name, ".") {
return name, errors.Errorf("path %q not found", name)
}
}
dl := downloader.ChartDownloader{
Out: os.Stdout,

Loading…
Cancel
Save