Skip to content

Commit

Permalink
Merge pull request kubernetes#52885 from xiangpengzhao/dns-remove-use…
Browse files Browse the repository at this point in the history
…less

Automatic merge from submit-queue (batch tested with PRs 52880, 52855, 52761, 52885, 52929). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

Don't need to check useAnnotation in dns e2e test

**What this PR does / why we need it**:
hostname/subdomain annotations were removed in kubernetes#44137. This PR removes the check.
Also, `var dnsServiceLabelSelector` is not used anymore.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
ref: kubernetes#44137

**Special notes for your reviewer**:
/cc @bowei @MrHohn 

**Release note**:

```release-note
NONE
```
  • Loading branch information
Kubernetes Submit Queue authored Sep 24, 2017
2 parents 63c1ed1 + 68949cd commit 70af5ef
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions test/e2e/network/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
Expand Down Expand Up @@ -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...))
})

Expand Down Expand Up @@ -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{
Expand All @@ -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
Expand Down Expand Up @@ -420,7 +414,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.")

Expand All @@ -437,7 +431,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.")

Expand All @@ -457,7 +451,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())
Expand Down

0 comments on commit 70af5ef

Please sign in to comment.