mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 02:33:14 -04:00
Add k8s external service CNAMEs (#677)
* Add external service cnames * remove cruft * update CI k8s version * change CI k8s version * min k8s ver for ext services * trying k8s 1.5 * k8s 1.5 requires ports spec * remove kruft * update dns schema version
This commit is contained in:
committed by
Miek Gieben
parent
2f2c90f391
commit
d917ff5ac2
@@ -11,7 +11,7 @@ import (
|
||||
//
|
||||
// dns.TypeA: the service's Host field contains an A record.
|
||||
// dns.TypeAAAA: the service's Host field contains an AAAA record.
|
||||
// dns.TypeANY: the service's Host field contains a name.
|
||||
// dns.TypeCNAME: the service's Host field contains a name.
|
||||
//
|
||||
// Note that a service can double/triple as a TXT record or MX record.
|
||||
func (s *Service) HostType() (what uint16, normalized net.IP) {
|
||||
@@ -20,7 +20,7 @@ func (s *Service) HostType() (what uint16, normalized net.IP) {
|
||||
|
||||
switch {
|
||||
case ip == nil:
|
||||
return dns.TypeANY, nil
|
||||
return dns.TypeCNAME, nil
|
||||
|
||||
case ip.To4() != nil:
|
||||
return dns.TypeA, ip.To4()
|
||||
|
||||
@@ -11,11 +11,11 @@ func TestType(t *testing.T) {
|
||||
serv Service
|
||||
expectedType uint16
|
||||
}{
|
||||
{Service{Host: "example.org"}, dns.TypeANY},
|
||||
{Service{Host: "example.org"}, dns.TypeCNAME},
|
||||
{Service{Host: "127.0.0.1"}, dns.TypeA},
|
||||
{Service{Host: "2000::3"}, dns.TypeAAAA},
|
||||
{Service{Host: "2000..3"}, dns.TypeANY},
|
||||
{Service{Host: "127.0.0.257"}, dns.TypeANY},
|
||||
{Service{Host: "2000..3"}, dns.TypeCNAME},
|
||||
{Service{Host: "127.0.0.257"}, dns.TypeCNAME},
|
||||
{Service{Host: "127.0.0.252", Mail: true}, dns.TypeA},
|
||||
{Service{Host: "127.0.0.252", Mail: true, Text: "a"}, dns.TypeA},
|
||||
{Service{Host: "127.0.0.254", Mail: false, Text: "a"}, dns.TypeA},
|
||||
|
||||
Reference in New Issue
Block a user