[CSM] Remove requirement that servers have to be xDS enabled (#36410)

Closes #36410

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36410 from yashykt:CsmEnableForAllServers cfe8d7db0b
PiperOrigin-RevId: 626501498
pull/36415/head
Yash Tibrewal 7 months ago committed by Copybara-Service
parent 08f56b3a74
commit 91f0eadd22
  1. 5
      src/cpp/ext/csm/csm_observability.cc
  2. 10
      test/cpp/ext/csm/csm_observability_test.cc

@ -48,9 +48,8 @@ namespace {
std::atomic<bool> g_csm_plugin_enabled(false);
}
bool CsmServerSelector(const grpc_core::ChannelArgs& args) {
return g_csm_plugin_enabled &&
args.GetBool(GRPC_ARG_XDS_ENABLED_SERVER).value_or(false);
bool CsmServerSelector(const grpc_core::ChannelArgs& /*args*/) {
return g_csm_plugin_enabled;
}
bool CsmChannelTargetSelector(absl::string_view target) {

@ -77,15 +77,9 @@ TEST(CsmChannelTargetSelectorTest, CsmObservabilityOutOfScope) {
"xds://traffic-director-global.xds.googleapis.com/foo"));
}
TEST(CsmServerSelectorTest, ChannelArgsWithoutXdsServerArg) {
TEST(CsmServerSelectorTest, ChannelArgs) {
auto obs = CsmObservabilityBuilder().BuildAndRegister();
EXPECT_FALSE(internal::CsmServerSelector(grpc_core::ChannelArgs()));
}
TEST(CsmServerSelectorTest, ChannelArgsWithXdsServerArg) {
auto obs = CsmObservabilityBuilder().BuildAndRegister();
EXPECT_TRUE(internal::CsmServerSelector(
grpc_core::ChannelArgs().Set(GRPC_ARG_XDS_ENABLED_SERVER, true)));
EXPECT_TRUE(internal::CsmServerSelector(grpc_core::ChannelArgs()));
}
TEST(CsmServerSelectorTest, CsmObservabilityOutOfScope) {

Loading…
Cancel
Save