You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2021/08/16 14:13:53 UTC

[servicecomb-service-center] 01/01: Fix: list gov failed when kie has no data

This is an automated email from the ASF dual-hosted git repository.

littlecui pushed a commit to branch bug2
in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git

commit e2ad769720cf3e6ecf4b49a1a982afa8f174de90
Author: little-cui <su...@qq.com>
AuthorDate: Mon Aug 16 22:11:07 2021 +0800

    Fix: list gov failed when kie has no data
---
 server/service/gov/kie/kie_distributor.go | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/server/service/gov/kie/kie_distributor.go b/server/service/gov/kie/kie_distributor.go
index 88e5a43..d1184ec 100644
--- a/server/service/gov/kie/kie_distributor.go
+++ b/server/service/gov/kie/kie_distributor.go
@@ -329,7 +329,12 @@ func (d *Distributor) listDataByKind(ctx context.Context, kind, project, app, en
 	if len(labels) > 0 {
 		ops = append(ops, kie.WithLabels(labels))
 	}
-	return d.client.List(ctx, ops...)
+	list, rev, err := d.client.List(ctx, ops...)
+	if err == kie.ErrNoChanges {
+		list = &kie.KVResponse{}
+		err = nil
+	}
+	return list, rev, err
 }
 
 func (d *Distributor) generateID(ctx context.Context, project string, p *gov.Policy) error {