From 928de738dd70e7074cdd563d2247305fe1fcad35 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Wed, 28 Feb 2018 08:43:19 -0800 Subject: Rename reverse zone constants (#1568) Rename the constants to IP4arpa and IP6arpa (shorter and exported) and make IsReverse return the type of the reverse zone which could be handy for some callers. Also add tests for IsReverse() --- plugin/kubernetes/setup.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugin/kubernetes/setup.go') diff --git a/plugin/kubernetes/setup.go b/plugin/kubernetes/setup.go index 23ed4443a..7d41fb64d 100644 --- a/plugin/kubernetes/setup.go +++ b/plugin/kubernetes/setup.go @@ -9,9 +9,10 @@ import ( "github.com/coredns/coredns/core/dnsserver" "github.com/coredns/coredns/plugin" + "github.com/coredns/coredns/plugin/pkg/dnsutil" "github.com/coredns/coredns/plugin/pkg/parse" - "github.com/coredns/coredns/plugin/pkg/upstream" + "github.com/mholt/caddy" "github.com/miekg/dns" meta "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -113,7 +114,7 @@ func ParseStanza(c *caddy.Controller) (*Kubernetes, error) { k8s.primaryZoneIndex = -1 for i, z := range k8s.Zones { - if strings.HasSuffix(z, "in-addr.arpa.") || strings.HasSuffix(z, "ip6.arpa.") { + if dnsutil.IsReverse(z) > 0 { continue } k8s.primaryZoneIndex = i -- cgit v1.2.3