-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add SidecarService Syntax sugar to Service Definition #4686
Conversation
…is tested other than config :). Need API updates too.
…decars for deregistration. Add tests for deregistration.
I wrote a test for this and then realised that we probably don't want that behaviour because:
I think this will need to be documented clearly and we can possibly re-visit but it seems better to not deregister in this case for now. you can always explicitly deregister the sidecar anyway and it's best to think of sidecars as registration syntax sugar rather than first class management of a separate nested resource anyway. I added tests to cover updates generally and specifically for this decision anyway. |
|
||
services := a.State.Services() | ||
if _, ok := services["rabbitmq"]; !ok { | ||
t.Fatalf("missing service") |
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.
Nitpick but should these busing require
helpers?
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.
Yeah could do, it was copy-paste from other similar code I think.
There is one legit failing test here but it's fixed in 630c811 in the next PR in this series which will be merged at the same time. |
* Added new Config for SidecarService in ServiceDefinitions. * WIP: all the code needed for SidecarService is written... none of it is tested other than config :). Need API updates too. * Test coverage for the new sidecarServiceFromNodeService method. * Test API registratrion with SidecarService * Recursive Key Translation 🤦 * Add tests for nested sidecar defintion arrays to ensure they are translated correctly * Use dedicated internal state rather than Service Meta for tracking sidecars for deregistration. Add tests for deregistration. * API struct for agent register. No other endpoint should be affected yet. * Additional test cases to cover updates to API registrations
* Added new Config for SidecarService in ServiceDefinitions. * WIP: all the code needed for SidecarService is written... none of it is tested other than config :). Need API updates too. * Test coverage for the new sidecarServiceFromNodeService method. * Test API registratrion with SidecarService * Recursive Key Translation 🤦 * Add tests for nested sidecar defintion arrays to ensure they are translated correctly * Use dedicated internal state rather than Service Meta for tracking sidecars for deregistration. Add tests for deregistration. * API struct for agent register. No other endpoint should be affected yet. * Additional test cases to cover updates to API registrations
* Added new Config for SidecarService in ServiceDefinitions. * WIP: all the code needed for SidecarService is written... none of it is tested other than config :). Need API updates too. * Test coverage for the new sidecarServiceFromNodeService method. * Test API registratrion with SidecarService * Recursive Key Translation 🤦 * Add tests for nested sidecar defintion arrays to ensure they are translated correctly * Use dedicated internal state rather than Service Meta for tracking sidecars for deregistration. Add tests for deregistration. * API struct for agent register. No other endpoint should be affected yet. * Additional test cases to cover updates to API registrations
* Added new Config for SidecarService in ServiceDefinitions. * WIP: all the code needed for SidecarService is written... none of it is tested other than config :). Need API updates too. * Test coverage for the new sidecarServiceFromNodeService method. * Test API registratrion with SidecarService * Recursive Key Translation 🤦 * Add tests for nested sidecar defintion arrays to ensure they are translated correctly * Use dedicated internal state rather than Service Meta for tracking sidecars for deregistration. Add tests for deregistration. * API struct for agent register. No other endpoint should be affected yet. * Additional test cases to cover updates to API registrations
NOTE: this PR is against the
f-envoy
feature branch as it assumes some of the changes their to proxy definitions and will land along with that work.SidecarService is a new configuration helper for service definitions for use with Connect.
It provided most of the automatic configuration that Managed Proxies benefit from, but without implying that we actually start and supervise the process for you. This design is detailed in the internal RFC.
This implementation includes:
service(s).connect.sidecar_service
nested service definitionsSidecarService
or remove the sidecar from a file-based config, the sidecar is automatically deregistered too.Left for future PR
TODO
As I wrote this PR description I realised that there is one case not tests (and I think not working):