diff --git a/cmd/helm/fetch.go b/cmd/helm/fetch.go index 3f84a457d..2aad66f37 100644 --- a/cmd/helm/fetch.go +++ b/cmd/helm/fetch.go @@ -55,6 +55,11 @@ func fetch(cmd *cobra.Command, args []string) error { if filepath.Ext(pname) != ".tgz" { pname += ".tgz" } + return fetchChart(pname) + +} + +func fetchChart(pname string) error { f, err := repo.LoadRepositoriesFile(repositoriesFile()) if err != nil { diff --git a/cmd/helm/install.go b/cmd/helm/install.go index 892c68f14..9168325c0 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -133,5 +133,19 @@ func locateChartPath(name string) (string, error) { if _, err := os.Stat(crepo); err == nil { return filepath.Abs(crepo) } + + // Try fetching the chart from a remote repo into a tmpdir + if filepath.Ext(name) != ".tgz" { + name += ".tgz" + } + if err := fetchChart(name); err == nil { + lname, err := filepath.Abs(filepath.Base(name)) + if err != nil { + return lname, err + } + fmt.Printf("Fetched %s to %s\n", name, lname) + return lname, nil + } + return name, fmt.Errorf("file %q not found", name) }