Skip to content

Commit cf0ddfb

Browse files
committed
Fix to get the correct dns domain
1 parent a905f3c commit cf0ddfb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utils/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +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.TrimSuffix(domain, ".")
75+
domain = strings.TrimPrefix(domain, ".")
7676

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

0 commit comments

Comments
 (0)