Skip to content

Commit c88085d

Browse files
committed
Don't test metadata server connectivity from GCE Windows pods.
Windows containers do not include a route to the GCE metadata server by default. This check is causing the "DNS should provide DNS for the cluster" test to fail for clusters with Windows nodes (https://testgrid.k8s.io/sig-windows#gce-windows-master&width=20). Tested that this works by running "DNS should provide DNS for the cluster" against an e2e cluster with Windows nodes brought up on GCE.
1 parent 596a48d commit c88085d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/e2e/network/dns.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ var _ = SIGDescribe("DNS", func() {
5151
// Added due to #8512. This is critical for GCE and GKE deployments.
5252
if framework.ProviderIs("gce", "gke") {
5353
namesToResolve = append(namesToResolve, "google.com")
54-
namesToResolve = append(namesToResolve, "metadata")
54+
// Windows containers do not have a route to the GCE
55+
// metadata server by default.
56+
if !framework.NodeOSDistroIs("windows") {
57+
namesToResolve = append(namesToResolve, "metadata")
58+
}
5559
}
5660
wheezyProbeCmd, wheezyFileNames := createProbeCommand(namesToResolve, nil, "", "wheezy", f.Namespace.Name, framework.TestContext.ClusterDNSDomain)
5761
jessieProbeCmd, jessieFileNames := createProbeCommand(namesToResolve, nil, "", "jessie", f.Namespace.Name, framework.TestContext.ClusterDNSDomain)
@@ -74,7 +78,11 @@ var _ = SIGDescribe("DNS", func() {
7478
// Added due to #8512. This is critical for GCE and GKE deployments.
7579
if framework.ProviderIs("gce", "gke") {
7680
namesToResolve = append(namesToResolve, "google.com")
77-
namesToResolve = append(namesToResolve, "metadata")
81+
// Windows containers do not have a route to the GCE
82+
// metadata server by default.
83+
if !framework.NodeOSDistroIs("windows") {
84+
namesToResolve = append(namesToResolve, "metadata")
85+
}
7886
}
7987
hostFQDN := fmt.Sprintf("%s.%s.%s.svc.cluster.local", dnsTestPodHostName, dnsTestServiceName, f.Namespace.Name)
8088
hostEntries := []string{hostFQDN, dnsTestPodHostName}

0 commit comments

Comments
 (0)