Fix resource store errors on empty db

This commit is contained in:
Soam Vasani
2016-11-02 00:23:06 -07:00
parent 320b56bd68
commit 49acdc49eb
2 changed files with 14 additions and 1 deletions
+5
View File
@@ -132,9 +132,14 @@ func (rs *ResourceStore) delete(typename, rkey string) error {
return err
}
// getAll finds all entries under key. If none or found or key
// doesn't exist, returns an empty slice.
func (rs *ResourceStore) getAll(key string) ([]string, error) {
resp, err := rs.KeysAPI.Get(context.Background(), key, &client.GetOptions{Recursive: true})
if err != nil {
if client.IsKeyNotFound(err) {
return []string{}, nil
}
return nil, err
}