odcds: convert ODCDS over ADS to pre-cluster-single-subscription#41174
odcds: convert ODCDS over ADS to pre-cluster-single-subscription#41174KBaichoo merged 3 commits intoenvoyproxy:mainfrom
Conversation
Signed-off-by: Adi Suissa-Peleg <adip@google.com>
|
This is a continuation of #40988 and uses the component introduced there to fix a bug where OD-CDS isn't working when |
| Upstream::OdCdsApiHandlePtr); | ||
| } | ||
| } | ||
| if (odcds == nullptr) { |
There was a problem hiding this comment.
should this be an else block instead? E.g.:
if (Runtime::runtimeFeatureEnabled("envoy.reloadable_features.odcds_over_ads_fix")) {
...
} else {
odcds = THROW_OR_RETURN_VALUE(cm.allocateOdCdsApi(&Upstream::OdCdsApiImpl::create,
odcds_config->source(), absl::nullopt,
validation_visitor),
Upstream::OdCdsApiHandlePtr);
}
Or is it written as intentional fallback in case when flag is enabled and on_demand_cds fails to initialize for some reason?
There was a problem hiding this comment.
It should be the else of the 2 conditions above, so I could rewrite it as follows:
if ((Runtime::runtimeFeatureEnabled("envoy.reloadable_features.odcds_over_ads_fix")) && (odcds_config->source().config_source_specifier_case() ==
envoy::config::core::v3::ConfigSource::ConfigSourceSpecifierCase::kAds)) {
odcds = THROW_OR_RETURN_VALUE(cm.allocateOdCdsApi(&Upstream::XdstpOdCdsApiImpl::create,
odcds_config->source(), absl::nullopt,
validation_visitor),
Upstream::OdCdsApiHandlePtr);
} else {
...
I'm not against it, and just thought that the first case is more readable, but I'm happy to change this if you think otherwise (I'm really good with both options).
There was a problem hiding this comment.
sounds good, i missed that it was else for 2 conditions above
|
|
||
| class AdsIntegrationTest : public AdsDeltaSotwIntegrationSubStateParamTest, | ||
| public HttpIntegrationTest { | ||
| class AdsIntegrationTestBase : public Grpc::BaseGrpcClientIntegrationParamTest, |
There was a problem hiding this comment.
do we expect multiple parallel subclasses of AdsIntegrationTestBase class in future? If not, could just keep is simple with one base class
There was a problem hiding this comment.
Good question.
There are already multiple sub-classes of AdsIntegrationTest, but they all use the same TestWithParam parameters (although some might not need to). I think the others will need to be refactored (less parameters) to decrease the tests runtime.
KBaichoo
left a comment
There was a problem hiding this comment.
Thank you for working on this. LGTM besides small comments.
changelogs/current.yaml
Outdated
| was not being properly extracted in the final Prometheus stat name. | ||
| - area: odcds | ||
| change: | | ||
| Fixed a bug where using OD-CDS without cds_config would not workin some |
There was a problem hiding this comment.
Oops, thanks, fixed.
|
|
||
| // A singleton through which all subscriptions will be processed. | ||
| XdstpOdcdsSubscriptionsManagerSharedPtr subscriptions_manager_; | ||
| bool old_ads_; |
| // TODO(adisuissa): convert the config_source to optional. | ||
| bool old_ads = false; | ||
| if (config_source.config_source_specifier_case() == | ||
| envoy::config::core::v3::ConfigSource::ConfigSourceSpecifierCase::kAds) { |
There was a problem hiding this comment.
why is old_ads not just equal to the test that sets it to true?
e.g.
const bool old_ads = config_source.config_source_specifier_case() ==
envoy::config::core::v3::ConfigSource::ConfigSourceSpecifierCase::kAds;
There was a problem hiding this comment.
Good idea, fixed.
|
/wait |
Signed-off-by: Adi Suissa-Peleg <adip@google.com>
Signed-off-by: Adi Suissa-Peleg <adip@google.com>
Commit Message: tcp_proxy: fix OD-CDS over ADS Additional Description: This PR is similar to #41174 (and uses the same component to achieve the same goal). The fix allows proper use of tcp_proxy on-demand cluster discovery when used over ADS. Risk Level: low - only impacts OD-CDS over tcp_proxy Testing: Added integration tests. Docs Changes: N/A Release Notes: Added Platform Specific Features: N/A Runtime guard: Added `envoy.reloadable_features.tcp_proxy_odcds_over_ads_fix` to disable the behavior. --------- Signed-off-by: Adi Suissa-Peleg <adip@google.com>
Commit Message: tcp_proxy: fix OD-CDS over ADS Additional Description: This PR is similar to envoyproxy#41174 (and uses the same component to achieve the same goal). The fix allows proper use of tcp_proxy on-demand cluster discovery when used over ADS. Risk Level: low - only impacts OD-CDS over tcp_proxy Testing: Added integration tests. Docs Changes: N/A Release Notes: Added Platform Specific Features: N/A Runtime guard: Added `envoy.reloadable_features.tcp_proxy_odcds_over_ads_fix` to disable the behavior. --------- Signed-off-by: Adi Suissa-Peleg <adip@google.com> Signed-off-by: bjmask <11672696+bjmask@users.noreply.github.com>
Commit Message: tcp_proxy: fix OD-CDS over ADS Additional Description: This PR is similar to envoyproxy#41174 (and uses the same component to achieve the same goal). The fix allows proper use of tcp_proxy on-demand cluster discovery when used over ADS. Risk Level: low - only impacts OD-CDS over tcp_proxy Testing: Added integration tests. Docs Changes: N/A Release Notes: Added Platform Specific Features: N/A Runtime guard: Added `envoy.reloadable_features.tcp_proxy_odcds_over_ads_fix` to disable the behavior. --------- Signed-off-by: Adi Suissa-Peleg <adip@google.com>
Commit Message: tcp_proxy: fix OD-CDS over ADS Additional Description: This PR is similar to envoyproxy#41174 (and uses the same component to achieve the same goal). The fix allows proper use of tcp_proxy on-demand cluster discovery when used over ADS. Risk Level: low - only impacts OD-CDS over tcp_proxy Testing: Added integration tests. Docs Changes: N/A Release Notes: Added Platform Specific Features: N/A Runtime guard: Added `envoy.reloadable_features.tcp_proxy_odcds_over_ads_fix` to disable the behavior. --------- Signed-off-by: Adi Suissa-Peleg <adip@google.com>
Commit Message: odcds: convert ODCDS over ADS to pre-cluster-single-subscription
Additional Description:
Prior to this PR there were issues when using OD-CDS without cds_config.
This PR converts OD-CDS over ADS to use the new XdstpOdCdsApiImpl (that is also used for xDS-federation based OD-CDS subscriptions).
Risk Level: low - only impacts OD-CDS usage
Testing: Added many integration tests. Unit tests were already added for the original OD-CDS implementations.
Docs Changes: N/A
Release Notes: Added.
Platform Specific Features: N/A
Runtime guard: This change is guarded by
envoy.reloadable_features.odcds_over_ads_fixto ensure that there's an escape hatch if some unintentional change occurs.