config: fix CDS gRPC not specifying StreamClusters gRPC method#6253
config: fix CDS gRPC not specifying StreamClusters gRPC method#6253htuch merged 3 commits intoenvoyproxy:masterfrom
Conversation
Signed-off-by: Fred Douglas <fredlas@google.com>
|
Specifically, I was trying to do but 1) it was failing due to the "some_cds_cluster" xDS upstream not existing, which appears hard to fix short of bringing in the entire integration test framework, and 2) I still need to figure out how to verify the gRPC method. |
htuch
left a comment
There was a problem hiding this comment.
Thanks, appreciate the quick fix!
| std::string grpc_method = is_delta ? "envoy.api.v2.ClusterDiscoveryService.DeltaClusters" | ||
| : "envoy.api.v2.ClusterDiscoveryService.StreamClusters"; | ||
| subscription_ = | ||
| Config::SubscriptionFactory::subscriptionFromConfigSource<envoy::api::v2::Cluster>( |
There was a problem hiding this comment.
Can you make SubscriptionFactory an injectable factory (rather than use a wrapper for a static method)? The main difficulty there might be the use of templates, but it could be possible to at least make the Grpc::AsyncClientFactoryPtr injectable..
There was a problem hiding this comment.
It would entail changes to everything that uses SubscriptionFactory, including all the different xDS _api_impls - I would prefer to keep it in a followup PR.
But, while we're discussing it: having looked into it, I agree that SubscriptionFactory is currently not as clean as it could be. But, rather than going further into factory-ness, I would actually argue for the opposite: get rid of SubscriptionFactory, and just have subscriptionFromConfigSource() as a standalone function. SubscriptionFactory is not currently a real factory, and rather is just a Java-style wrapper around what is more naturally a standalone function. As a result, nothing ever deals with a SubscriptionFactory object, and I don't see any way it would be beneficial.
There was a problem hiding this comment.
It would be beneficial in the same way any dependency injection is beneficial; you can create and inject mocks. Anyway, let's agree to do this later as we need to unblock end users, but please keep this on your agenda, as we should have tests.
There was a problem hiding this comment.
So, kind of centralizing what ClusterManagerFactory::createCds, ListenerComponentFactory::createLdsApi, etc currently do?
There was a problem hiding this comment.
I take that back, that wouldn't make sense. CdsApi / LdsApi are not sibling subclasses; they are different interfaces from include/. That's why tests are getting e.g. their MockCdsApis specifically from a mocked ClusterManagerFactory. Maybe there is some improvement to be made, but it seems like it would be a serious overhaul of the structure of the whole [xds]Api setup.
|
Can you explain how we can make the control plane work with both old and new envoy? |
|
There still is a StreamClusters, or rather, these changes are what add it back. (Or maybe "reactivate" or "reenable" would be more appropriate). |
Signed-off-by: Fred Douglas <fredlas@google.com>
Signed-off-by: Fred Douglas fredlas@google.com
Description: Choose gRPC method string to pass to SubscriptionFactory based on whether GRPC or DELTA_GRPC was specified. When the work-in-progress incremental CDS work had its incremental_cds_api_impl merged into cds_api_impl, the StreamClusters was changed (unconditionally) to DeltaClusters.
I wanted to add tests to prevent this particular breaking change from being made again, but found it surprisingly hard, and figured it's better to get it fixed right away.
Fixes #6237