Skip to content

Commit b214d78

Browse files
committed
Add more feedback changes
1 parent 2537f7a commit b214d78

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

internal/controller/nginx/config/split_clients.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,15 @@ func createRequestMirrorSplitClients(servers []dataplane.VirtualServer) []http.S
4141
for _, server := range servers {
4242
mirrorPathToPercentage := extractMirrorTargetsWithPercentages(server.PathRules)
4343

44-
for _, pathRule := range server.PathRules {
45-
mirrorPercentage := mirrorPathToPercentage[pathRule.Path]
46-
47-
if mirrorPercentage != nil && *mirrorPercentage != 100 {
44+
for path, percentage := range mirrorPathToPercentage {
45+
if percentage != nil && *percentage != 100 {
4846
splitClient := http.SplitClient{
4947
// this has to be something unique and able to be accessed from the server block
50-
VariableName: convertSplitClientVariableName(fmt.Sprintf("%s_%.2f", pathRule.Path, *mirrorPercentage)),
48+
VariableName: convertSplitClientVariableName(fmt.Sprintf("%s_%.2f", path, *percentage)),
5149
Distributions: []http.SplitClientDistribution{
5250
{
53-
Percent: fmt.Sprintf("%.2f", *mirrorPercentage),
54-
Value: pathRule.Path,
51+
Percent: fmt.Sprintf("%.2f", *percentage),
52+
Value: path,
5553
},
5654
{
5755
Percent: "*",

0 commit comments

Comments
 (0)