aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/setup.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2018-02-28 08:43:19 -0800
committerGravatar GitHub <noreply@github.com> 2018-02-28 08:43:19 -0800
commit928de738dd70e7074cdd563d2247305fe1fcad35 (patch)
tree4a6789f3312e6355b34fa81881b0e6187aab3459 /plugin/kubernetes/setup.go
parent395b614349ad730af8edbae204a4744128e0b0f3 (diff)
downloadcoredns-928de738dd70e7074cdd563d2247305fe1fcad35.tar.gz
coredns-928de738dd70e7074cdd563d2247305fe1fcad35.tar.zst
coredns-928de738dd70e7074cdd563d2247305fe1fcad35.zip
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()
Diffstat (limited to 'plugin/kubernetes/setup.go')
-rw-r--r--plugin/kubernetes/setup.go5
1 files changed, 3 insertions, 2 deletions
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