Skip to content

Commit

Permalink
Don't return error when repos have no chart
Browse files Browse the repository at this point in the history
Fix helm#632
I build a chartmuseum service which has no charts, then add the
chartmuseum repo into kubeapps. But I get a 'error' pod, that is
unfriendly. I think it is better to add log for it.
  • Loading branch information
panfengyun committed May 27, 2019
1 parent f8afab9 commit 147a1dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cmd/chart-repo/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ func syncRepo(dbSession datastore.Session, repoName, repoURL string, authorizati

charts := chartsFromIndex(index, r)
if len(charts) == 0 {
return errors.New("no charts in repository index")
log.Warnf("The repository %s has no charts.", repoName)
return nil
}
err = importCharts(dbSession, charts)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/chart-repo/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,5 +587,5 @@ func Test_emptyChartRepo(t *testing.T) {
m := mock.Mock{}
dbSession := mockstore.NewMockSession(&m)
err := syncRepo(dbSession, "testRepo", "https://my.examplerepo.com", "")
assert.ExistsErr(t, err, "Failed Request")
assert.NoErr(t, err)
}

0 comments on commit 147a1dd

Please sign in to comment.