Skip to content
This repository was archived by the owner on Jul 16, 2021. It is now read-only.

Commit 86b6e66

Browse files
committed
Don't return error when repos have no chart
Fix #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. Signed-off-by: FengyunPan2 <[email protected]>
1 parent f8afab9 commit 86b6e66

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cmd/chart-repo/utils.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ func syncRepo(dbSession datastore.Session, repoName, repoURL string, authorizati
9999

100100
charts := chartsFromIndex(index, r)
101101
if len(charts) == 0 {
102-
return errors.New("no charts in repository index")
102+
log.Warnf("The repository %s has no charts.", repoName)
103+
return nil
103104
}
104105
err = importCharts(dbSession, charts)
105106
if err != nil {

cmd/chart-repo/utils_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -587,5 +587,5 @@ func Test_emptyChartRepo(t *testing.T) {
587587
m := mock.Mock{}
588588
dbSession := mockstore.NewMockSession(&m)
589589
err := syncRepo(dbSession, "testRepo", "https://my.examplerepo.com", "")
590-
assert.ExistsErr(t, err, "Failed Request")
590+
assert.NoErr(t, err)
591591
}

0 commit comments

Comments
 (0)