Support loadBalancerSourceRanges#9
Conversation
|
Also pinging @josvo so he can take a look. So far, I've only fixed the dependencies for Go 1.13 (separate PR #8 , please merge) and added some code to interpret the The actual firewall code will be a bit more involved I think, because we need to add full CRUD support to avoid stray rules. AFAIK the CloudStack API doesn't offer some sort of atomic firewall rule set update. Each rule has to be deleted and recreated one-by-one. Correct @GabrielBrascher ? |
|
Proposed solution:
This ensures that the firewall rules can be updated without service interruption. Caveat: What happens if an identical rule is added twice? Will it be ignore by CS? If yes, additional care needs to be taken not to remove it in step three. This could be done by looking up the returned id in the list of previous IP addresses. |
|
@josvo Ready to be tested. |
|
Test results:
We'll keep working on it. |
|
Figured out how to create and update the firewall rules - create, update and delete is now working properly. |
94278b5 to
3f2118e
Compare
|
I reverted all changes that are covered by the other PRs for easier review. |
|
Hi @onitake Tests:☑️ Creating Service LoadBalancer without
|
|
Thanks for testing! The case that doesn't work is kind of expected... the internal logic is "create before delete" to avoid having no firewall rules during the transition. But of course that doesn't work when entries are added to the rule list. As a workaround, you can replace the rules with "safe" ones (such as 127.0.0.1/32), then change them to the correct list. |
|
Ok, so.... as a first measure, I can make EnsureLoadBalancer fail when it can't create the firewall rules. |
|
I flipped the logic around. |
|
@onitake can you advise when this is ready for merging, thnx |
|
@joschi36 Is this working as expected now, or do I need to take another look? |
|
Works like a charm. |
Fixes #3 .