Fix resource store errors on empty db
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user