Skip to content

Commit 13703a7

Browse files
authored
Merge pull request #149 from rajansandeep/fixdnsdomain
Fix to get the correct dns domain
2 parents 6b65ca5 + 5e80e99 commit 13703a7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

utils/utils.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ func GetDNSDomain() string {
6767
cname, err := net.LookupCNAME(svc)
6868
if err != nil {
6969
// If it cannot determine the domain, we default it to "cluster.local"
70-
klog.Infof("determined DNS Domain for cluster should be %q", dnsDomain)
70+
klog.Infof("could not determine the domain, the DNS Domain for the cluster will default to %q", dnsDomain)
7171
return dnsDomain
7272
}
7373

7474
domain := strings.TrimPrefix(cname, svc)
75+
domain = strings.TrimPrefix(domain, ".")
7576
domain = strings.TrimSuffix(domain, ".")
7677

7778
klog.Infof("determined DNS Domain for DNS should be %q", domain)

0 commit comments

Comments
 (0)