* Add dnsutil.Join

* Create dnsutil.Join

Create Join helper function and move bits in the code over.
This commit is contained in:
Miek Gieben
2017-08-19 15:22:09 +01:00
committed by GitHub
parent 7c343982a6
commit 02955d7594
8 changed files with 52 additions and 14 deletions

View File

@@ -14,8 +14,6 @@ Federation is only useful in conjunction with the kubernetes middleware, without
package federation
import (
"strings"
"github.com/coredns/coredns/middleware"
"github.com/coredns/coredns/middleware/etcd/msg"
"github.com/coredns/coredns/middleware/pkg/dnsutil"
@@ -133,7 +131,7 @@ func (f *Federation) isNameFederation(name, zone string) (string, string) {
fed := labels[ll-2]
if _, ok := f.f[fed]; ok {
without := strings.Join(labels[:ll-2], ".") + "." + labels[ll-1] + "." + zone
without := dnsutil.Join(labels[:ll-2]) + labels[ll-1] + "." + zone
return without, fed
}
return "", ""