Skip to content

Fix param in create LB Stickyness policy command - #133

Merged
abh1sar merged 2 commits into
apache:mainfrom
shapeblue:fix-lb-stikcyness-policy-param
Aug 3, 2026
Merged

Fix param in create LB Stickyness policy command#133
abh1sar merged 2 commits into
apache:mainfrom
shapeblue:fix-lb-stikcyness-policy-param

Conversation

@vishesh92

Copy link
Copy Markdown
Member

No description provided.

@vishesh92
vishesh92 marked this pull request as draft December 2, 2025 09:16
@vishesh92
vishesh92 marked this pull request as ready for review December 2, 2025 09:17

@sureshanaparti sureshanaparti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm

m := v.(map[string]string)
for i, k := range getSortedKeysFromMap(m) {
u.Set(fmt.Sprintf("param[%d].key", i), k)
u.Set(fmt.Sprintf("param[%d].name", i), k)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any potential regression due to this ?
@vishesh92

@vishesh92 vishesh92 Feb 24, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abh1sar abh1sar left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Tested with and without the fix

  1. Created a load balancer rule on an existing source-NAT public IP
    (createLoadBalancerRule, port 8080 -> 80, roundrobin).
  2. Reproduced the pre-fix bug directly: called createLBStickinessPolicy
    with the old encoding (param[0].key=cookie-name&param[0].value=LBCookie).
    Server response:
    "errortext":"Failed : Stickiness policy does not support param name :null"
    • i.e. the server read the param name as null because it looks for
      .name, not .key, exactly the bug this PR fixes.
  3. Confirmed the fix: same call with param[0].name=cookie-name instead
    of param[0].key succeeded (jobstatus: 1, policy created).
  4. Confirmed the response wrapper fix: called listLBStickinessPolicies
    and got back
    {"listlbstickinesspoliciesresponse":{"count":1,"stickinesspolicies":[...]}}

@abh1sar
abh1sar merged commit d8a7439 into apache:main Aug 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants