From 862bd63f808106bf4194bad0320820a2c0b587f4 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Tue, 2 Jun 2020 06:11:43 -0700 Subject: [PATCH] tests: Fixes Windows kubelet-stats test The test spawns 10 pods with the same pod name, which contains multiple containers with the same container name. Because of this, the test fails. This commit addresses this issue. --- test/e2e/windows/kubelet_stats.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/e2e/windows/kubelet_stats.go b/test/e2e/windows/kubelet_stats.go index 89a41a9922e..238cebfbf5f 100644 --- a/test/e2e/windows/kubelet_stats.go +++ b/test/e2e/windows/kubelet_stats.go @@ -18,6 +18,7 @@ package windows import ( "context" + "fmt" "time" v1 "k8s.io/api/core/v1" @@ -128,7 +129,7 @@ func newKubeletStatsTestPods(numPods int, image imageutils.Config, nodeName stri podName := "statscollectiontest-" + string(uuid.NewUUID()) pod := v1.Pod{ ObjectMeta: metav1.ObjectMeta{ - Name: podName, + Name: fmt.Sprintf("%s-%d", podName, i), Labels: map[string]string{ "name": podName, "testapp": "stats-collection", @@ -138,7 +139,7 @@ func newKubeletStatsTestPods(numPods int, image imageutils.Config, nodeName stri Containers: []v1.Container{ { Image: image.GetE2EImage(), - Name: podName, + Name: "stat-container", Command: []string{ "powershell.exe", "-Command", @@ -149,7 +150,7 @@ func newKubeletStatsTestPods(numPods int, image imageutils.Config, nodeName stri InitContainers: []v1.Container{ { Image: image.GetE2EImage(), - Name: podName, + Name: "init-container", Command: []string{ "powershell.exe", "-Command",