Skip to content

Commit

Permalink
Fix bug which overrides tags.tag when query dlb
Browse files Browse the repository at this point in the history
Search query supports multiple tags.scope and tags.tag, no need to construct a map.
  • Loading branch information
zhengxiexie committed Jan 3, 2025
1 parent 6f3e97f commit 358a25f
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions pkg/clean/clean_dlb.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,11 @@ func httpQueryDLBResources(cluster *nsx.Cluster, cf *config.NSXOperatorConfig, r
"&tags.tag:" + TagDLB

pairs := strings.Split(queryParam, "&")
params := make(map[string]string)
for _, pair := range pairs {
kv := strings.Split(pair, ":")
if len(kv) == 2 {
params[kv[0]] = kv[1]
}
}
var encodedPairs []string
for key, value := range params {
encodedKey := neturl.QueryEscape(key)
encodedValue := neturl.QueryEscape(value)
for _, pair := range pairs {
keyValue := strings.Split(pair, ":")
encodedKey := neturl.QueryEscape(keyValue[0])
encodedValue := neturl.QueryEscape(keyValue[1])
encodedPairs = append(encodedPairs, fmt.Sprintf("%s:%s", encodedKey, encodedValue))
}

Expand Down

0 comments on commit 358a25f

Please sign in to comment.