You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/02/14 01:08:21 UTC

[GitHub] little-cui commented on a change in pull request #279: SCB-336 1.add ut about find instance with tag 2.optimize find api

little-cui commented on a change in pull request #279: SCB-336 1.add ut about find instance with tag 2.optimize find api
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/279#discussion_r168052616
 
 

 ##########
 File path: server/service/util/rule_util.go
 ##########
 @@ -162,53 +156,54 @@ func AllowAcrossDimension(ctx context.Context, providerService *pb.MicroService,
 	return nil
 }
 
-func MatchRules(rules []*pb.ServiceRule, service *pb.MicroService, serviceTags map[string]string) *scerr.Error {
-	if service == nil {
-		return scerr.NewError(scerr.ErrInvalidParams, "service is nil")
+func MatchRules(rulesOfProvider []*pb.ServiceRule, consumer *pb.MicroService, tagsOfConsumer map[string]string) *scerr.Error {
+	if consumer == nil {
+		return scerr.NewError(scerr.ErrInvalidParams, "consumer is nil")
 	}
+	consumerId := consumer.ServiceId
+	v := reflect.Indirect(reflect.ValueOf(consumer))
 
-	v := reflect.Indirect(reflect.ValueOf(service))
-
-	hasWhite := false
-	for _, rule := range rules {
+	isWhite := false
 
 Review comment:
   ?????????????2??????for?????

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services