-
Notifications
You must be signed in to change notification settings - Fork 361
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
Implement per-route options in Cloud Controller #4080
Implement per-route options in Cloud Controller #4080
Conversation
4ce58eb
to
d5e369c
Compare
33d7efb
to
35d8b72
Compare
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.
I'll test the proposed changes on a dev landscape.
I've tested the new feature on a dev landscape and everything works as expected. There are however a few corner cases that we should discuss: 1. "options" with This request is accepted:
It doesn't change anything. Is that intended or should the request be rejected? 2. Valid option key with
Accepted and sets the "options" field to {} (empty map). Shouldn't this be rejected? 3. Create new route without "options" Use the CF CLI to create a new route:
This will send a POST request:
Now the "option" field in the database is set to "null" (text "null"). For existing routes the option field is initially 4. "options" in app manifest Pushing an app with manifest works:
For configuration with |
Did you plan to create a new acceptance test for this feature? You could add it to this capi-bara-test: |
7f6cc57
to
af076fe
Compare
Thanks for your review @jochenehret
You found a recently introduced bug, we fix it. According to the tracking issue, this request should unset all options (which it does now again).
No, this is the expected behavior, as documented in the tracking issue.
There is another post in the tracking issue. @Gerg argues for always providing the
We fixed this - unsetting options in general or loadbalancing-algorithm in particular is not possible any more. |
9be6eb8
to
7eaa6fc
Compare
05041d7
to
1a5eba6
Compare
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.
I've retested the PR with the latest changes and found no issues!
This commit adds a configurable load-balancing algorithm as a first example of per-route options. It adds the 'options' field to the route object in the V3 API, and the app manifest. The options field is an object storing key-value pairs, with 'lb_algo' being the only supported key for now. The supported load-balancing algorithms are 'round-robin' and 'least-connections'. The options field is introduced as a column in the database route table, and forwarded to the Diego backend. Co-authored-by: Alexander Nicke <[email protected]> See: cloudfoundry/capi-release#482 See: https://github.com/cloudfoundry/community/blob/main/toc/rfc/rfc-0027-generic-per-route-features.md
Add documentation for the route options object, and its supported fields.
Overwrite behaviour for route options is now fixed and tested: Existing options are not modified if options is nil, {} or not provided A single option (e.g. loadbalancing-algorithm) can be removed by setting its value to nil adjust test for manifest push: options {key:nil} should not modify the existing value
options default: {} API: options is not nullable specific option is additive specific option is nullable empty hash does not change anything (additive) get empty options -> {} manifest: options and specific option is nullable, but no-op
1a5eba6
to
97440e0
Compare
Changes in cloud_controller_ng: - Implement per-route options in Cloud Controller PR: cloudfoundry/cloud_controller_ng#4080 Author: Clemens Hoffmann <[email protected]> Author: Alexander Nicke <[email protected]> - Bump Ruby to 3.2.6 PR: cloudfoundry/cloud_controller_ng#4127 Author: Seth Boyles <[email protected]>
The new
This might require an update to cf-acceptance-tests |
@sethboyles Fixed with cloudfoundry/capi-bara-tests#106. |
A short explanation of the proposed change:
This Pull-Request adds per-route options to the Cloud Controller. Support is added for the following APIs:
Per-route options support is also added to the manifest.
An explanation of the use cases your change solves
Users / app developers want to define load-balancing algorithms per route, instead of being forced to use the globally defined algorithm.
Links to any other associated PRs
RFC for per-route options: https://github.com/cloudfoundry/community/blob/main/toc/rfc/rfc-0027-generic-per-route-features.md
capi-release issue: Implement per-route options in Cloud Controller capi-release#482
I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
main
branchI have run all the unit tests using
bundle exec rake
I have run CF Acceptance Tests