Fix param in create LB Stickyness policy command - #133
Merged
Conversation
vishesh92
marked this pull request as draft
December 2, 2025 09:16
vishesh92
marked this pull request as ready for review
December 2, 2025 09:17
DaanHoogland
approved these changes
Dec 8, 2025
| 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) |
Member
Author
There was a problem hiding this comment.
The issue is that in CloudStack, the map parameter is parsed in different ways. And for this scenario, we need to set name instead of key. So, currently its not working at all.
abh1sar
approved these changes
Aug 3, 2026
abh1sar
left a comment
There was a problem hiding this comment.
LGTM.
Tested with and without the fix
- Created a load balancer rule on an existing source-NAT public IP
(createLoadBalancerRule, port 8080 -> 80, roundrobin). - Reproduced the pre-fix bug directly: called
createLBStickinessPolicy
with the old encoding (param[0].key=cookie-name¶m[0].value=LBCookie).
Server response:
"errortext":"Failed : Stickiness policy does not support param name :null"- i.e. the server read the param name as
nullbecause it looks for
.name, not.key, exactly the bug this PR fixes.
- i.e. the server read the param name as
- Confirmed the fix: same call with
param[0].name=cookie-nameinstead
ofparam[0].keysucceeded (jobstatus: 1, policy created). - Confirmed the response wrapper fix: called
listLBStickinessPolicies
and got back
{"listlbstickinesspoliciesresponse":{"count":1,"stickinesspolicies":[...]}}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.