-
Notifications
You must be signed in to change notification settings - Fork 1
Discovery Client - Support "ClusterId" environment variable without prefix #247
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
Conversation
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.
Pull request overview
This PR enhances the Discovery Client to support both the prefixed (NIDISCOVERY_CLUSTERID) and prefix-less (CLUSTERID) environment variable names for specifying the Cluster ID, aligning with the Discovery Service's own behavior. This change improves robustness and compatibility when interacting with the Discovery Service.
Key changes:
- Introduced constants for the environment variable prefix and cluster ID name
- Added fallback logic to check both prefixed and non-prefixed environment variable names
- Includes inline comment noting future consideration for case-insensitive environment variable lookups
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What does this Pull Request accomplish?
This set of changes adds support for the
ClusterIdenvironment variable (without theNIDiscovery_prefix), given that the Discovery Service recognizes an environment variable of that prefix-less name as well.This change is being made in response to this comment on PR #242.
Why should this Pull Request be merged?
This PR adds greater robustness in properly handling an environment variable being set to specify the Cluster ID of the Discovery Service.
What testing has been done?
DiscoveryClientwas able to successfully interact with the Discovery Service that was launched with theClusterIdenvironment variable setDiscoveryClientwas still able to successfully interact with a Discovery Service that was launched with theNIDiscovery_ClusterIDenvironment variable