lxd: Async load-balancer endpoints#18030
Open
MusicDin wants to merge 14 commits intocanonical:mainfrom
Open
Conversation
0681c46 to
42f1ca1
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the network load-balancer REST API in LXD to use asynchronous operations (202 + operation objects) for create/update/delete, aligning these endpoints with the storage_and_network_operations API extension and updating the Go client and lxc CLI accordingly.
Changes:
- Convert network load-balancer POST/PUT/PATCH/DELETE handlers to schedule operations and return
operations.OperationResponse. - Update the Go client interfaces/implementations and
lxc network load-balancercommands to handle returned operations (including readinglisten_addressfrom operation metadata for auto-allocation). - Update OVN cluster notifier calls to wait for the remote operation to complete; update REST API documentation to reflect 202/Operation responses.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lxd/network/driver_ovn.go | Wait for remote load-balancer operations when notifying other cluster members. |
| lxd/network_load_balancers.go | Switch LB create/update/delete endpoints to async operations, add operation metadata + lifecycle emission in op run hook. |
| lxd/db/operationtype/operation_type.go | Add new operation types and map entity types/descriptions (but currently contains critical mapping issues). |
| lxc/network_load_balancer.go | Adapt CLI to new operation-returning client methods; prefer operation metadata for listen address. |
| doc/rest-api.yaml | Update REST API responses for LB endpoints from 200 sync to 202 operation. |
| client/lxd_network_load_balancers.go | Change LB methods to return Operation, with fallback to synchronous behavior when the extension is absent. |
| client/interfaces.go | Update InstanceServer load-balancer method signatures to return Operation. |
9424905 to
38502a3
Compare
77d43eb to
388df4c
Compare
Signed-off-by: Din Music <din.music@canonical.com>
388df4c to
18df0dc
Compare
Signed-off-by: Din Music <din.music@canonical.com>
Signed-off-by: Din Music <din.music@canonical.com>
Signed-off-by: Din Music <din.music@canonical.com>
Signed-off-by: Din Music <din.music@canonical.com>
Signed-off-by: Din Music <din.music@canonical.com>
Signed-off-by: Din Music <din.music@canonical.com>
Signed-off-by: Din Music <din.music@canonical.com>
Signed-off-by: Din Music <din.music@canonical.com>
Signed-off-by: Din Music <din.music@canonical.com>
Signed-off-by: Din Music <din.music@canonical.com>
Signed-off-by: Din Music <din.music@canonical.com>
Signed-off-by: Din Music <din.music@canonical.com>
Signed-off-by: Din Music <din.music@canonical.com>
18df0dc to
83f56cd
Compare
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.
This PR converts network load-balancer endpoints from synchronous to asynchronous, returning operations instead of immediate responses.
API extension:
storage_and_network_operations(extension already landed).Network Load Balancers:
POST /1.0/networks/{name}/load-balancersPUT /1.0/networks/{name}/load-balancers/{listen}PATCH /1.0/networks/{name}/load-balancers/{listen}DELETE /1.0/networks/{name}/load-balancers/{listen}