Fix: Use CLUSTER_DOMAIN environment variable instead of hardcoded cluster.local #479
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 PR replaces hardcoded
cluster.local
DNS suffix with a configurableCLUSTER_DOMAIN
environment variable across the search controller components. This change improves flexibility for deployments in Kubernetes clusters that use custom cluster domains.Changes:
CommunitySearchSource.HostSeeds()
to use configurable cluster domainEnterpriseResourceSearchSource.HostSeeds()
to use configurable cluster domainmongotHostAndPort()
function to use configurable cluster domainenv.ReadOrDefault("CLUSTER_DOMAIN", "cluster.local")
calls to maintain backward compatibilityProof of Work
cluster.local
references in search controller replaced with environment variablecluster.local
pkg/util/env.ReadOrDefault()
Files modified:
controllers/searchcontroller/community_search_source.go:30
controllers/searchcontroller/enterprise_search_source.go:28
controllers/searchcontroller/mongodbsearch_reconcile_helper.go:409
Checklist
skip-changelog
label if not neededThe PR is ready! The commit already includes the changelog file as required by the contributing guidelines.