-
Notifications
You must be signed in to change notification settings - Fork 368
Support Hash-Based Routing #4746
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
Support Hash-Based Routing #4746
Conversation
…ute_options_message
philippthun
left a comment
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.
Most comments are minor things...
There is a file test-manifest-roundrobin.yml which seems to be some leftover.
I don't think we should modify spec/unit/messages/validators_spec.rb. I see that this was already done for the other route options, but from my point of view this file is more for generic validators and not for specific ones. The tests should be moved into a file route_options_message_spec.rb.
Changes in cloud_controller_ng:
- Support Hash-Based Routing
PR: cloudfoundry/cloud_controller_ng#4746
Author: Clemens Hoffmann <clemens.hoffmann@sap.com>
* Add loadbalancing option hash, and hash_header/hash_balance. Add validations * Add basic options validation to manifest_routes_update_message * Add basic tests for manifest route updates * Simplify validations, improve error messages, adjust tests * Add validation for hash balance being a float * Have consistent validations in manifest_routes_updates_message and route_options_message * Minor refactoring * Add check for hash_balance value being 0 or >=1.1 * Transform hash_balance to string in the route model before saving * Validate the route merged with the route update from the message. * Attempt to forward errors in route_update validation to the client * Add route options changes to app event * Add new hash options to mnifest route * Add new hash options to route properties presenter * Move additional validation to route model * Move final options cleanup to route model * Proper error validation and forwarding * Forward proper error message on route updates * Add some logging to find the manifest issue * Add more logging * Logging in app_manifest_message * Test a few things * Test a few things pt 2 * Test a few things pt 3 * Test a few things pt 4 * Test a few things pt 5 * Test a few things pt 6 * Cleanup logging * Use symbolized_keys in route_update * WIP * Add more validations and tests * Add more tests for route_update * Add more tests * Some test fixes and cleanup * Use blank? instead of nil? for loadbalancing check * Fix rubocop issues * Fix rubocop spec issues * Refactor to resolve rubocop complexity findings * Remove test file * Move all route option message tests from validator spec to new spec file * Introduce stub config in validator spec to fix execution of standalone spec test * Fix typos and validation logic * Fix validation function name inconsistencies * Fix remaining issues found in review * revert change to validators spec
This Pull-Request replaces #4696.
This Pull-Request adds support for hash-based routing to Cloud Controller.
Summary:
The routes model is enhanced as follows:
hashis added as a validloadbalancingoptionhash_headeris added as a per-route option. The option is mandatory whenloadbalancing=hashhash_balanceis added as a per-route option. The option is optional whenloadbalancing=hashValidation of these options is added when creating and updating both via API and via manifest. All validations that do not need the context of a potentially existing route during an update, are executed in the message:
Further validations and cleanups are performed on the route model, as they need the context of existing routes:
hash, then Hash Header must be specifiedThe route options are still stored as a raw JSON string in the routes table.
Links:
Thanks for contributing to cloud_controller_ng. To speed up the process of reviewing your pull request please provide us with:
A short explanation of the proposed change:
An explanation of the use cases your change solves
Links to any other associated PRs
I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
mainbranchI have run all the unit tests using
bundle exec rakeI have run CF Acceptance Tests