incus icon indicating copy to clipboard operation
incus copied to clipboard

Port network_load_balancers to database generator

Open davidbockelman opened this issue 8 months ago • 1 comments

Created internal/server/db/cluster/networks_load_balancers.go which allows for the network_load_balancers SQL code to be auto-generated with make update-schema. Changed the call sites to functions in internal/server/db/network_load_balancers.go to use the new auto-generated functions. Functions in internal/server/db/network_network_load_balancers.go are no longer used. Fixes #1800

davidbockelman avatar May 02 '25 23:05 davidbockelman

Hi @davidbockelman .

Your pull request has been super helpful to me, guiding me on how to tackle the database generator issue I was assigned. I'm working on network_forwards and it seems pretty analogous to yours.

One thing I think you missed is calling CreateNetworkLoadBalancerConfig after each time you call CreateNetworkLoadBalancer. With the existing framework, I don't think creating a network load balancer automatically creates a config. You would need to do something like how network_integrations handles it.

As I'm working through mine and comparing against yours, I'll let you know if I find anything else.

tonyn10 avatar May 05 '25 04:05 tonyn10

Did a first pass of cleanup on this one.

Other than some formatting issues and other static analysis stuff, this is looking pretty good. I need to do another pass on the actual logic and tweak some more minor things (comments and the like), but I should have this one merged tomorrow.

stgraber avatar May 28 '25 05:05 stgraber