Skip to content

Commit

Permalink
Merge pull request #986 from vmware-tanzu/topic/zhengxie/main/fix_dlb
Browse files Browse the repository at this point in the history
Fix bug which overrides tags.tag when query dlb
  • Loading branch information
zhengxiexie authored Jan 3, 2025
2 parents 6f3e97f + 358a25f commit 57d792c
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 57d792c

Please sign in to comment.