Skip to content

Commit

Permalink
Merge pull request #988 from vmware-tanzu/topic/zhengxie/v4.2.0/fix_dlb
Browse files Browse the repository at this point in the history
[CP]Fix bug which overrides tags.tag when query dlb(#986)
  • Loading branch information
zhengxiexie authored Jan 6, 2025
2 parents ca82488 + 22774e1 commit 06e7256
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 06e7256

Please sign in to comment.