This repository was archived by the owner on Jul 22, 2026. It is now read-only.
Add opt-in D2 client subscription to the IndisRegistryObserver Cluster - #1176
Merged
harrisonlhl123 merged 7 commits intoJun 26, 2026
Merged
Conversation
…structor Previously the flag was copied onto the config after construction in D2ClientBuilder, which was inconsistent with its sibling subscribeToUriGlobCollection (set via the constructor) and risked being silently dropped by any future construction path. Thread it through both D2ClientConfig constructors and the builder call, mirroring subscribeToUriGlobCollection exactly, and remove the copy-after-construction line. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tion Cover the config-plumbing half of the change: assert that the flag set via D2ClientBuilder.setSubscribeToIndisObserverCluster is carried through the D2ClientConfig constructor to the config handed to the load balancer factory during build() (and defaults to false otherwise). The factory then forwards it to XdsToD2PropertiesAdaptor, whose subscription behavior TestXdsToD2PropertiesAdaptor already covers. The tests call build() and assert the factory was invoked so the propagation assertion actually runs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
harrisonlhl123
marked this pull request as ready for review
June 24, 2026 21:26
singhsanjay12
approved these changes
Jun 26, 2026
harrisonlhl123
deleted the
hliang/indis-force-observer-cluster-subscription
branch
June 26, 2026 22:05
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change lets a D2 xDS client subscribe to
IndisRegistryObservercluster, so it receives and caches the live observer endpoint set the same way it learns about any other cluster.What changed
D2ClientConfig.subscribeToIndisObserverCluster(defaultfalse), plumbed throughD2ClientBuilderandXdsLoadBalancerWithFacilitiesFactoryintoXdsToD2PropertiesAdaptor.XdsToD2PropertiesAdaptor.start()additionally subscribes to the observer's cluster, service, and URI.When the flag is off (the default), behavior is unchanged.
Testing
Unit Tests
TestXdsToD2PropertiesAdaptor— assertsstart()subscribes to the observer cluster, service, and URI when the flag is enabled, and does not when it is off (the default).D2ClientBuilderTest— asserts the flag set on the builder propagates through theD2ClientConfigconstructor to the config handed to the load balancer factory, and defaults tofalse.Integration (manual, against a live observer)
Ran a real D2 xDS client (via
XdsToD2SampleClient, driven through the fullD2ClientBuilderpath with the flag enabled) against a running local observer. The client subscribed to both observer resources and received the observer's own endpoint over xDS: