From 68949cd6730b3632726601e46fd4dd6af950b68e Mon Sep 17 00:00:00 2001 From: xiangpengzhao Date: Fri, 22 Sep 2017 13:09:02 +0800 Subject: [PATCH] Don't need to check useAnnotation in dns e2e test --- test/e2e/network/dns.go | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/test/e2e/network/dns.go b/test/e2e/network/dns.go index 63cb8f6288f8a..dfae233088e7e 100644 --- a/test/e2e/network/dns.go +++ b/test/e2e/network/dns.go @@ -26,7 +26,6 @@ import ( . "github.com/onsi/gomega" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/uuid" "k8s.io/apimachinery/pkg/util/wait" clientset "k8s.io/client-go/kubernetes" @@ -38,12 +37,7 @@ import ( const dnsTestPodHostName = "dns-querier-1" const dnsTestServiceName = "dns-test-service" -var dnsServiceLabelSelector = labels.Set{ - "k8s-app": "kube-dns", - "kubernetes.io/cluster-service": "true", -}.AsSelector() - -func createDNSPod(namespace, wheezyProbeCmd, jessieProbeCmd string, useAnnotation bool) *v1.Pod { +func createDNSPod(namespace, wheezyProbeCmd, jessieProbeCmd string) *v1.Pod { dnsPod := &v1.Pod{ TypeMeta: metav1.TypeMeta{ Kind: "Pod", @@ -312,7 +306,7 @@ var _ = SIGDescribe("DNS", func() { // Run a pod which probes DNS and exposes the results by HTTP. By("creating a pod to probe DNS") - pod := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, true) + pod := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd) validateDNSResults(f, pod, append(wheezyFileNames, jessieFileNames...)) }) @@ -358,13 +352,13 @@ var _ = SIGDescribe("DNS", func() { // Run a pod which probes DNS and exposes the results by HTTP. By("creating a pod to probe DNS") - pod := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, false) + pod := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd) pod.ObjectMeta.Labels = testServiceSelector validateDNSResults(f, pod, append(wheezyFileNames, jessieFileNames...)) }) - It("should provide DNS for pods for Hostname and Subdomain Annotation", func() { + It("should provide DNS for pods for Hostname and Subdomain", func() { // Create a test headless service. By("Creating a test headless service") testServiceSelector := map[string]string{ @@ -391,7 +385,7 @@ var _ = SIGDescribe("DNS", func() { // Run a pod which probes DNS and exposes the results by HTTP. By("creating a pod to probe DNS") - pod1 := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, true) + pod1 := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd) pod1.ObjectMeta.Labels = testServiceSelector pod1.Spec.Hostname = podHostname pod1.Spec.Subdomain = serviceName @@ -424,7 +418,7 @@ var _ = SIGDescribe("DNS", func() { // Run a pod which probes DNS and exposes the results by HTTP. By("creating a pod to probe DNS") - pod1 := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, true) + pod1 := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd) validateTargetedProbeOutput(f, pod1, []string{wheezyFileName, jessieFileName}, "foo.example.com.") @@ -441,7 +435,7 @@ var _ = SIGDescribe("DNS", func() { // Run a pod which probes DNS and exposes the results by HTTP. By("creating a second pod to probe DNS") - pod2 := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, true) + pod2 := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd) validateTargetedProbeOutput(f, pod2, []string{wheezyFileName, jessieFileName}, "bar.example.com.") @@ -461,7 +455,7 @@ var _ = SIGDescribe("DNS", func() { // Run a pod which probes DNS and exposes the results by HTTP. By("creating a third pod to probe DNS") - pod3 := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, true) + pod3 := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd) svc, err := f.ClientSet.Core().Services(f.Namespace.Name).Get(externalNameService.Name, metav1.GetOptions{}) Expect(err).NotTo(HaveOccurred())