Skip to content

Commit

Permalink
[fix] List api may return nil data, which is not permitted (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
kkf1 authored Mar 22, 2023
1 parent c8644a9 commit a105b22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/datasource/etcd/kv/kv_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ func Search(ctx context.Context, req *CacheSearchReq) (*model.KVResponse, bool,
}

openlog.Debug(fmt.Sprintf("using cache to search kv, domain %v, project %v, opts %+v", req.Domain, req.Project, *req.Opts))
result := &model.KVResponse{}
result := &model.KVResponse{
Data: []*model.KVDoc{},
}
cacheKey := kvCache.GetCacheKey(req.Domain, req.Project, req.Opts.Labels)
kvIds, ok := kvCache.LoadKvIDSet(cacheKey)
if !ok {
Expand Down

0 comments on commit a105b22

Please sign in to comment.