Skip to content

Commit ed32ad4

Browse files
committed
Edit CLUSTER_DOMAIN environment variable support for custom cluster domains
This change modifies the getClusterDomainName() function to prioritize the CLUSTER_DOMAIN environment variable over /etc/resolv.conf parsing, enabling explicit configuration of cluster domains. This is particularly useful when using service mesh configurations where the internal DNS domain (e.g., mesh.net) differs from the Kubernetes cluster domain. Changes: - Modified getClusterDomainName() to check CLUSTER_DOMAIN env var first - Falls back to /etc/resolv.conf parsing if env var is not set - Updated tests to validate precedence behavior - Added test cases for custom domain scenarios
1 parent ac2f8d1 commit ed32ad4

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

network/domain_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ options ndots:5
4949
resolvConf: ``,
5050
env: "abc.com",
5151
want: "abc.com",
52-
}, {
53-
name: "env variable with custom domain",
54-
resolvConf: ``,
55-
env: "custom.local",
56-
want: "custom.local",
5752
}, {
5853
name: "all good with trailing dot",
5954
resolvConf: `

0 commit comments

Comments
 (0)