You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/12/30 14:57:08 UTC

[GitHub] [apisix-dashboard] starsz commented on a change in pull request #1151: fix: search labels with the same key

starsz commented on a change in pull request #1151:
URL: https://github.com/apache/apisix-dashboard/pull/1151#discussion_r550222467



##########
File path: api/internal/handler/label/label.go
##########
@@ -78,15 +78,18 @@ type ListInput struct {
 	Label string `auto_read:"label,query"`
 }
 
-func subsetOf(reqLabels, labels map[string]string) map[string]string {
+func subsetOf(reqLabels map[string]struct{}, labels map[string]string) map[string]string {
 	if len(reqLabels) == 0 {
 		return labels
 	}
 
 	var res = make(map[string]string)
 	for k, v := range labels {
-		l, exist := reqLabels[k]
-		if exist && ((l == "") || v == l) {
+		if _, exist := reqLabels[k]; exist {
+			res[k] = v
+		}
+
+		if _, exist := reqLabels[k+":"+v]; exist {

Review comment:
       Yes.It's the behavior of IDE.




----------------------------------------------------------------
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:
users@infra.apache.org