-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Allow updating of Load Balancer source CIDR list #10968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.19 #10968 +/- ##
=========================================
Coverage 15.18% 15.18%
- Complexity 11368 11375 +7
=========================================
Files 5415 5415
Lines 476073 476088 +15
Branches 58125 58129 +4
=========================================
+ Hits 72279 72303 +24
+ Misses 395706 395689 -17
- Partials 8088 8096 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@CodeBleu 4.19 is perfectly alright for this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
@DaanHoogland Great, thanks!
|
Yes, we should encode this better. We require least two reviews and minimal 1 "external" tester.
When merged by a committer, we will merge the target branch forward to all release branches and main. |
|
@blueorangutan package |
|
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13717 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian Build Failed (tid-13506) |
|
[SF] Trillian test result (tid-13507)
|
|
@vishesh92 @rohityadavcloud Can I get one or both of you to review this, so we can have 2 reviews and hopefully get this merged in please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for updating Load Balancer source CIDR lists via the API, addressing issue #9313. Previously, the CIDR list could only be set during creation but not modified afterwards.
- Adds CIDR list parameter to the UpdateLoadBalancerRuleCmd API command
- Implements CIDR list validation and update logic in LoadBalancingRulesManagerImpl
- Includes proper rollback handling when CIDR list updates fail
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| UpdateLoadBalancerRuleCmd.java | Adds cidrList parameter to enable CIDR list updates via API |
| LoadBalancingRulesManagerImpl.java | Implements CIDR validation, update logic, and rollback handling |
| LoadBalancerVO.java | Adds setCidrList method to enable CIDR list updates |
| LoadBalancerVOTest.java | Adds unit tests for CIDR list setter functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
server/src/main/java/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
Outdated
Show resolved
Hide resolved
server/src/main/java/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
Outdated
Show resolved
Hide resolved
|
@CodeBleu |
When I first asked about this, I was told this branch was fine and that it can be merged up? |
4.19 will be EOL on 1st September, It will not be updated after that. |
|
@vishesh92 I feel like the failures for checks now is just a glitch and maybe a re-run will resolve? Not sure what is needed at this point. |
it has been addressed by #11537 |
|
@weizhouapache What is the best way to switch this to |
421ddd9 to
d52180e
Compare
from my experience, the best way is, merging remote main branch into local branch and fixing the conflicts. just bare in mind that, log4j 2.x is used since 4.20, so you need to update the code (to use logger/LOGGER/logging, please check other logging messages in the same file) |
|
@DaanHoogland Is this something you think can just be merged before the Sept 1st? I feel like this should be good. The recent copilot changes were minimal and all checks had passed before, but appears that is an issue with checks now, but a fix is in place. It would be nice to not have to make branch changes at this point, if we can get this merged and then merged forward. Thoughts? |
|
We can @CodeBleu , but we'll have to deal with the conflicts that @weizhouapache mentioned at some time; either before merge or after... while merging 4.19 forward. Btw, you are committer now, right? So if you have two reviews and a test report you can merge. |
|
@weizhouapache can we merge #11537 so the test here can be re-ran? Also, if you approve this review then it will meet the 2 reviewers and checks test and should be able to go ahead and merge |
@CodeBleu |
- Replace manual null-check comparison with Objects.equals for clarity and null safety
- Simplify CIDR list rollback to always restore backup value unconditionally
- Add JavaDoc for setCidrList method for improved documentation
d52180e to
182209f
Compare
@weizhouapache I tested it and have my results listed at the top of this PR. If you can test it also, that would be much appreciated 😄 |
|
@rohityadavcloud @weizhouapache @vishesh92 If I can get 1 more review approval and a manual test, I can merge this and get it across the line before Sept 1st . That would be much appreciated. |
@CodeBleu |
|
@weizhouapache as this introduces no backwards incompatibility and @CodeBleu wants it in an older version I think we can merge it in 4.19. We’ll have to deal with the fallout of merging forwards though. |
ok, no objection |
|
and with “we” need to deal I mainly mean @CodeBleu , of course ;) |
Pending another review approval and a manual test from someone else? Also, not sure what time zone the Sept 1st deadline is either, so this could already be an issue to merge it before Sept 1st ? |
It is not forbidden to merge into 4.19 after today @CodeBleu . We won’t support the branch with fixes perse, but you can if you. want. The more pressing issue remains the conflicts. And yes, we generally expect that a tester (not being the author) has given their review (and minimal test description). Tell us what you want to do/how you want to go about it @CodeBleu and we can work towards it. |
| @Parameter(name = ApiConstants.PROTOCOL, type = CommandType.STRING, description = "The protocol for the LB") | ||
| private String lbProtocol; | ||
|
|
||
| @Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.LIST, collectionType = CommandType.STRING, description = "the cidr list to forward traffic from") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since needs to be added
if since is 4.19.4, but it is actually unsupported in 4.20.0 and 4.20.1 (which have been released), it might cause misunderstanding
btw: I have tested the changes. the main problem is, which version should be targeted.
For PRs with api changes or db changes, I suggest to target to latest branch (main)
|
Closing - Created new base off of main and new PR #11568 |
Description
This PR will allow the updating of a loadbalancer rules
CIDR listvia the API.* Should fix #9313
Not 100% sure this is the correct place to base and create PR for, but this issue does exist in
4.19,4.20, andmain. I figure I'd start here and see what is needed to get this into the code base so>= 4.19will have the fixes.I have tested this code in
4.19,4.20, andmainbranches via simulator and all works, just not sure of the process to get this fix into those branches.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
Before, the Source CIDR list was blank (Simulator env)

Tested on
actual test environmentand below is where you can see when it was restricted it didn't connect to mysql, but when opened up and CIDR set to 0.0.0.0/0 it worked. I tested with specific Public IP in CIDR as well (x.x.0.118/32) and this works and you can see in the virtual router for haproxy it set the ACL.Restricted with wrong IP in source CIDR of LB
With correct source CIDR or 0.0.0.0/0
How Has This Been Tested?
How did you try to break this feature and the system with this change?
Ran multiple tests with Cloudmonkey against simulator and actual test environment. See above for testing info