List chart names not charts

pull/439/head
jackgr 10 years ago
parent 5a058775b5
commit 03f859f367

@ -42,13 +42,13 @@ func NewInmemRepoService() IRepoService {
}
// List returns the list of all known chart repositories
func (rs *inmemRepoService) List() ([]IRepo, error) {
func (rs *inmemRepoService) List() ([]string, error) {
rs.RLock()
defer rs.RUnlock()
ret := []IRepo{}
ret := []string{}
for _, r := range rs.repositories {
ret = append(ret, r)
ret = append(ret, r.GetName())
}
return ret, nil

@ -32,7 +32,11 @@ func TestService(t *testing.T) {
t.Fatalf("unexpected repo count; want: %d, have %d.", 1, len(repos))
}
tr := repos[0]
tr, err := rs.Get(repos[0])
if err != nil {
t.Fatalf("cannot get repo named %s: %s", repos[0], err)
}
if err := validateRepo(tr, GCSPublicRepoName, GCSPublicRepoURL, "", GCSRepoFormat, GCSRepoType); err != nil {
t.Fatal(err)
}

@ -118,7 +118,7 @@ type IStorageRepo interface {
// repository based operations, such as search and chart reference resolution.
type IRepoService interface {
// List returns the list of all known chart repositories
List() ([]IRepo, error)
List() ([]string, error)
// Create adds a known repository to the list
Create(repository IRepo) error
// Get returns the repository with the given name

Loading…
Cancel
Save