mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
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()
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user