You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement per-route options in Cloud Controller (#4080)
* Introduce per-route options
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 route-options documentation
Add documentation for the route options object, and its supported fields.
* Adjust route options behaviour for manifest push
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
* Adjust behaviour to new decisions:
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
* Remove route option validations from manifest_route
* Rename 'lb_algo' and 'loadbalancing-algorithm' to 'algorithm'
* Disallow null in manifest; Cleanup error outputs
---------
Co-authored-by: Alexander Nicke <[email protected]>
inclusion: {in: VALID_LOADBALANCING_ALGORITHMS,message: "must be one of '#{RouteOptionsMessage::VALID_LOADBALANCING_ALGORITHMS.join(', ')}' if present"},
0 commit comments