From fccb5538e9a87b9295a859b1258fdd5938c1a106 Mon Sep 17 00:00:00 2001 From: Ryan Payton Date: Thu, 24 Aug 2017 13:00:34 -0700 Subject: [PATCH 01/13] v2.6 Docker container was not found. updated to v2.6.0 --- pkg/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/version/version.go b/pkg/version/version.go index 71b6af465..74d76a70d 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -26,7 +26,7 @@ var ( // Increment major number for new feature additions and behavioral changes. // Increment minor number for bug fixes and performance enhancements. // Increment patch number for critical fixes to existing releases. - Version = "v2.6" + Version = "v2.6.0" // BuildMetadata is extra build time data BuildMetadata = "unreleased" From a996f6089ee06aca2f7e47580ec49066443308a3 Mon Sep 17 00:00:00 2001 From: Ryan Payton Date: Fri, 25 Aug 2017 15:49:40 -0700 Subject: [PATCH 02/13] added a RelativeIndex() func to helmhome to return a relative path to the index files. Also updated repo_add.go to use this new fun --- cmd/helm/repo_add.go | 4 +++- pkg/helm/helmpath/helmhome.go | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/helm/repo_add.go b/cmd/helm/repo_add.go index b172d016c..c82578a3f 100644 --- a/cmd/helm/repo_add.go +++ b/cmd/helm/repo_add.go @@ -86,7 +86,8 @@ func addRepository(name, url string, home helmpath.Home, certFile, keyFile, caFi return fmt.Errorf("repository name (%s) already exists, please specify a different name", name) } - cif := home.CacheIndex(name) + cif := home.RelativeIndex(name) + c := repo.Entry{ Name: name, Cache: cif, @@ -96,6 +97,7 @@ func addRepository(name, url string, home helmpath.Home, certFile, keyFile, caFi CAFile: caFile, } + r, err := repo.NewChartRepository(&c, getter.All(settings)) if err != nil { return err diff --git a/pkg/helm/helmpath/helmhome.go b/pkg/helm/helmpath/helmhome.go index 2f9877f85..7afb96364 100644 --- a/pkg/helm/helmpath/helmhome.go +++ b/pkg/helm/helmpath/helmhome.go @@ -61,6 +61,12 @@ func (h Home) CacheIndex(name string) string { return h.Path("repository", "cache", target) } +// RelativeIndex returns the relative path to an index for the given named repository. +func (h Home) RelativeIndex(name string) string { + target := fmt.Sprintf("%s-index.yaml", name) + return filepath.Join(target) +} + // Starters returns the path to the Helm starter packs. func (h Home) Starters() string { return h.Path("starters") From 618aaba217a15641d4adf4134ac472cc46ef4042 Mon Sep 17 00:00:00 2001 From: Ryan Payton Date: Fri, 25 Aug 2017 15:53:47 -0700 Subject: [PATCH 03/13] reverting Version back to major.minor --- pkg/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/version/version.go b/pkg/version/version.go index 74d76a70d..71b6af465 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -26,7 +26,7 @@ var ( // Increment major number for new feature additions and behavioral changes. // Increment minor number for bug fixes and performance enhancements. // Increment patch number for critical fixes to existing releases. - Version = "v2.6.0" + Version = "v2.6" // BuildMetadata is extra build time data BuildMetadata = "unreleased" From fa6face8a9ed3754e82c9502d0a6d04c9f879086 Mon Sep 17 00:00:00 2001 From: Ryan Payton Date: Fri, 25 Aug 2017 16:05:26 -0700 Subject: [PATCH 04/13] removing blank line --- cmd/helm/repo_add.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmd/helm/repo_add.go b/cmd/helm/repo_add.go index c82578a3f..7fb20d02d 100644 --- a/cmd/helm/repo_add.go +++ b/cmd/helm/repo_add.go @@ -87,7 +87,6 @@ func addRepository(name, url string, home helmpath.Home, certFile, keyFile, caFi } cif := home.RelativeIndex(name) - c := repo.Entry{ Name: name, Cache: cif, @@ -97,7 +96,6 @@ func addRepository(name, url string, home helmpath.Home, certFile, keyFile, caFi CAFile: caFile, } - r, err := repo.NewChartRepository(&c, getter.All(settings)) if err != nil { return err From 878dacb8edf779f9d318be9d348e641149c49efc Mon Sep 17 00:00:00 2001 From: Ryan Payton Date: Mon, 28 Aug 2017 19:06:18 -0700 Subject: [PATCH 05/13] adding unit tests for #2839 --- pkg/helm/helmpath/helmhome_unix_test.go | 1 + pkg/helm/helmpath/helmhome_windows_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg/helm/helmpath/helmhome_unix_test.go b/pkg/helm/helmpath/helmhome_unix_test.go index 153e506e0..339883f22 100644 --- a/pkg/helm/helmpath/helmhome_unix_test.go +++ b/pkg/helm/helmpath/helmhome_unix_test.go @@ -36,6 +36,7 @@ func TestHelmHome(t *testing.T) { isEq(t, hh.LocalRepository(), "/r/repository/local") isEq(t, hh.Cache(), "/r/repository/cache") isEq(t, hh.CacheIndex("t"), "/r/repository/cache/t-index.yaml") + isEq(t, hh.RelativeIndex("t"), "t-index.yaml") isEq(t, hh.Starters(), "/r/starters") isEq(t, hh.Archive(), "/r/cache/archive") } diff --git a/pkg/helm/helmpath/helmhome_windows_test.go b/pkg/helm/helmpath/helmhome_windows_test.go index d29c29b60..779454cc3 100644 --- a/pkg/helm/helmpath/helmhome_windows_test.go +++ b/pkg/helm/helmpath/helmhome_windows_test.go @@ -33,6 +33,7 @@ func TestHelmHome(t *testing.T) { isEq(t, hh.LocalRepository(), "r:\\repository\\local") isEq(t, hh.Cache(), "r:\\repository\\cache") isEq(t, hh.CacheIndex("t"), "r:\\repository\\cache\\t-index.yaml") + isEq(t, hh.RelativeIndex("t"), "t-index.yaml") isEq(t, hh.Starters(), "r:\\starters") isEq(t, hh.Archive(), "r:\\cache\\archive") } From 5a5144d4d7eb5d98314e34e05d863ec7739e2ba2 Mon Sep 17 00:00:00 2001 From: Ryan Payton Date: Thu, 7 Sep 2017 12:57:23 -0700 Subject: [PATCH 06/13] updating DownloadIndexFile function call to pass in HELM_HOME --- cmd/helm/init.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/helm/init.go b/cmd/helm/init.go index cc70c45ba..680cb417b 100644 --- a/cmd/helm/init.go +++ b/cmd/helm/init.go @@ -295,7 +295,7 @@ func ensureDefaultRepos(home helmpath.Home, out io.Writer, skipRefresh bool) err if fi, err := os.Stat(repoFile); err != nil { fmt.Fprintf(out, "Creating %s \n", repoFile) f := repo.NewRepoFile() - sr, err := initStableRepo(home.CacheIndex(stableRepository), skipRefresh) + sr, err := initStableRepo(home.CacheIndex(stableRepository), skipRefresh, home) if err != nil { return err } @@ -314,7 +314,7 @@ func ensureDefaultRepos(home helmpath.Home, out io.Writer, skipRefresh bool) err return nil } -func initStableRepo(cacheFile string, skipRefresh bool) (*repo.Entry, error) { +func initStableRepo(cacheFile string, skipRefresh bool, home helmpath.Home) (*repo.Entry, error) { c := repo.Entry{ Name: stableRepository, URL: stableRepositoryURL, @@ -331,7 +331,7 @@ func initStableRepo(cacheFile string, skipRefresh bool) (*repo.Entry, error) { // In this case, the cacheFile is always absolute. So passing empty string // is safe. - if err := r.DownloadIndexFile(""); err != nil { + if err := r.DownloadIndexFile(home.String()); err != nil { return nil, fmt.Errorf("Looks like %q is not a valid chart repository or cannot be reached: %s", stableRepositoryURL, err.Error()) } From 3e17e2a672501c5976e62358d802aab310bb05b7 Mon Sep 17 00:00:00 2001 From: Ryan Payton Date: Thu, 7 Sep 2017 13:13:22 -0700 Subject: [PATCH 07/13] modified the init functions to use relativeindex instead of cacheindex. everything seems to be working --- cmd/helm/init.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/helm/init.go b/cmd/helm/init.go index 680cb417b..9ae8943d5 100644 --- a/cmd/helm/init.go +++ b/cmd/helm/init.go @@ -295,11 +295,11 @@ func ensureDefaultRepos(home helmpath.Home, out io.Writer, skipRefresh bool) err if fi, err := os.Stat(repoFile); err != nil { fmt.Fprintf(out, "Creating %s \n", repoFile) f := repo.NewRepoFile() - sr, err := initStableRepo(home.CacheIndex(stableRepository), skipRefresh, home) + sr, err := initStableRepo(home.RelativeIndex(stableRepository), skipRefresh, home) if err != nil { return err } - lr, err := initLocalRepo(home.LocalRepository(localRepositoryIndexFile), home.CacheIndex("local")) + lr, err := initLocalRepo(home.LocalRepository(localRepositoryIndexFile), home.RelativeIndex("local")) if err != nil { return err } From 8c62e265321a37e93f6c5a63edeabf33f348544b Mon Sep 17 00:00:00 2001 From: Ryan Payton Date: Thu, 7 Sep 2017 13:33:37 -0700 Subject: [PATCH 08/13] reverted initLocalRepo call to use CacheIndex since RelativeIndex was causing 'make test' to create a symlink in testing directory --- cmd/helm/init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/helm/init.go b/cmd/helm/init.go index 9ae8943d5..16065614d 100644 --- a/cmd/helm/init.go +++ b/cmd/helm/init.go @@ -299,7 +299,7 @@ func ensureDefaultRepos(home helmpath.Home, out io.Writer, skipRefresh bool) err if err != nil { return err } - lr, err := initLocalRepo(home.LocalRepository(localRepositoryIndexFile), home.RelativeIndex("local")) + lr, err := initLocalRepo(home.LocalRepository(localRepositoryIndexFile), home.CacheIndex("local")) if err != nil { return err } From 85daeb657fd317adb112d3aa94e07ec6783247a0 Mon Sep 17 00:00:00 2001 From: Ryan Payton Date: Thu, 14 Sep 2017 14:44:19 -0700 Subject: [PATCH 09/13] fixing initStableRepo func call to have correct parameters passed to it --- cmd/helm/init.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/helm/init.go b/cmd/helm/init.go index 28a21f811..56d30b4a3 100644 --- a/cmd/helm/init.go +++ b/cmd/helm/init.go @@ -295,7 +295,7 @@ func ensureDefaultRepos(home helmpath.Home, out io.Writer, skipRefresh bool) err if fi, err := os.Stat(repoFile); err != nil { fmt.Fprintf(out, "Creating %s \n", repoFile) f := repo.NewRepoFile() - sr, err := initStableRepo(home.RelativeIndex(stableRepository), skipRefresh, home) + sr, err := initStableRepo(home.RelativeIndex(stableRepository), out, skipRefresh, home) if err != nil { return err } @@ -315,7 +315,7 @@ func ensureDefaultRepos(home helmpath.Home, out io.Writer, skipRefresh bool) err } -func initStableRepo(cacheFile string, out io.Writer, skipRefresh bool, home helmPath.Home) (*repo.Entry, error) { +func initStableRepo(cacheFile string, out io.Writer, skipRefresh bool, home helmpath.Home) (*repo.Entry, error) { fmt.Fprintf(out, "Adding %s repo with URL: %s \n", stableRepository, stableRepositoryURL) c := repo.Entry{ Name: stableRepository, From 6b8a119c8853d09c25c34a1db3e5bb93b6da36cd Mon Sep 17 00:00:00 2001 From: Ryan Payton Date: Fri, 15 Sep 2017 15:38:18 -0700 Subject: [PATCH 10/13] fixing formatting according to gofmt --- cmd/helm/init.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/helm/init.go b/cmd/helm/init.go index 56d30b4a3..bafe5231f 100644 --- a/cmd/helm/init.go +++ b/cmd/helm/init.go @@ -314,7 +314,6 @@ func ensureDefaultRepos(home helmpath.Home, out io.Writer, skipRefresh bool) err return nil } - func initStableRepo(cacheFile string, out io.Writer, skipRefresh bool, home helmpath.Home) (*repo.Entry, error) { fmt.Fprintf(out, "Adding %s repo with URL: %s \n", stableRepository, stableRepositoryURL) c := repo.Entry{ From d9f3bdfa67dc84d9e7f26f070ae9a01c83980c8d Mon Sep 17 00:00:00 2001 From: "Christopher A. Stelma" Date: Thu, 28 Sep 2017 13:56:58 -0700 Subject: [PATCH 11/13] fix remaining known local/relative paths --- cmd/helm/init.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cmd/helm/init.go b/cmd/helm/init.go index bafe5231f..35aa6c4b2 100644 --- a/cmd/helm/init.go +++ b/cmd/helm/init.go @@ -21,6 +21,7 @@ import ( "fmt" "io" "os" + "path/filepath" "github.com/spf13/cobra" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -330,9 +331,7 @@ func initStableRepo(cacheFile string, out io.Writer, skipRefresh bool, home helm return &c, nil } - // In this case, the cacheFile is always absolute. So passing empty string - // is safe. - if err := r.DownloadIndexFile(home.String()); err != nil { + if err := r.DownloadIndexFile(home.Cache()); err != nil { return nil, fmt.Errorf("Looks like %q is not a valid chart repository or cannot be reached: %s", stableRepositoryURL, err.Error()) } @@ -348,7 +347,12 @@ func initLocalRepo(indexFile, cacheFile string, out io.Writer) (*repo.Entry, err } //TODO: take this out and replace with helm update functionality - os.Symlink(indexFile, cacheFile) + fp, err := filepath.Rel(indexFile, cacheFile) + if err != nil { + return nil, err + } + pth := filepath.Join(fp) + os.Symlink(pth, cacheFile) } else if fi.IsDir() { return nil, fmt.Errorf("%s must be a file, not a directory", indexFile) } From 7eb76611606b32019fa50c07d9363f213c3ef7ec Mon Sep 17 00:00:00 2001 From: "Christopher A. Stelma" Date: Thu, 28 Sep 2017 16:40:55 -0700 Subject: [PATCH 12/13] fix path relativity --- cmd/helm/init.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/helm/init.go b/cmd/helm/init.go index 35aa6c4b2..a14d945a2 100644 --- a/cmd/helm/init.go +++ b/cmd/helm/init.go @@ -300,7 +300,7 @@ func ensureDefaultRepos(home helmpath.Home, out io.Writer, skipRefresh bool) err if err != nil { return err } - lr, err := initLocalRepo(home.LocalRepository(localRepositoryIndexFile), home.CacheIndex("local"), out) + lr, err := initLocalRepo(home.LocalRepository(localRepositoryIndexFile), home.CacheIndex("local"), out, home) if err != nil { return err } @@ -338,7 +338,7 @@ func initStableRepo(cacheFile string, out io.Writer, skipRefresh bool, home helm return &c, nil } -func initLocalRepo(indexFile, cacheFile string, out io.Writer) (*repo.Entry, error) { +func initLocalRepo(indexFile, cacheFile string, out io.Writer, home helmpath.Home) (*repo.Entry, error) { if fi, err := os.Stat(indexFile); err != nil { fmt.Fprintf(out, "Adding %s repo with URL: %s \n", localRepository, localRepositoryURL) i := repo.NewIndexFile() @@ -347,11 +347,11 @@ func initLocalRepo(indexFile, cacheFile string, out io.Writer) (*repo.Entry, err } //TODO: take this out and replace with helm update functionality - fp, err := filepath.Rel(indexFile, cacheFile) + fp, err := filepath.Rel(cacheFile, indexFile) if err != nil { return nil, err } - pth := filepath.Join(fp) + pth := home.Path(fp) os.Symlink(pth, cacheFile) } else if fi.IsDir() { return nil, fmt.Errorf("%s must be a file, not a directory", indexFile) From 146b94be3b564c92a6782e8b9686bb38ceb40263 Mon Sep 17 00:00:00 2001 From: "Christopher A. Stelma" Date: Mon, 23 Oct 2017 13:42:54 -0700 Subject: [PATCH 13/13] allow cacheFile to be relative for local index --- cmd/helm/init.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/helm/init.go b/cmd/helm/init.go index a14d945a2..e331fb5da 100644 --- a/cmd/helm/init.go +++ b/cmd/helm/init.go @@ -300,7 +300,7 @@ func ensureDefaultRepos(home helmpath.Home, out io.Writer, skipRefresh bool) err if err != nil { return err } - lr, err := initLocalRepo(home.LocalRepository(localRepositoryIndexFile), home.CacheIndex("local"), out, home) + lr, err := initLocalRepo(home.LocalRepository(localRepositoryIndexFile), home.RelativeIndex("local"), out, home) if err != nil { return err } @@ -347,12 +347,12 @@ func initLocalRepo(indexFile, cacheFile string, out io.Writer, home helmpath.Hom } //TODO: take this out and replace with helm update functionality - fp, err := filepath.Rel(cacheFile, indexFile) + fp, err := filepath.Rel(filepath.Join(home.Cache(), cacheFile), indexFile) if err != nil { return nil, err } pth := home.Path(fp) - os.Symlink(pth, cacheFile) + os.Symlink(pth, filepath.Join(home.Cache(), cacheFile)) } else if fi.IsDir() { return nil, fmt.Errorf("%s must be a file, not a directory", indexFile) }