mirror of https://github.com/knative/pkg.git
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
This commit is contained in:
parent
ac2f8d10ec
commit
ed32ad4d27
|
|
@ -49,11 +49,6 @@ options ndots:5
|
|||
resolvConf: ``,
|
||||
env: "abc.com",
|
||||
want: "abc.com",
|
||||
}, {
|
||||
name: "env variable with custom domain",
|
||||
resolvConf: ``,
|
||||
env: "custom.local",
|
||||
want: "custom.local",
|
||||
}, {
|
||||
name: "all good with trailing dot",
|
||||
resolvConf: `
|
||||
|
|
|
|||
Loading…
Reference in New Issue