From 094a11b5cb63b4007518a3a91c79a74f0ff1f590 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 16 Sep 2024 13:20:28 -0700 Subject: [PATCH] Revert "Clean up DNS e2e wrt Jessie/Wheezy" This reverts commit eeb36da2b97e87b3534c7bece9355cefc6f16472. --- test/e2e/network/dns.go | 130 +++++++++++------- test/e2e/network/dns_common.go | 14 +- test/e2e/storage/testsuites/multivolume.go | 4 +- test/images/.permitted-images | 1 + test/images/image-util.sh | 2 +- test/images/jessie-dnsutils/BASEIMAGE | 7 + test/images/jessie-dnsutils/Dockerfile | 32 +++++ .../images/jessie-dnsutils/Dockerfile_windows | 28 ++++ test/images/jessie-dnsutils/OWNERS | 3 + test/images/jessie-dnsutils/README.md | 4 + test/images/jessie-dnsutils/VERSION | 1 + test/images/jessie-dnsutils/fixup-apt-list.sh | 32 +++++ test/utils/image/manifest.go | 3 + 13 files changed, 203 insertions(+), 58 deletions(-) create mode 100644 test/images/jessie-dnsutils/BASEIMAGE create mode 100644 test/images/jessie-dnsutils/Dockerfile create mode 100644 test/images/jessie-dnsutils/Dockerfile_windows create mode 100644 test/images/jessie-dnsutils/OWNERS create mode 100644 test/images/jessie-dnsutils/README.md create mode 100644 test/images/jessie-dnsutils/VERSION create mode 100755 test/images/jessie-dnsutils/fixup-apt-list.sh diff --git a/test/e2e/network/dns.go b/test/e2e/network/dns.go index 3853daae2fe..54ce81f4133 100644 --- a/test/e2e/network/dns.go +++ b/test/e2e/network/dns.go @@ -58,13 +58,15 @@ var _ = common.SIGDescribe("DNS", func() { fmt.Sprintf("kubernetes.default.svc.%s", framework.TestContext.ClusterDNSDomain), } // TODO: Validate both IPv4 and IPv6 families for dual-stack - probeCmd, fileNames := createProbeCommand(namesToResolve, nil, "", "dns", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) - ginkgo.By("Running these commands: " + probeCmd + "\n") + wheezyProbeCmd, wheezyFileNames := createProbeCommand(namesToResolve, nil, "", "wheezy", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + jessieProbeCmd, jessieFileNames := createProbeCommand(namesToResolve, nil, "", "jessie", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + ginkgo.By("Running these commands on wheezy: " + wheezyProbeCmd + "\n") + ginkgo.By("Running these commands on jessie: " + jessieProbeCmd + "\n") // Run a pod which probes DNS and exposes the results by HTTP. ginkgo.By("creating a pod to probe DNS") - pod := createDNSPod(f.Namespace.Name, probeCmd, dnsTestPodHostName, dnsTestServiceName) - validateDNSResults(ctx, f, pod, fileNames) + pod := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, dnsTestPodHostName, dnsTestServiceName) + validateDNSResults(ctx, f, pod, append(wheezyFileNames, jessieFileNames...)) }) // Added due to #8512. This is critical for GCE and GKE deployments. @@ -78,13 +80,15 @@ var _ = common.SIGDescribe("DNS", func() { } // TODO: Validate both IPv4 and IPv6 families for dual-stack - probeCmd, fileNames := createProbeCommand(namesToResolve, nil, "", "dns", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) - ginkgo.By("Running these commands: " + probeCmd + "\n") + wheezyProbeCmd, wheezyFileNames := createProbeCommand(namesToResolve, nil, "", "wheezy", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + jessieProbeCmd, jessieFileNames := createProbeCommand(namesToResolve, nil, "", "jessie", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + ginkgo.By("Running these commands on wheezy: " + wheezyProbeCmd + "\n") + ginkgo.By("Running these commands on jessie: " + jessieProbeCmd + "\n") // Run a pod which probes DNS and exposes the results by HTTP. ginkgo.By("creating a pod to probe DNS") - pod := createDNSPod(f.Namespace.Name, probeCmd, dnsTestPodHostName, dnsTestServiceName) - validateDNSResults(ctx, f, pod, fileNames) + pod := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, dnsTestPodHostName, dnsTestServiceName) + validateDNSResults(ctx, f, pod, append(wheezyFileNames, jessieFileNames...)) }) // [LinuxOnly]: As Windows currently does not support resolving PQDNs. @@ -97,13 +101,15 @@ var _ = common.SIGDescribe("DNS", func() { hostFQDN := fmt.Sprintf("%s.%s.%s.svc.%s", dnsTestPodHostName, dnsTestServiceName, f.Namespace.Name, framework.TestContext.ClusterDNSDomain) hostEntries := []string{hostFQDN, dnsTestPodHostName} // TODO: Validate both IPv4 and IPv6 families for dual-stack - probeCmd, fileNames := createProbeCommand(namesToResolve, hostEntries, "", "dns", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) - ginkgo.By("Running these commands: " + probeCmd + "\n") + wheezyProbeCmd, wheezyFileNames := createProbeCommand(namesToResolve, hostEntries, "", "wheezy", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + jessieProbeCmd, jessieFileNames := createProbeCommand(namesToResolve, hostEntries, "", "jessie", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + ginkgo.By("Running these commands on wheezy: " + wheezyProbeCmd + "\n") + ginkgo.By("Running these commands on jessie: " + jessieProbeCmd + "\n") // Run a pod which probes DNS and exposes the results by HTTP. ginkgo.By("creating a pod to probe DNS") - pod := createDNSPod(f.Namespace.Name, probeCmd, dnsTestPodHostName, dnsTestServiceName) - validateDNSResults(ctx, f, pod, fileNames) + pod := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, dnsTestPodHostName, dnsTestServiceName) + validateDNSResults(ctx, f, pod, append(wheezyFileNames, jessieFileNames...)) }) /* @@ -115,13 +121,15 @@ var _ = common.SIGDescribe("DNS", func() { hostFQDN := fmt.Sprintf("%s.%s.%s.svc.%s", dnsTestPodHostName, dnsTestServiceName, f.Namespace.Name, framework.TestContext.ClusterDNSDomain) hostEntries := []string{hostFQDN, dnsTestPodHostName} // TODO: Validate both IPv4 and IPv6 families for dual-stack - probeCmd, fileNames := createProbeCommand(nil, hostEntries, "", "dns", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) - ginkgo.By("Running these commands: " + probeCmd + "\n") + wheezyProbeCmd, wheezyFileNames := createProbeCommand(nil, hostEntries, "", "wheezy", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + jessieProbeCmd, jessieFileNames := createProbeCommand(nil, hostEntries, "", "jessie", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + ginkgo.By("Running these commands on wheezy: " + wheezyProbeCmd + "\n") + ginkgo.By("Running these commands on jessie: " + jessieProbeCmd + "\n") // Run a pod which probes /etc/hosts and exposes the results by HTTP. ginkgo.By("creating a pod to probe /etc/hosts") - pod := createDNSPod(f.Namespace.Name, probeCmd, dnsTestPodHostName, dnsTestServiceName) - validateDNSResults(ctx, f, pod, fileNames) + pod := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, dnsTestPodHostName, dnsTestServiceName) + validateDNSResults(ctx, f, pod, append(wheezyFileNames, jessieFileNames...)) }) /* @@ -164,15 +172,17 @@ var _ = common.SIGDescribe("DNS", func() { } // TODO: Validate both IPv4 and IPv6 families for dual-stack - probeCmd, fileNames := createProbeCommand(namesToResolve, nil, regularService.Spec.ClusterIP, "dns", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) - ginkgo.By("Running these commands: " + probeCmd + "\n") + wheezyProbeCmd, wheezyFileNames := createProbeCommand(namesToResolve, nil, regularService.Spec.ClusterIP, "wheezy", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + jessieProbeCmd, jessieFileNames := createProbeCommand(namesToResolve, nil, regularService.Spec.ClusterIP, "jessie", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + ginkgo.By("Running these commands on wheezy: " + wheezyProbeCmd + "\n") + ginkgo.By("Running these commands on jessie: " + jessieProbeCmd + "\n") // Run a pod which probes DNS and exposes the results by HTTP. ginkgo.By("creating a pod to probe DNS") - pod := createDNSPod(f.Namespace.Name, probeCmd, dnsTestPodHostName, dnsTestServiceName) + pod := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, dnsTestPodHostName, dnsTestServiceName) pod.ObjectMeta.Labels = testServiceSelector - validateDNSResults(ctx, f, pod, fileNames) + validateDNSResults(ctx, f, pod, append(wheezyFileNames, jessieFileNames...)) }) /* @@ -215,15 +225,17 @@ var _ = common.SIGDescribe("DNS", func() { } // TODO: Validate both IPv4 and IPv6 families for dual-stack - probeCmd, fileNames := createProbeCommand(namesToResolve, nil, regularService.Spec.ClusterIP, "dns", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) - ginkgo.By("Running these commands: " + probeCmd + "\n") + wheezyProbeCmd, wheezyFileNames := createProbeCommand(namesToResolve, nil, regularService.Spec.ClusterIP, "wheezy", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + jessieProbeCmd, jessieFileNames := createProbeCommand(namesToResolve, nil, regularService.Spec.ClusterIP, "jessie", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + ginkgo.By("Running these commands on wheezy: " + wheezyProbeCmd + "\n") + ginkgo.By("Running these commands on jessie: " + jessieProbeCmd + "\n") // Run a pod which probes DNS and exposes the results by HTTP. ginkgo.By("creating a pod to probe DNS") - pod := createDNSPod(f.Namespace.Name, probeCmd, dnsTestPodHostName, dnsTestServiceName) + pod := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, dnsTestPodHostName, dnsTestServiceName) pod.ObjectMeta.Labels = testServiceSelector - validateDNSResults(ctx, f, pod, fileNames) + validateDNSResults(ctx, f, pod, append(wheezyFileNames, jessieFileNames...)) }) /* @@ -253,17 +265,19 @@ var _ = common.SIGDescribe("DNS", func() { hostFQDN := fmt.Sprintf("%s.%s.%s.svc.%s", podHostname, serviceName, f.Namespace.Name, framework.TestContext.ClusterDNSDomain) hostNames := []string{hostFQDN, podHostname} // TODO: Validate both IPv4 and IPv6 families for dual-stack - probeCmd, fileNames := createProbeCommand(nil, hostNames, "", "dns", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) - ginkgo.By("Running these commands: " + probeCmd + "\n") + wheezyProbeCmd, wheezyFileNames := createProbeCommand(nil, hostNames, "", "wheezy", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + jessieProbeCmd, jessieFileNames := createProbeCommand(nil, hostNames, "", "jessie", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + ginkgo.By("Running these commands on wheezy: " + wheezyProbeCmd + "\n") + ginkgo.By("Running these commands on jessie: " + jessieProbeCmd + "\n") // Run a pod which probes DNS and exposes the results by HTTP. ginkgo.By("creating a pod to probe DNS") - pod1 := createDNSPod(f.Namespace.Name, probeCmd, dnsTestPodHostName, dnsTestServiceName) + pod1 := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, dnsTestPodHostName, dnsTestServiceName) pod1.ObjectMeta.Labels = testServiceSelector pod1.Spec.Hostname = podHostname pod1.Spec.Subdomain = serviceName - validateDNSResults(ctx, f, pod1, fileNames) + validateDNSResults(ctx, f, pod1, append(wheezyFileNames, jessieFileNames...)) }) /* @@ -294,17 +308,19 @@ var _ = common.SIGDescribe("DNS", func() { subdomain := fmt.Sprintf("%s.%s.svc.%s", serviceName, f.Namespace.Name, framework.TestContext.ClusterDNSDomain) namesToResolve := []string{hostFQDN, subdomain} // TODO: Validate both IPv4 and IPv6 families for dual-stack - probeCmd, fileNames := createProbeCommand(namesToResolve, nil, "", "dns", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) - ginkgo.By("Running these commands: " + probeCmd + "\n") + wheezyProbeCmd, wheezyFileNames := createProbeCommand(namesToResolve, nil, "", "wheezy", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + jessieProbeCmd, jessieFileNames := createProbeCommand(namesToResolve, nil, "", "jessie", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + ginkgo.By("Running these commands on wheezy: " + wheezyProbeCmd + "\n") + ginkgo.By("Running these commands on jessie: " + jessieProbeCmd + "\n") // Run a pod which probes DNS and exposes the results by HTTP. ginkgo.By("creating a pod to probe DNS") - pod1 := createDNSPod(f.Namespace.Name, probeCmd, dnsTestPodHostName, dnsTestServiceName) + pod1 := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, dnsTestPodHostName, dnsTestServiceName) pod1.ObjectMeta.Labels = testServiceSelector pod1.Spec.Hostname = podHostname pod1.Spec.Subdomain = serviceName - validateDNSResults(ctx, f, pod1, fileNames) + validateDNSResults(ctx, f, pod1, append(wheezyFileNames, jessieFileNames...)) }) /* @@ -327,14 +343,16 @@ var _ = common.SIGDescribe("DNS", func() { return f.ClientSet.CoreV1().Services(f.Namespace.Name).Delete(ctx, externalNameService.Name, metav1.DeleteOptions{}) }) hostFQDN := fmt.Sprintf("%s.%s.svc.%s", serviceName, f.Namespace.Name, framework.TestContext.ClusterDNSDomain) - probeCmd, fileName := createTargetedProbeCommand(hostFQDN, "CNAME", "dns") - ginkgo.By("Running these commands: " + probeCmd + "\n") + wheezyProbeCmd, wheezyFileName := createTargetedProbeCommand(hostFQDN, "CNAME", "wheezy") + jessieProbeCmd, jessieFileName := createTargetedProbeCommand(hostFQDN, "CNAME", "jessie") + ginkgo.By("Running these commands on wheezy: " + wheezyProbeCmd + "\n") + ginkgo.By("Running these commands on jessie: " + jessieProbeCmd + "\n") // Run a pod which probes DNS and exposes the results by HTTP. ginkgo.By("creating a pod to probe DNS") - pod1 := createDNSPod(f.Namespace.Name, probeCmd, dnsTestPodHostName, dnsTestServiceName) + pod1 := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, dnsTestPodHostName, dnsTestServiceName) - validateTargetedProbeOutput(ctx, f, pod1, []string{fileName}, "foo.example.com.") + validateTargetedProbeOutput(ctx, f, pod1, []string{wheezyFileName, jessieFileName}, "foo.example.com.") // Test changing the externalName field ginkgo.By("changing the externalName to bar.example.com") @@ -342,14 +360,16 @@ var _ = common.SIGDescribe("DNS", func() { s.Spec.ExternalName = "bar.example.com" }) framework.ExpectNoError(err, "failed to change externalName of service: %s", serviceName) - probeCmd, fileName = createTargetedProbeCommand(hostFQDN, "CNAME", "dns") - ginkgo.By("Running these commands: " + probeCmd + "\n") + wheezyProbeCmd, wheezyFileName = createTargetedProbeCommand(hostFQDN, "CNAME", "wheezy") + jessieProbeCmd, jessieFileName = createTargetedProbeCommand(hostFQDN, "CNAME", "jessie") + ginkgo.By("Running these commands on wheezy: " + wheezyProbeCmd + "\n") + ginkgo.By("Running these commands on jessie: " + jessieProbeCmd + "\n") // Run a pod which probes DNS and exposes the results by HTTP. ginkgo.By("creating a second pod to probe DNS") - pod2 := createDNSPod(f.Namespace.Name, probeCmd, dnsTestPodHostName, dnsTestServiceName) + pod2 := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, dnsTestPodHostName, dnsTestServiceName) - validateTargetedProbeOutput(ctx, f, pod2, []string{fileName}, "bar.example.com.") + validateTargetedProbeOutput(ctx, f, pod2, []string{wheezyFileName, jessieFileName}, "bar.example.com.") // Test changing type from ExternalName to ClusterIP ginkgo.By("changing the service to type=ClusterIP") @@ -366,17 +386,19 @@ var _ = common.SIGDescribe("DNS", func() { } // TODO: For dual stack we can run from here two createTargetedProbeCommand() // one looking for an A record and another one for an AAAA record - probeCmd, fileName = createTargetedProbeCommand(hostFQDN, targetRecord, "dns") - ginkgo.By("Running these commands: " + probeCmd + "\n") + wheezyProbeCmd, wheezyFileName = createTargetedProbeCommand(hostFQDN, targetRecord, "wheezy") + jessieProbeCmd, jessieFileName = createTargetedProbeCommand(hostFQDN, targetRecord, "jessie") + ginkgo.By("Running these commands on wheezy: " + wheezyProbeCmd + "\n") + ginkgo.By("Running these commands on jessie: " + jessieProbeCmd + "\n") // Run a pod which probes DNS and exposes the results by HTTP. ginkgo.By("creating a third pod to probe DNS") - pod3 := createDNSPod(f.Namespace.Name, probeCmd, dnsTestPodHostName, dnsTestServiceName) + pod3 := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, dnsTestPodHostName, dnsTestServiceName) svc, err := f.ClientSet.CoreV1().Services(f.Namespace.Name).Get(ctx, externalNameService.Name, metav1.GetOptions{}) framework.ExpectNoError(err, "failed to get service: %s", externalNameService.Name) - validateTargetedProbeOutput(ctx, f, pod3, []string{fileName}, svc.Spec.ClusterIP) + validateTargetedProbeOutput(ctx, f, pod3, []string{wheezyFileName, jessieFileName}, svc.Spec.ClusterIP) }) /* @@ -548,8 +570,10 @@ var _ = common.SIGDescribe("DNS", func() { hostFQDN := fmt.Sprintf("%s.%s.%s.svc.%s", dnsTestPodHostName, dnsTestServiceName, f.Namespace.Name, framework.TestContext.ClusterDNSDomain) hostEntries := []string{hostFQDN, dnsTestPodHostName} // TODO: Validate both IPv4 and IPv6 families for dual-stack - probeCmd, fileNames := createProbeCommand(namesToResolve, hostEntries, "", "dns", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) - ginkgo.By("Running these commands: " + probeCmd + "\n") + wheezyProbeCmd, wheezyFileNames := createProbeCommand(namesToResolve, hostEntries, "", "wheezy", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + jessieProbeCmd, jessieFileNames := createProbeCommand(namesToResolve, hostEntries, "", "jessie", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + ginkgo.By("Running these commands on wheezy: " + wheezyProbeCmd + "\n") + ginkgo.By("Running these commands on jessie: " + jessieProbeCmd + "\n") ginkgo.By("Creating a pod with expanded DNS configuration to probe DNS") testNdotsValue := "5" @@ -561,7 +585,7 @@ var _ = common.SIGDescribe("DNS", func() { fmt.Sprintf("%038d.k8s.io", 5), fmt.Sprintf("%038d.k8s.io", 6), // 260 characters } - pod := createDNSPod(f.Namespace.Name, probeCmd, dnsTestPodHostName, dnsTestServiceName) + pod := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, dnsTestPodHostName, dnsTestServiceName) pod.Spec.DNSPolicy = v1.DNSClusterFirst pod.Spec.DNSConfig = &v1.PodDNSConfig{ Searches: testSearchPaths, @@ -572,7 +596,7 @@ var _ = common.SIGDescribe("DNS", func() { }, }, } - validateDNSResults(ctx, f, pod, fileNames) + validateDNSResults(ctx, f, pod, append(wheezyFileNames, jessieFileNames...)) }) }) @@ -639,16 +663,18 @@ var _ = common.SIGDescribe("DNS HostNetwork", func() { } // TODO: Validate both IPv4 and IPv6 families for dual-stack - probeCmd, fileNames := createProbeCommand(namesToResolve, nil, regularService.Spec.ClusterIP, "dns", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) - ginkgo.By("Running these commands: " + probeCmd + "\n") + wheezyProbeCmd, wheezyFileNames := createProbeCommand(namesToResolve, nil, regularService.Spec.ClusterIP, "wheezy", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + jessieProbeCmd, jessieFileNames := createProbeCommand(namesToResolve, nil, regularService.Spec.ClusterIP, "jessie", f.Namespace.Name, framework.TestContext.ClusterDNSDomain, framework.TestContext.ClusterIsIPv6()) + ginkgo.By("Running these commands on wheezy: " + wheezyProbeCmd + "\n") + ginkgo.By("Running these commands on jessie: " + jessieProbeCmd + "\n") // Run a pod which probes DNS and exposes the results by HTTP. ginkgo.By("creating a pod to probe DNS") - pod := createDNSPod(f.Namespace.Name, probeCmd, dnsTestPodHostName, dnsTestServiceName) + pod := createDNSPod(f.Namespace.Name, wheezyProbeCmd, jessieProbeCmd, dnsTestPodHostName, dnsTestServiceName) pod.ObjectMeta.Labels = testServiceSelector pod.Spec.HostNetwork = true pod.Spec.DNSPolicy = v1.DNSClusterFirstWithHostNet - validateDNSResults(ctx, f, pod, fileNames) + validateDNSResults(ctx, f, pod, append(wheezyFileNames, jessieFileNames...)) }) // https://issues.k8s.io/67019 diff --git a/test/e2e/network/dns_common.go b/test/e2e/network/dns_common.go index 6e0f3830045..9d64c5aae39 100644 --- a/test/e2e/network/dns_common.go +++ b/test/e2e/network/dns_common.go @@ -35,6 +35,7 @@ import ( clientset "k8s.io/client-go/kubernetes" "k8s.io/kubernetes/test/e2e/framework" e2epod "k8s.io/kubernetes/test/e2e/framework/pod" + imageutils "k8s.io/kubernetes/test/utils/image" dnsclient "k8s.io/kubernetes/third_party/forked/golang/net" admissionapi "k8s.io/pod-security-admission/api" @@ -351,7 +352,7 @@ func (t *dnsTestCommon) deleteDNSServerPod(ctx context.Context) { } } -func createDNSPod(namespace, probeCmd, podHostName, serviceName string) *v1.Pod { +func createDNSPod(namespace, wheezyProbeCmd, jessieProbeCmd, podHostName, serviceName string) *v1.Pod { podName := "dns-test-" + string(uuid.NewUUID()) volumes := []v1.Volume{ { @@ -372,10 +373,17 @@ func createDNSPod(namespace, probeCmd, podHostName, serviceName string) *v1.Pod dnsPod := e2epod.NewAgnhostPod(namespace, podName, volumes, mounts, nil, "test-webserver") dnsPod.Spec.Containers[0].Name = "webserver" - querier := e2epod.NewAgnhostContainer("querier", mounts, nil, probeCmd) + querier := e2epod.NewAgnhostContainer("querier", mounts, nil, wheezyProbeCmd) querier.Command = []string{"sh", "-c"} - dnsPod.Spec.Containers = append(dnsPod.Spec.Containers, querier) + jessieQuerier := v1.Container{ + Name: "jessie-querier", + Image: imageutils.GetE2EImage(imageutils.JessieDnsutils), + Command: []string{"sh", "-c", jessieProbeCmd}, + VolumeMounts: mounts, + } + + dnsPod.Spec.Containers = append(dnsPod.Spec.Containers, querier, jessieQuerier) dnsPod.Spec.Hostname = podHostName dnsPod.Spec.Subdomain = serviceName diff --git a/test/e2e/storage/testsuites/multivolume.go b/test/e2e/storage/testsuites/multivolume.go index 25c6fa89408..8c4363f0501 100644 --- a/test/e2e/storage/testsuites/multivolume.go +++ b/test/e2e/storage/testsuites/multivolume.go @@ -565,7 +565,7 @@ func TestConcurrentAccessToSingleVolume(ctx context.Context, f *framework.Framew SeLinuxLabel: e2epod.GetLinuxLabel(), NodeSelection: node, PVCsReadOnly: readOnly, - ImageID: e2epod.GetTestImageID(imageutils.Agnhost), + ImageID: e2epod.GetTestImageID(imageutils.JessieDnsutils), } pod, err := e2epod.CreateSecPodWithNodeSelection(ctx, cs, &podConfig, f.Timeouts.PodStart) framework.ExpectNoError(err) @@ -687,7 +687,7 @@ func TestConcurrentAccessToRelatedVolumes(ctx context.Context, f *framework.Fram SeLinuxLabel: e2epod.GetLinuxLabel(), NodeSelection: node, PVCsReadOnly: false, - ImageID: e2epod.GetTestImageID(imageutils.Agnhost), + ImageID: e2epod.GetTestImageID(imageutils.JessieDnsutils), } pod, err := e2epod.CreateSecPodWithNodeSelection(ctx, cs, &podConfig, f.Timeouts.PodStart) defer func() { diff --git a/test/images/.permitted-images b/test/images/.permitted-images index 219cf73a460..ec7dac61ab5 100644 --- a/test/images/.permitted-images +++ b/test/images/.permitted-images @@ -14,6 +14,7 @@ registry.k8s.io/e2e-test-images/apparmor-loader registry.k8s.io/e2e-test-images/busybox registry.k8s.io/e2e-test-images/httpd registry.k8s.io/e2e-test-images/ipc-utils +registry.k8s.io/e2e-test-images/jessie-dnsutils registry.k8s.io/e2e-test-images/kitten registry.k8s.io/e2e-test-images/nautilus registry.k8s.io/e2e-test-images/nginx diff --git a/test/images/image-util.sh b/test/images/image-util.sh index cc0065c6b14..12c2d3e5933 100755 --- a/test/images/image-util.sh +++ b/test/images/image-util.sh @@ -283,7 +283,7 @@ if [[ "${WHAT}" == "all-conformance" ]]; then # Discussed during Conformance Office Hours Meeting (2019.12.17): # https://docs.google.com/document/d/1W31nXh9RYAb_VaYkwuPLd1hFxuRX3iU0DmaQ4lkCsX8/edit#heading=h.l87lu17xm9bh shift - conformance_images=("busybox" "agnhost" "kitten" "nautilus" "nonewprivs" "resource-consumer" "sample-apiserver") + conformance_images=("busybox" "agnhost" "jessie-dnsutils" "kitten" "nautilus" "nonewprivs" "resource-consumer" "sample-apiserver") for image in "${conformance_images[@]}"; do "${TASK}" "${image}" "$@" done diff --git a/test/images/jessie-dnsutils/BASEIMAGE b/test/images/jessie-dnsutils/BASEIMAGE new file mode 100644 index 00000000000..76dd97afd76 --- /dev/null +++ b/test/images/jessie-dnsutils/BASEIMAGE @@ -0,0 +1,7 @@ +linux/amd64=debian:jessie +linux/arm=arm32v7/debian:jessie +linux/arm64=arm64v8/debian:jessie +linux/ppc64le=ppc64le/debian:jessie +linux/s390x=s390x/debian:jessie +windows/amd64/1809=REGISTRY/busybox:1.29-2-windows-amd64-1809 +windows/amd64/ltsc2022=REGISTRY/busybox:1.29-2-windows-amd64-ltsc2022 diff --git a/test/images/jessie-dnsutils/Dockerfile b/test/images/jessie-dnsutils/Dockerfile new file mode 100644 index 00000000000..9fd6a276a05 --- /dev/null +++ b/test/images/jessie-dnsutils/Dockerfile @@ -0,0 +1,32 @@ +# Copyright 2016 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ARG BASEIMAGE +FROM $BASEIMAGE + +CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/ + +# WARNING: Please note that the script below removes the security packages from arm64 and ppc64el images +# as they do not exist anymore in the debian repositories for jessie. So we do not recommend using this +# image for any production use and limit use of this image to just test scenarios. + +COPY fixup-apt-list.sh / +RUN ["/fixup-apt-list.sh"] + +RUN apt-get -q update && \ + apt-get install -y --force-yes dnsutils && \ + apt-get clean + +ADD https://github.com/coredns/coredns/releases/download/v1.5.0/coredns_1.5.0_linux_BASEARCH.tgz /coredns.tgz +RUN tar -xzvf /coredns.tgz && rm -f /coredns.tgz diff --git a/test/images/jessie-dnsutils/Dockerfile_windows b/test/images/jessie-dnsutils/Dockerfile_windows new file mode 100644 index 00000000000..445852ad899 --- /dev/null +++ b/test/images/jessie-dnsutils/Dockerfile_windows @@ -0,0 +1,28 @@ +# Copyright 2020 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ARG BASEIMAGE + +# We're using a Linux image to unpack the archive, then we're copying it over to Windows. +FROM --platform=linux/amd64 alpine:3.6 as prep + +ADD https://github.com/coredns/coredns/releases/download/v1.5.0/coredns_1.5.0_windows_amd64.tgz /coredns.tgz +RUN tar -xzvf /coredns.tgz + +FROM $BASEIMAGE + +COPY --from=prep /coredns.exe /coredns.exe + +# NOTE(claudiub): docker buildx sets the PATH env variable to a Linux-like PATH, which is not desirable. +ENV PATH="C:\dig\;C:\bin;C:\curl;C:\Windows\System32;C:\Windows;C:\Program Files\PowerShell;" diff --git a/test/images/jessie-dnsutils/OWNERS b/test/images/jessie-dnsutils/OWNERS new file mode 100644 index 00000000000..11e4263977e --- /dev/null +++ b/test/images/jessie-dnsutils/OWNERS @@ -0,0 +1,3 @@ +approvers: + - dims + - mkumatag diff --git a/test/images/jessie-dnsutils/README.md b/test/images/jessie-dnsutils/README.md new file mode 100644 index 00000000000..b0c433127e9 --- /dev/null +++ b/test/images/jessie-dnsutils/README.md @@ -0,0 +1,4 @@ +# jessie-dnsutils + +DNS utils but implemented in a different OS to have some basic check across OSes. +See issue #10161 for original issue and discussion. \ No newline at end of file diff --git a/test/images/jessie-dnsutils/VERSION b/test/images/jessie-dnsutils/VERSION new file mode 100644 index 00000000000..d3bdbdf1fda --- /dev/null +++ b/test/images/jessie-dnsutils/VERSION @@ -0,0 +1 @@ +1.7 diff --git a/test/images/jessie-dnsutils/fixup-apt-list.sh b/test/images/jessie-dnsutils/fixup-apt-list.sh new file mode 100755 index 00000000000..a9aa4f123dc --- /dev/null +++ b/test/images/jessie-dnsutils/fixup-apt-list.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +# Copyright 2017 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +DEB_ARCH=$(dpkg --print-architecture) + +# http://security.debian.org/debian-security/dists/jessie/updates/InRelease is missing +# entries for some platforms, so we just remove the last line in sources.list in +# /etc/apt/sources.list which is "deb http://deb.debian.org/debian jessie-updates main" + +case ${DEB_ARCH} in + s390x|arm64|ppc64el) + # We have to use the archive mirrors. + # See: https://lists.debian.org/debian-devel-announce/2019/03/msg00006.html + echo "deb http://archive.debian.org/debian/ jessie main contrib non-free" | tee /etc/apt/sources.list + echo "deb-src http://archive.debian.org/debian/ jessie main contrib non-free" | tee -a /etc/apt/sources.list + ;; +esac + +exit 0 diff --git a/test/utils/image/manifest.go b/test/utils/image/manifest.go index a0504cfd7ee..d08a9538f82 100644 --- a/test/utils/image/manifest.go +++ b/test/utils/image/manifest.go @@ -175,6 +175,8 @@ const ( InvalidRegistryImage // IpcUtils image IpcUtils + // JessieDnsutils image + JessieDnsutils // Kitten image Kitten // Nautilus image @@ -227,6 +229,7 @@ func initImageConfigs(list RegistryList) (map[ImageID]Config, map[ImageID]Config configs[HttpdNew] = Config{list.PromoterE2eRegistry, "httpd", "2.4.39-4"} configs[InvalidRegistryImage] = Config{list.InvalidRegistry, "alpine", "3.1"} configs[IpcUtils] = Config{list.PromoterE2eRegistry, "ipc-utils", "1.3"} + configs[JessieDnsutils] = Config{list.PromoterE2eRegistry, "jessie-dnsutils", "1.7"} configs[Kitten] = Config{list.PromoterE2eRegistry, "kitten", "1.7"} configs[Nautilus] = Config{list.PromoterE2eRegistry, "nautilus", "1.7"} configs[NFSProvisioner] = Config{list.SigStorageRegistry, "nfs-provisioner", "v4.0.8"}