From 447ce5a2ddfd5144e58e8f56c64d494dadb28506 Mon Sep 17 00:00:00 2001 From: Michelle Noorali Date: Fri, 20 May 2016 17:30:07 -0400 Subject: [PATCH] ref(helm): fix chart url in index file --- pkg/repo/repo.go | 4 +++- pkg/repo/repo_test.go | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/repo/repo.go b/pkg/repo/repo.go index c8004905d..d2c0f14fd 100644 --- a/pkg/repo/repo.go +++ b/pkg/repo/repo.go @@ -135,7 +135,9 @@ func (r *ChartRepository) Index() error { created = time.Now().UTC().String() } - entry := &ChartRef{Chartfile: *chartfile, Name: chartfile.Name, URL: r.URL, Created: created, Digest: hash, Removed: false} + url := filepath.Join(r.URL, key+".tgz") + + entry := &ChartRef{Chartfile: *chartfile, Name: chartfile.Name, URL: url, Created: created, Digest: hash, Removed: false} r.IndexFile.Entries[key] = entry diff --git a/pkg/repo/repo_test.go b/pkg/repo/repo_test.go index 3680691c5..557ab3b41 100644 --- a/pkg/repo/repo_test.go +++ b/pkg/repo/repo_test.go @@ -90,6 +90,10 @@ func TestIndex(t *testing.T) { if v.Created != created { t.Errorf("Expected Created timestamp to be %s, but got %s for chart %s", created, v.Created, chart) } + expectedURL := filepath.Join(cr.URL, chart+".tgz") + if v.URL != expectedURL { + t.Errorf("Expected url in entry to be %s but got %s for chart: %s", expectedURL, v.URL, chart) + } } }