tianxiaoliang commented on a change in pull request #826:
URL: 
https://github.com/apache/servicecomb-service-center/pull/826#discussion_r554998267



##########
File path: server/service/gov/kie/kie_distributor.go
##########
@@ -241,6 +249,70 @@ func (d *Distributor) listDataByKind(kind, project, app, 
env string) (*kie.KVRes
        return d.client.List(context.TODO(), ops...)
 }
 
+func (d *Distributor) generateID(project string, p *gov.Policy) error {
+       if p.Name != "" {
+               return nil
+       }
+       list, _, err := d.listDataByKind(MatchGroup, project, p.Selector.App, 
p.Selector.Environment)
+       if err != nil {
+               return err
+       }
+       alias, err := getAlias(p)
+       if err != nil {
+               return err
+       }
+       var id string
+       for {
+               var repeat bool
+               id = getID()
+               for _, datum := range list.Data {
+                       itemP, err := d.transform(datum, MatchGroup)
+                       if err != nil {
+                               return err
+                       }
+                       temp, err := getAlias(itemP)

Review comment:
       不判重




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to