diff --git a/test/extended/dns/dns.go b/test/extended/dns/dns.go index b4379076f3b7..b80a8f6aadbc 100644 --- a/test/extended/dns/dns.go +++ b/test/extended/dns/dns.go @@ -204,7 +204,7 @@ func createEndpointSpec(name string) *api.Endpoints { Subsets: []api.EndpointSubset{ { Addresses: []api.EndpointAddress{ - {IP: "1.1.1.1"}, + {IP: "1.1.1.1", Hostname: "endpoint1"}, {IP: "1.1.1.2"}, }, NotReadyAddresses: []api.EndpointAddress{ @@ -272,12 +272,14 @@ var _ = Describe("DNS", func() { // the DNS pod should be able to look up endpoints for names and wildcards digForARecords(map[string][]string{ - "kubernetes.default.endpoints": kubeEndpoints, - "prefix.kubernetes.default.endpoints.cluster.local": kubeEndpoints, + "kubernetes.default.endpoints": kubeEndpoints, fmt.Sprintf("headless.%s.svc", f.Namespace.Name): readyEndpoints, fmt.Sprintf("headless.%s.endpoints", f.Namespace.Name): readyEndpoints, fmt.Sprintf("clusterip.%s.endpoints", f.Namespace.Name): readyEndpoints, + + fmt.Sprintf("endpoint1.headless.%s.endpoints", f.Namespace.Name): {"1.1.1.1"}, + fmt.Sprintf("endpoint1.clusterip.%s.endpoints", f.Namespace.Name): {"1.1.1.1"}, }, expect), // the DNS pod should respond to its own request diff --git a/test/integration/dns_test.go b/test/integration/dns_test.go index 02ae5554c77e..c9b74f1eb53e 100644 --- a/test/integration/dns_test.go +++ b/test/integration/dns_test.go @@ -118,7 +118,7 @@ func TestDNS(t *testing.T) { Subsets: []kapi.EndpointSubset{{ Addresses: []kapi.EndpointAddress{{IP: "172.0.0.1"}}, Ports: []kapi.EndpointPort{ - {Port: 2345}, + {Port: 2345, Name: "http"}, }, }}, }); err != nil { @@ -187,7 +187,7 @@ func TestDNS(t *testing.T) { expect: []*net.IP{&headlessIP}, }, { // specific port of a headless service - dnsQuestionName: "unknown-port-2345.e1.headless.default.svc.cluster.local.", + dnsQuestionName: "_http._tcp.headless.default.svc.cluster.local.", expect: []*net.IP{&headlessIP}, }, { // SRV record for that service @@ -209,7 +209,7 @@ func TestDNS(t *testing.T) { }, }, { // the SRV record resolves to the IP - dnsQuestionName: "unknown-port-2345.e1.headless.default.svc.cluster.local.", + dnsQuestionName: "_http._tcp.headless.default.svc.cluster.local.", expect: []*net.IP{&headlessIP}, }, { // headless 2 service