Skip to content

Fix getLoadBalancerByID accidentally deleting non CCM managed rules + default to TCP proto in lb rules if proto empty#128

Merged
hrak merged 2 commits intomainfrom
fix_lb_proto
Mar 20, 2026
Merged

Fix getLoadBalancerByID accidentally deleting non CCM managed rules + default to TCP proto in lb rules if proto empty#128
hrak merged 2 commits intomainfrom
fix_lb_proto

Conversation

@hrak
Copy link
Member

@hrak hrak commented Mar 20, 2026

Issue #, if available:

Description of changes:

This PR fixes two bugs:

  • default to TCP if a listLoadBalancerRulesResponse contains a loadbalancerrule without a protocol field
  • Filter out non-CCM managed loadbalancer rules in getLoadBalancerByID so those dont get accidentally deleted

Testing performed:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

hrak and others added 2 commits March 20, 2026 13:15
When createLoadBalancerRule is called with an empty protocol,
the API will return the loadbalancerrule without a protocol
field defined when calling listLoadBalancerRules.

CloudStack appears to default to TCP in this case, but this
is not reflected in listLoadBalancerRulesResponse
getLoadBalancerByID queries by publicipid+networkid, which returns all
LB rules on that IP — including rules belonging to other services. The
cleanup loop in EnsureLoadBalancer then deletes these foreign rules.

Apply filterRulesByPrefix (already used in getLoadBalancerByName) to
keep only rules matching the current service's name prefix.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hrak hrak merged commit a52a28a into main Mar 20, 2026
1 check passed
@hrak hrak deleted the fix_lb_proto branch March 20, 2026 13:44
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.

2 participants