loadbalancer/v2 Support fully populated load balancer#2077
loadbalancer/v2 Support fully populated load balancer#2077jtopjian merged 5 commits intogophercloud:masterfrom
Conversation
|
Build succeeded.
|
|
@notandy can you run |
thx! |
|
looks like the newly used github actions ci is failing... 🤕 |
|
Build succeeded.
|
My guess is that the error always happened in Travis when acceptance tests were updated but it was just being ignored on failure. I'll see if I can figure out the issue. |
|
@notandy Let's see if #2080 fixes the problem. Can you rebase off of master and do a force-push? Something like this should work: $ git checkout master
$ git pull
$ git checkout fully-populated-load-balancer
$ git rebase -i master
# make no changes to the list of commits
$ git push -f sapcc fully-populated-load-balancer |
aae6f3b to
593a990
Compare
For gophercloud#1740 Introduces fully populated load balancer support Co-authored-by: Martin Weindel <martin.weindel@sap.com> Co-authored-by: Anton Khramov <anton.khramov@sap.com>
593a990 to
0d83dda
Compare
thx, it worked. Since I needed to rebase anyway I incorporated the go fmt/import fixes into the inital commits, hope that's fine :) |
|
Build failed.
|
|
recheck |
|
Build succeeded.
|
|
@notandy Thank for working on this. There's a lot going on here. Effectively, these changes reverse the logic of building the various load balancer resources. I understand how this all fits together to create a load balancer, but I'd like to know if these new fields are only applicable when creating a load balancer or if they are able to be used on their own. For example, to create Rules, an L7 Policy first needs created. Then each rule is given the ID of the new Policy during the Is this only possible when creating a load balancer or can this be used when creating policies on their own? For example, is it now possible to do: createOpts := l7policies.CreateOpts{
Name: "redirect-example.com",
ListenerID: "023f2e34-7806-443b-bfae-16c324569a3d",
Action: l7policies.ActionRedirectToURL,
RedirectURL: "http://www.example.com",
Rules: []l7policies.CreateRuleOpts{
...
},
}
l7policy, err := l7policies.Create(lbClient, createOpts).Extract()Whichever the behaviour is, the inline documentation should be updated in more detail. For example, instead of: // Create rules optsThis should be something like: // Rules is a slice of CreateRuleOpts which allows a set of rules
// to be created at the same time the policy is created.
//
// This is only possible to use when creating a fully populated
// load balancer.The new behaviour(s) should also be documented in the various Additionally, I noticed you've added fields to the various Update calls, too. Does this mean it's possible to update all of a load balancer's resources in one call? If so, the unit and acceptance tests for the load balancer should be updated to test the update functionality. Additionally, are the individual resources able to be updated in other places? In other words, focusing on L7 Policies, is it possible to do a bulk update of a Policy's Rules in the Again, thanks for your work on this. Please let me know if you have any questions. |
|
@jtopjian, thanks for the reply.
As pointed out in the documentation (https://docs.openstack.org/api-ref/load-balancer/v2/?expanded=create-a-load-balancer-detail#creating-a-fully-populated-load-balancer), specifying related hierarchically related entities without their UUID is only applicable for POST (create) calls agains the /loabalancers endpoint. The logic behind that resides in the The only call from API side that supports the _graph_create call (and all subsequent entities) is the post() call in load_balancer.py: https://github.com/openstack/octavia/blob/master/octavia/api/v2/controllers/load_balancer.py#L501 Thanks for the hint, I will add inline documentation that clarifies the constraints imposed by Octavia.
Thanks again, it looks for me like a false assumption that this could be possible (since the fully-populated call looks like a declarative API, which is not the case). For example for l7policies, according to upstream code, the PUT (update) hook sanitizes the input params and removes any l7rule references from the PUT body and therefore only supports params as documented: I will remove the wrong
Nope, not according to API or implementation, except of the already supported pool-members batch update. |
…tion for unittest fixture
Constraint (Members OR Monitors) NAND (ListenerID XOR LoadbalancerID) is too complicated to be modelled via struct tags
|
Build succeeded.
|
|
@notandy Nice - thank you! Is this ready for review/merge? |
Yes, please :) |
This adds fully populated load balancer support for Octavia, thus enabling the user to create all entities (lb, pool, member, monitor etc) with a single API call.
Prior to starting a PR, please make sure you have read our
contributor tutorial.
Prior to a PR being reviewed, there needs to be a Github issue that the PR
addresses. Replace the brackets and text below with that issue number.
For #1740
Links to the line numbers/files in the OpenStack source code that support the
code in this PR:
https://github.com/openstack/octavia/blob/master/octavia/api/v2/controllers/load_balancer.py#L500
https://docs.openstack.org/api-ref/load-balancer/v2/?expanded=create-a-load-balancer-detail#creating-a-fully-populated-load-balancer