From 19e9368eb8d85f699c1c2ab52bf9fa3c2ebcc8f5 Mon Sep 17 00:00:00 2001 From: Caleb Woodbine Date: Wed, 25 Mar 2020 12:04:44 +1300 Subject: [PATCH 01/15] Create Pod+PodStatus resource lifecycle test --- test/e2e/common/pods.go | 120 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) diff --git a/test/e2e/common/pods.go b/test/e2e/common/pods.go index 279598b7464..01b970254f5 100644 --- a/test/e2e/common/pods.go +++ b/test/e2e/common/pods.go @@ -19,8 +19,11 @@ package common import ( "bytes" "context" + "encoding/json" "fmt" "io" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/dynamic" "runtime/debug" "strconv" "strings" @@ -177,9 +180,11 @@ func expectNoErrorWithRetries(fn func() error, maxRetries int, explain ...interf var _ = framework.KubeDescribe("Pods", func() { f := framework.NewDefaultFramework("pods") + var dc dynamic.Interface var podClient *framework.PodClient ginkgo.BeforeEach(func() { podClient = f.PodClient() + dc = f.DynamicClient }) /* @@ -870,6 +875,121 @@ var _ = framework.KubeDescribe("Pods", func() { err = wait.PollImmediate(podRetryPeriod, podRetryTimeout, checkPodListQuantity(f, "type=Testing", 0)) framework.ExpectNoError(err, "found a pod(s)") }) + + ginkgo.It("should run through the lifecycle of Pods and PodStatus", func() { + podResource := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"} + testNs := "default" + testPodName := "pod-test" + testPodImage := "nginx" + testPodImage2 := "nginx" + testPod := v1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: testPodName, + Labels: map[string]string{ + "test-pod-static": "true", + }, + }, + Spec: v1.PodSpec{ + Containers: []v1.Container{ + { + Name: testPodName, + Image: testPodImage, + }, + }, + }, + } + ginkgo.By("creating a Pod with a static label") + _, err := f.ClientSet.CoreV1().Pods(testNs).Create(context.TODO(), &testPod, metav1.CreateOptions{}) + framework.ExpectNoError(err, "failed to create Pod") + + ginkgo.By("setting up a watch for the Pod") + podWatchTimeoutSeconds := int64(180) + podWatch, err := f.ClientSet.CoreV1().Pods(testNs).Watch(context.TODO(), metav1.ListOptions{LabelSelector: "test-pod-static=true", TimeoutSeconds: &podWatchTimeoutSeconds}) + framework.ExpectNoError(err, "failed to set up watch") + + podWatchChan := podWatch.ResultChan() + ginkgo.By("watching for Pod to be ready") + for watchEvent := range podWatchChan { + podWatchEvent, ok := watchEvent.Object.(*v1.Pod) + framework.ExpectEqual(ok, true, "unable to fix type") + if podWatchEvent.Status.Phase == "Running" { + break + } + } + + ginkgo.By("patching the Pod with a new Label and updated data") + podPatch, err := json.Marshal(map[string]interface{}{ + "metadata": map[string]interface{}{ + "labels": map[string]string{ + "podtemplate": "patched", + }, + }, + "spec": map[string]interface{}{ + "containers": []map[string]interface{}{ + { + "name": testPodName, + "image": testPodImage2, + }, + }, + }, + }) + framework.ExpectNoError(err, "failed to marshal JSON patch for Pod") + _, err = f.ClientSet.CoreV1().Pods(testNs).Patch(context.TODO(), testPodName, types.StrategicMergePatchType, []byte(podPatch), metav1.PatchOptions{}) + framework.ExpectNoError(err, "failed to patch Pod") + + ginkgo.By("getting the Pod and ensure it's patched") + pod, err := f.ClientSet.CoreV1().Pods(testNs).Get(context.TODO(), testPodName, metav1.GetOptions{}) + framework.ExpectNoError(err, "failed to fetch Pod") + framework.ExpectEqual(pod.ObjectMeta.Labels["test-pod-static"], "true", "failed to patch Pod - missing label") + framework.ExpectEqual(pod.Spec.Containers[0].Image, testPodImage2, "failed to patch Pod - wrong image") + + ginkgo.By("getting the PodStatus") + podStatusUnstructured, err := dc.Resource(podResource).Namespace(testNs).Get(context.TODO(), testPodName, metav1.GetOptions{}, "status") + framework.ExpectNoError(err, "failed to fetch PodStatus") + podStatusUjson, err := json.Marshal(podStatusUnstructured) + framework.ExpectNoError(err, "failed to marshal unstructured response") + var podStatus v1.Pod + json.Unmarshal(podStatusUjson, &podStatus) + + ginkgo.By("replacing the Pod's status Ready condition to False") + podStatusUpdated := podStatus + podStatusFieldPatchCount := 0 + podStatusFieldPatchCountTotal := 2 + for pos, cond := range podStatusUpdated.Status.Conditions { + if (cond.Type == "Ready" && cond.Status == "True") || (cond.Type == "ContainersReady" && cond.Status == "True") { + podStatusUpdated.Status.Conditions[pos].Status = "False" + podStatusFieldPatchCount++ + } + } + framework.ExpectEqual(podStatusFieldPatchCount, podStatusFieldPatchCountTotal, "failed to patch all relevant Pod conditions") + _, err = f.ClientSet.CoreV1().Pods(testNs).UpdateStatus(context.TODO(), &podStatusUpdated, metav1.UpdateOptions{}) + framework.ExpectNoError(err, "failed to update PodStatus") + + ginkgo.By("list all Pods and get their status to ensure it's Ready condition is False") + podsList, err := f.ClientSet.CoreV1().Pods("").List(context.TODO(), metav1.ListOptions{LabelSelector: "test-pod-static=true"}) + framework.ExpectNoError(err, "failed to list Pods") + podStatusFieldPatchCount = 0 + podStatusFieldPatchCountTotal = 2 + for _, podItem := range podsList.Items { + for _, cond := range podItem.Status.Conditions { + if (cond.Type == "Ready" && cond.Status == "False") || (cond.Type == "ContainersReady" && cond.Status == "False") { + podStatusFieldPatchCount++ + } + } + } + framework.ExpectEqual(podStatusFieldPatchCount, podStatusFieldPatchCountTotal, "failed to update PodStatus - field patch count doesn't match the total") + + ginkgo.By("deleting the Pod via a Collection with a LabelSelector") + err = f.ClientSet.CoreV1().Pods(testNs).DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: "test-pod-static=true"}) + framework.ExpectNoError(err, "failed to delete Pod by collection") + + ginkgo.By("watching for Pod to be deleted") + for watchEvent := range podWatchChan { + if watchEvent.Type == "DELETED" { + break + } + } + }) }) func checkPodListQuantity(f *framework.Framework, label string, quantity int) func() (bool, error) { From 47cd8dde5618615dc3dead7df0356cb6cacbcc66 Mon Sep 17 00:00:00 2001 From: Caleb Woodbine Date: Thu, 2 Apr 2020 10:26:43 +1300 Subject: [PATCH 02/15] Update to check response data of UpdateStatus instead of listing after updating the status --- test/e2e/common/pods.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/test/e2e/common/pods.go b/test/e2e/common/pods.go index 01b970254f5..beb4eb2956e 100644 --- a/test/e2e/common/pods.go +++ b/test/e2e/common/pods.go @@ -962,19 +962,15 @@ var _ = framework.KubeDescribe("Pods", func() { } } framework.ExpectEqual(podStatusFieldPatchCount, podStatusFieldPatchCountTotal, "failed to patch all relevant Pod conditions") - _, err = f.ClientSet.CoreV1().Pods(testNs).UpdateStatus(context.TODO(), &podStatusUpdated, metav1.UpdateOptions{}) + podStatusUpdate, err := f.ClientSet.CoreV1().Pods(testNs).UpdateStatus(context.TODO(), &podStatusUpdated, metav1.UpdateOptions{}) framework.ExpectNoError(err, "failed to update PodStatus") - ginkgo.By("list all Pods and get their status to ensure it's Ready condition is False") - podsList, err := f.ClientSet.CoreV1().Pods("").List(context.TODO(), metav1.ListOptions{LabelSelector: "test-pod-static=true"}) - framework.ExpectNoError(err, "failed to list Pods") + ginkgo.By("check the PodStatus updates's return status to ensure it's Ready condition is False") podStatusFieldPatchCount = 0 podStatusFieldPatchCountTotal = 2 - for _, podItem := range podsList.Items { - for _, cond := range podItem.Status.Conditions { - if (cond.Type == "Ready" && cond.Status == "False") || (cond.Type == "ContainersReady" && cond.Status == "False") { - podStatusFieldPatchCount++ - } + for _, cond := range podStatusUpdate.Status.Conditions { + if (cond.Type == "Ready" && cond.Status == "False") || (cond.Type == "ContainersReady" && cond.Status == "False") { + podStatusFieldPatchCount++ } } framework.ExpectEqual(podStatusFieldPatchCount, podStatusFieldPatchCountTotal, "failed to update PodStatus - field patch count doesn't match the total") From c6a86b5fed023e74aa3ba3431318e1f0db1a2038 Mon Sep 17 00:00:00 2001 From: Caleb Woodbine Date: Wed, 8 Apr 2020 15:42:50 +1200 Subject: [PATCH 03/15] Fix test to use values from v1, wording; Update variables to be more templatable --- test/e2e/common/pods.go | 57 +++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/test/e2e/common/pods.go b/test/e2e/common/pods.go index beb4eb2956e..c0e6ad9a3c9 100644 --- a/test/e2e/common/pods.go +++ b/test/e2e/common/pods.go @@ -878,16 +878,17 @@ var _ = framework.KubeDescribe("Pods", func() { ginkgo.It("should run through the lifecycle of Pods and PodStatus", func() { podResource := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"} - testNs := "default" + testNs := f.Namespace.Name testPodName := "pod-test" testPodImage := "nginx" - testPodImage2 := "nginx" + testPodImage2 := "httpd" + testPodLabels := map[string]string{"test-pod-static": "true"} + testPodLabelsFlat := "test-pod-static=true" + testPod := v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: testPodName, - Labels: map[string]string{ - "test-pod-static": "true", - }, + Labels: testPodLabels, }, Spec: v1.PodSpec{ Containers: []v1.Container{ @@ -904,40 +905,36 @@ var _ = framework.KubeDescribe("Pods", func() { ginkgo.By("setting up a watch for the Pod") podWatchTimeoutSeconds := int64(180) - podWatch, err := f.ClientSet.CoreV1().Pods(testNs).Watch(context.TODO(), metav1.ListOptions{LabelSelector: "test-pod-static=true", TimeoutSeconds: &podWatchTimeoutSeconds}) + podWatch, err := f.ClientSet.CoreV1().Pods(testNs).Watch(context.TODO(), metav1.ListOptions{LabelSelector: testPodLabelsFlat, TimeoutSeconds: &podWatchTimeoutSeconds}) framework.ExpectNoError(err, "failed to set up watch") podWatchChan := podWatch.ResultChan() ginkgo.By("watching for Pod to be ready") for watchEvent := range podWatchChan { podWatchEvent, ok := watchEvent.Object.(*v1.Pod) - framework.ExpectEqual(ok, true, "unable to fix type") - if podWatchEvent.Status.Phase == "Running" { + framework.ExpectEqual(ok, true, "unable to assert runtime object type to v1.Pod") + if podWatchEvent.Status.Phase == v1.PodRunning { break } } ginkgo.By("patching the Pod with a new Label and updated data") - podPatch, err := json.Marshal(map[string]interface{}{ - "metadata": map[string]interface{}{ - "labels": map[string]string{ - "podtemplate": "patched", - }, + podPatch, err := json.Marshal(v1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{"podtemplate": "patched"}, }, - "spec": map[string]interface{}{ - "containers": []map[string]interface{}{ - { - "name": testPodName, - "image": testPodImage2, - }, - }, + Spec: v1.PodSpec{ + Containers: []v1.Container{{ + Name: testPodName, + Image: testPodImage2, + }}, }, }) framework.ExpectNoError(err, "failed to marshal JSON patch for Pod") _, err = f.ClientSet.CoreV1().Pods(testNs).Patch(context.TODO(), testPodName, types.StrategicMergePatchType, []byte(podPatch), metav1.PatchOptions{}) framework.ExpectNoError(err, "failed to patch Pod") - ginkgo.By("getting the Pod and ensure it's patched") + ginkgo.By("getting the Pod and ensuring that it's patched") pod, err := f.ClientSet.CoreV1().Pods(testNs).Get(context.TODO(), testPodName, metav1.GetOptions{}) framework.ExpectNoError(err, "failed to fetch Pod") framework.ExpectEqual(pod.ObjectMeta.Labels["test-pod-static"], "true", "failed to patch Pod - missing label") @@ -946,18 +943,18 @@ var _ = framework.KubeDescribe("Pods", func() { ginkgo.By("getting the PodStatus") podStatusUnstructured, err := dc.Resource(podResource).Namespace(testNs).Get(context.TODO(), testPodName, metav1.GetOptions{}, "status") framework.ExpectNoError(err, "failed to fetch PodStatus") - podStatusUjson, err := json.Marshal(podStatusUnstructured) + podStatusBytes, err := json.Marshal(podStatusUnstructured) framework.ExpectNoError(err, "failed to marshal unstructured response") var podStatus v1.Pod - json.Unmarshal(podStatusUjson, &podStatus) + json.Unmarshal(podStatusBytes, &podStatus) ginkgo.By("replacing the Pod's status Ready condition to False") podStatusUpdated := podStatus podStatusFieldPatchCount := 0 podStatusFieldPatchCountTotal := 2 for pos, cond := range podStatusUpdated.Status.Conditions { - if (cond.Type == "Ready" && cond.Status == "True") || (cond.Type == "ContainersReady" && cond.Status == "True") { - podStatusUpdated.Status.Conditions[pos].Status = "False" + if (cond.Type == v1.PodReady && cond.Status == v1.ConditionTrue) || (cond.Type == v1.ContainersReady && cond.Status == v1.ConditionTrue) { + podStatusUpdated.Status.Conditions[pos].Status = v1.ConditionFalse podStatusFieldPatchCount++ } } @@ -965,23 +962,23 @@ var _ = framework.KubeDescribe("Pods", func() { podStatusUpdate, err := f.ClientSet.CoreV1().Pods(testNs).UpdateStatus(context.TODO(), &podStatusUpdated, metav1.UpdateOptions{}) framework.ExpectNoError(err, "failed to update PodStatus") - ginkgo.By("check the PodStatus updates's return status to ensure it's Ready condition is False") + ginkgo.By("check the Pod again to ensure its Ready conditions are False") podStatusFieldPatchCount = 0 podStatusFieldPatchCountTotal = 2 for _, cond := range podStatusUpdate.Status.Conditions { - if (cond.Type == "Ready" && cond.Status == "False") || (cond.Type == "ContainersReady" && cond.Status == "False") { + if (cond.Type == v1.PodReady && cond.Status == v1.ConditionFalse) || (cond.Type == v1.ContainersReady && cond.Status == v1.ConditionFalse) { podStatusFieldPatchCount++ } } framework.ExpectEqual(podStatusFieldPatchCount, podStatusFieldPatchCountTotal, "failed to update PodStatus - field patch count doesn't match the total") ginkgo.By("deleting the Pod via a Collection with a LabelSelector") - err = f.ClientSet.CoreV1().Pods(testNs).DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: "test-pod-static=true"}) + err = f.ClientSet.CoreV1().Pods(testNs).DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: testPodLabelsFlat}) framework.ExpectNoError(err, "failed to delete Pod by collection") - ginkgo.By("watching for Pod to be deleted") + ginkgo.By("watching for the Pod to be deleted") for watchEvent := range podWatchChan { - if watchEvent.Type == "DELETED" { + if watchEvent.Type == watch.Deleted { break } } From cb7835bcb07eefdac12659ccb4b8ad877448eeac Mon Sep 17 00:00:00 2001 From: Caleb Woodbine Date: Wed, 8 Apr 2020 15:58:28 +1200 Subject: [PATCH 04/15] Add check for unmarshalling onto a Pod object type --- test/e2e/common/pods.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/e2e/common/pods.go b/test/e2e/common/pods.go index c0e6ad9a3c9..3038d238c9a 100644 --- a/test/e2e/common/pods.go +++ b/test/e2e/common/pods.go @@ -946,7 +946,8 @@ var _ = framework.KubeDescribe("Pods", func() { podStatusBytes, err := json.Marshal(podStatusUnstructured) framework.ExpectNoError(err, "failed to marshal unstructured response") var podStatus v1.Pod - json.Unmarshal(podStatusBytes, &podStatus) + err = json.Unmarshal(podStatusBytes, &podStatus) + framework.ExpectNoError(err, "failed to unmarshal JSON bytes to a Pod object type") ginkgo.By("replacing the Pod's status Ready condition to False") podStatusUpdated := podStatus From a4e29f248134db32978dd10e84b51d5313b9ffd1 Mon Sep 17 00:00:00 2001 From: Caleb Woodbine Date: Thu, 9 Apr 2020 09:29:44 +1200 Subject: [PATCH 05/15] Fix formatting --- test/e2e/common/pods.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/common/pods.go b/test/e2e/common/pods.go index 3038d238c9a..4af0165e58a 100644 --- a/test/e2e/common/pods.go +++ b/test/e2e/common/pods.go @@ -887,7 +887,7 @@ var _ = framework.KubeDescribe("Pods", func() { testPod := v1.Pod{ ObjectMeta: metav1.ObjectMeta{ - Name: testPodName, + Name: testPodName, Labels: testPodLabels, }, Spec: v1.PodSpec{ @@ -925,7 +925,7 @@ var _ = framework.KubeDescribe("Pods", func() { }, Spec: v1.PodSpec{ Containers: []v1.Container{{ - Name: testPodName, + Name: testPodName, Image: testPodImage2, }}, }, From a2c19d7ae0f21f114475d61a65bb58c8f043b1a5 Mon Sep 17 00:00:00 2001 From: Caleb Woodbine Date: Wed, 22 Apr 2020 11:23:16 +1200 Subject: [PATCH 06/15] Add watch checks --- test/e2e/common/pods.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/e2e/common/pods.go b/test/e2e/common/pods.go index 4af0165e58a..9ce6a38cde9 100644 --- a/test/e2e/common/pods.go +++ b/test/e2e/common/pods.go @@ -910,13 +910,16 @@ var _ = framework.KubeDescribe("Pods", func() { podWatchChan := podWatch.ResultChan() ginkgo.By("watching for Pod to be ready") + eventFound := false for watchEvent := range podWatchChan { podWatchEvent, ok := watchEvent.Object.(*v1.Pod) framework.ExpectEqual(ok, true, "unable to assert runtime object type to v1.Pod") if podWatchEvent.Status.Phase == v1.PodRunning { + eventFound = true break } } + framework.ExpectEqual(eventFound, true, "failed to find running Pod") ginkgo.By("patching the Pod with a new Label and updated data") podPatch, err := json.Marshal(v1.Pod{ @@ -978,11 +981,14 @@ var _ = framework.KubeDescribe("Pods", func() { framework.ExpectNoError(err, "failed to delete Pod by collection") ginkgo.By("watching for the Pod to be deleted") + eventFound = false for watchEvent := range podWatchChan { if watchEvent.Type == watch.Deleted { + eventFound = true break } } + framework.ExpectEqual(eventFound, true, "failed to find Pod %v event", watch.Deleted) }) }) From 6e04fbdde1bed3b75dfc189ae98dfb2e6848dec2 Mon Sep 17 00:00:00 2001 From: Caleb Woodbine Date: Thu, 23 Apr 2020 11:58:19 +1200 Subject: [PATCH 07/15] Update error statements --- test/e2e/common/pods.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/test/e2e/common/pods.go b/test/e2e/common/pods.go index 9ce6a38cde9..557ed30044f 100644 --- a/test/e2e/common/pods.go +++ b/test/e2e/common/pods.go @@ -901,25 +901,27 @@ var _ = framework.KubeDescribe("Pods", func() { } ginkgo.By("creating a Pod with a static label") _, err := f.ClientSet.CoreV1().Pods(testNs).Create(context.TODO(), &testPod, metav1.CreateOptions{}) - framework.ExpectNoError(err, "failed to create Pod") + framework.ExpectNoError(err, "failed to create Pod " + testPodName + " in namespace " + testNs) ginkgo.By("setting up a watch for the Pod") podWatchTimeoutSeconds := int64(180) podWatch, err := f.ClientSet.CoreV1().Pods(testNs).Watch(context.TODO(), metav1.ListOptions{LabelSelector: testPodLabelsFlat, TimeoutSeconds: &podWatchTimeoutSeconds}) - framework.ExpectNoError(err, "failed to set up watch") + framework.ExpectNoError(err, "failed to set up watch for Pod " + testPodName + " in namespace " + testNs) podWatchChan := podWatch.ResultChan() ginkgo.By("watching for Pod to be ready") eventFound := false for watchEvent := range podWatchChan { podWatchEvent, ok := watchEvent.Object.(*v1.Pod) - framework.ExpectEqual(ok, true, "unable to assert runtime object type to v1.Pod") + if ok == false { + continue + } if podWatchEvent.Status.Phase == v1.PodRunning { eventFound = true break } } - framework.ExpectEqual(eventFound, true, "failed to find running Pod") + framework.ExpectEqual(eventFound, true, "failed to find running Pod " + testPodName + " in namespace " + testNs) ginkgo.By("patching the Pod with a new Label and updated data") podPatch, err := json.Marshal(v1.Pod{ @@ -935,17 +937,17 @@ var _ = framework.KubeDescribe("Pods", func() { }) framework.ExpectNoError(err, "failed to marshal JSON patch for Pod") _, err = f.ClientSet.CoreV1().Pods(testNs).Patch(context.TODO(), testPodName, types.StrategicMergePatchType, []byte(podPatch), metav1.PatchOptions{}) - framework.ExpectNoError(err, "failed to patch Pod") + framework.ExpectNoError(err, "failed to patch Pod " + testPodName + " in namespace " + testNs) ginkgo.By("getting the Pod and ensuring that it's patched") pod, err := f.ClientSet.CoreV1().Pods(testNs).Get(context.TODO(), testPodName, metav1.GetOptions{}) - framework.ExpectNoError(err, "failed to fetch Pod") + framework.ExpectNoError(err, "failed to fetch Pod " + testPodName + " in namespace " + testNs) framework.ExpectEqual(pod.ObjectMeta.Labels["test-pod-static"], "true", "failed to patch Pod - missing label") framework.ExpectEqual(pod.Spec.Containers[0].Image, testPodImage2, "failed to patch Pod - wrong image") ginkgo.By("getting the PodStatus") podStatusUnstructured, err := dc.Resource(podResource).Namespace(testNs).Get(context.TODO(), testPodName, metav1.GetOptions{}, "status") - framework.ExpectNoError(err, "failed to fetch PodStatus") + framework.ExpectNoError(err, "failed to fetch PodStatus of Pod " + testPodName + " in namespace " + testNs) podStatusBytes, err := json.Marshal(podStatusUnstructured) framework.ExpectNoError(err, "failed to marshal unstructured response") var podStatus v1.Pod @@ -964,7 +966,7 @@ var _ = framework.KubeDescribe("Pods", func() { } framework.ExpectEqual(podStatusFieldPatchCount, podStatusFieldPatchCountTotal, "failed to patch all relevant Pod conditions") podStatusUpdate, err := f.ClientSet.CoreV1().Pods(testNs).UpdateStatus(context.TODO(), &podStatusUpdated, metav1.UpdateOptions{}) - framework.ExpectNoError(err, "failed to update PodStatus") + framework.ExpectNoError(err, "failed to update PodStatus of Pod " + testPodName + " in namespace " + testNs) ginkgo.By("check the Pod again to ensure its Ready conditions are False") podStatusFieldPatchCount = 0 From dc30156fb811eca35d50607b84205eab3c1d0c5c Mon Sep 17 00:00:00 2001 From: Caleb Woodbine Date: Thu, 23 Apr 2020 13:22:42 +1200 Subject: [PATCH 08/15] Update error handling formatting, handling of type conversion in watch event loop --- test/e2e/common/pods.go | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/test/e2e/common/pods.go b/test/e2e/common/pods.go index 557ed30044f..e63512958fb 100644 --- a/test/e2e/common/pods.go +++ b/test/e2e/common/pods.go @@ -901,27 +901,23 @@ var _ = framework.KubeDescribe("Pods", func() { } ginkgo.By("creating a Pod with a static label") _, err := f.ClientSet.CoreV1().Pods(testNs).Create(context.TODO(), &testPod, metav1.CreateOptions{}) - framework.ExpectNoError(err, "failed to create Pod " + testPodName + " in namespace " + testNs) + framework.ExpectNoError(err, "failed to create Pod %s in namespace %s", testPodName, testNs) ginkgo.By("setting up a watch for the Pod") podWatchTimeoutSeconds := int64(180) podWatch, err := f.ClientSet.CoreV1().Pods(testNs).Watch(context.TODO(), metav1.ListOptions{LabelSelector: testPodLabelsFlat, TimeoutSeconds: &podWatchTimeoutSeconds}) - framework.ExpectNoError(err, "failed to set up watch for Pod " + testPodName + " in namespace " + testNs) + framework.ExpectNoError(err, "failed to set up watch for Pod %s in namespace %s", testPodName, testNs) podWatchChan := podWatch.ResultChan() ginkgo.By("watching for Pod to be ready") eventFound := false for watchEvent := range podWatchChan { - podWatchEvent, ok := watchEvent.Object.(*v1.Pod) - if ok == false { - continue - } - if podWatchEvent.Status.Phase == v1.PodRunning { + if podWatchEvent, ok := watchEvent.Object.(*v1.Pod); ok && podWatchEvent.Status.Phase == v1.PodRunning { eventFound = true break } } - framework.ExpectEqual(eventFound, true, "failed to find running Pod " + testPodName + " in namespace " + testNs) + framework.ExpectEqual(eventFound, true, "failed to find running Pod %s in namespace %s", testPodName, testNs) ginkgo.By("patching the Pod with a new Label and updated data") podPatch, err := json.Marshal(v1.Pod{ @@ -937,17 +933,17 @@ var _ = framework.KubeDescribe("Pods", func() { }) framework.ExpectNoError(err, "failed to marshal JSON patch for Pod") _, err = f.ClientSet.CoreV1().Pods(testNs).Patch(context.TODO(), testPodName, types.StrategicMergePatchType, []byte(podPatch), metav1.PatchOptions{}) - framework.ExpectNoError(err, "failed to patch Pod " + testPodName + " in namespace " + testNs) + framework.ExpectNoError(err, "failed to patch Pod %s in namespace %s", testPodName, testNs) ginkgo.By("getting the Pod and ensuring that it's patched") pod, err := f.ClientSet.CoreV1().Pods(testNs).Get(context.TODO(), testPodName, metav1.GetOptions{}) - framework.ExpectNoError(err, "failed to fetch Pod " + testPodName + " in namespace " + testNs) + framework.ExpectNoError(err, "failed to fetch Pod %s in namespace %s", testPodName, testNs) framework.ExpectEqual(pod.ObjectMeta.Labels["test-pod-static"], "true", "failed to patch Pod - missing label") framework.ExpectEqual(pod.Spec.Containers[0].Image, testPodImage2, "failed to patch Pod - wrong image") ginkgo.By("getting the PodStatus") podStatusUnstructured, err := dc.Resource(podResource).Namespace(testNs).Get(context.TODO(), testPodName, metav1.GetOptions{}, "status") - framework.ExpectNoError(err, "failed to fetch PodStatus of Pod " + testPodName + " in namespace " + testNs) + framework.ExpectNoError(err, "failed to fetch PodStatus of Pod %s in namespace %s", testPodName, testNs) podStatusBytes, err := json.Marshal(podStatusUnstructured) framework.ExpectNoError(err, "failed to marshal unstructured response") var podStatus v1.Pod @@ -966,7 +962,7 @@ var _ = framework.KubeDescribe("Pods", func() { } framework.ExpectEqual(podStatusFieldPatchCount, podStatusFieldPatchCountTotal, "failed to patch all relevant Pod conditions") podStatusUpdate, err := f.ClientSet.CoreV1().Pods(testNs).UpdateStatus(context.TODO(), &podStatusUpdated, metav1.UpdateOptions{}) - framework.ExpectNoError(err, "failed to update PodStatus of Pod " + testPodName + " in namespace " + testNs) + framework.ExpectNoError(err, "failed to update PodStatus of Pod %s in namespace %s", testPodName, testNs) ginkgo.By("check the Pod again to ensure its Ready conditions are False") podStatusFieldPatchCount = 0 From 05163497bc970b0b049e7c741202497d23b1a863 Mon Sep 17 00:00:00 2001 From: Caleb Woodbine Date: Mon, 20 Jul 2020 11:15:57 +1200 Subject: [PATCH 09/15] Fix bazel build --- test/e2e/common/BUILD | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/e2e/common/BUILD b/test/e2e/common/BUILD index 3c642b6e247..5d8f37709a0 100644 --- a/test/e2e/common/BUILD +++ b/test/e2e/common/BUILD @@ -58,6 +58,7 @@ go_library( "//staging/src/k8s.io/apimachinery/pkg/fields:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", + "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/diff:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/intstr:go_default_library", @@ -66,6 +67,7 @@ go_library( "//staging/src/k8s.io/apimachinery/pkg/util/uuid:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library", + "//staging/src/k8s.io/client-go/dynamic:go_default_library", "//staging/src/k8s.io/client-go/kubernetes:go_default_library", "//staging/src/k8s.io/client-go/tools/cache:go_default_library", "//staging/src/k8s.io/client-go/tools/watch:go_default_library", From bd34e1c445bf3ca9cc54f5729233ea5cb6756550 Mon Sep 17 00:00:00 2001 From: Caleb Woodbine Date: Wed, 22 Jul 2020 10:07:18 +1200 Subject: [PATCH 10/15] Fix label patch and check --- test/e2e/common/pods.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/common/pods.go b/test/e2e/common/pods.go index e63512958fb..6b38066b380 100644 --- a/test/e2e/common/pods.go +++ b/test/e2e/common/pods.go @@ -922,7 +922,7 @@ var _ = framework.KubeDescribe("Pods", func() { ginkgo.By("patching the Pod with a new Label and updated data") podPatch, err := json.Marshal(v1.Pod{ ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{"podtemplate": "patched"}, + Labels: map[string]string{"test-pod": "patched"}, }, Spec: v1.PodSpec{ Containers: []v1.Container{{ @@ -938,7 +938,7 @@ var _ = framework.KubeDescribe("Pods", func() { ginkgo.By("getting the Pod and ensuring that it's patched") pod, err := f.ClientSet.CoreV1().Pods(testNs).Get(context.TODO(), testPodName, metav1.GetOptions{}) framework.ExpectNoError(err, "failed to fetch Pod %s in namespace %s", testPodName, testNs) - framework.ExpectEqual(pod.ObjectMeta.Labels["test-pod-static"], "true", "failed to patch Pod - missing label") + framework.ExpectEqual(pod.ObjectMeta.Labels["test-pod"], "patched", "failed to patch Pod - missing label") framework.ExpectEqual(pod.Spec.Containers[0].Image, testPodImage2, "failed to patch Pod - wrong image") ginkgo.By("getting the PodStatus") From d60a57ad7388dd40e85b5bd6f99cc8bbbd7ec8f1 Mon Sep 17 00:00:00 2001 From: Caleb Woodbine Date: Wed, 22 Jul 2020 10:33:55 +1200 Subject: [PATCH 11/15] Update watches to use watchtools.Until, namespace var name --- test/e2e/common/pods.go | 115 ++++++++++++++++++++++++++++------------ 1 file changed, 82 insertions(+), 33 deletions(-) diff --git a/test/e2e/common/pods.go b/test/e2e/common/pods.go index 6b38066b380..6d5c7f79750 100644 --- a/test/e2e/common/pods.go +++ b/test/e2e/common/pods.go @@ -878,13 +878,22 @@ var _ = framework.KubeDescribe("Pods", func() { ginkgo.It("should run through the lifecycle of Pods and PodStatus", func() { podResource := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"} - testNs := f.Namespace.Name + testNamespaceName := f.Namespace.Name testPodName := "pod-test" testPodImage := "nginx" testPodImage2 := "httpd" testPodLabels := map[string]string{"test-pod-static": "true"} testPodLabelsFlat := "test-pod-static=true" + w := &cache.ListWatch{ + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + options.LabelSelector = testPodLabelsFlat + return f.ClientSet.CoreV1().Pods(testNamespaceName).Watch(context.TODO(), options) + }, + } + podsList, err := f.ClientSet.CoreV1().Pods("").List(context.TODO(), metav1.ListOptions{LabelSelector: testPodLabelsFlat}) + framework.ExpectNoError(err, "failed to list Pods") + testPod := v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: testPodName, @@ -900,24 +909,40 @@ var _ = framework.KubeDescribe("Pods", func() { }, } ginkgo.By("creating a Pod with a static label") - _, err := f.ClientSet.CoreV1().Pods(testNs).Create(context.TODO(), &testPod, metav1.CreateOptions{}) - framework.ExpectNoError(err, "failed to create Pod %s in namespace %s", testPodName, testNs) + _, err = f.ClientSet.CoreV1().Pods(testNamespaceName).Create(context.TODO(), &testPod, metav1.CreateOptions{}) + framework.ExpectNoError(err, "failed to create Pod %s in namespace %s", testPodName, testNamespaceName) - ginkgo.By("setting up a watch for the Pod") - podWatchTimeoutSeconds := int64(180) - podWatch, err := f.ClientSet.CoreV1().Pods(testNs).Watch(context.TODO(), metav1.ListOptions{LabelSelector: testPodLabelsFlat, TimeoutSeconds: &podWatchTimeoutSeconds}) - framework.ExpectNoError(err, "failed to set up watch for Pod %s in namespace %s", testPodName, testNs) - - podWatchChan := podWatch.ResultChan() - ginkgo.By("watching for Pod to be ready") - eventFound := false - for watchEvent := range podWatchChan { - if podWatchEvent, ok := watchEvent.Object.(*v1.Pod); ok && podWatchEvent.Status.Phase == v1.PodRunning { - eventFound = true - break + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + _, err = watchtools.Until(ctx, podsList.ResourceVersion, w, func(event watch.Event) (bool, error) { + switch event.Type { + case watch.Added: + if pod, ok := event.Object.(*v1.Pod); ok { + found := pod.ObjectMeta.Name == pod.Name && + pod.Labels["test-pod-static"] == "true" + return found, nil + } + default: + framework.Logf("observed event type %v", event.Type) } - } - framework.ExpectEqual(eventFound, true, "failed to find running Pod %s in namespace %s", testPodName, testNs) + return false, nil + }) + framework.ExpectNoError(err, "failed to see %v event", watch.Added) + + ginkgo.By("watching for Pod to be ready") + ctx, cancel = context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + _, err = watchtools.Until(ctx, podsList.ResourceVersion, w, func(event watch.Event) (bool, error) { + if pod, ok := event.Object.(*v1.Pod); ok { + found := pod.ObjectMeta.Name == testPod.ObjectMeta.Name && + pod.ObjectMeta.Namespace == testNamespaceName && + pod.Labels["test-pod-static"] == "true" && + pod.Status.Phase == v1.PodRunning + return found, nil + } + return false, nil + }) + framework.ExpectNoError(err, "failed to see Pod %v in namespace %v running", testPod.ObjectMeta.Name, testNamespaceName) ginkgo.By("patching the Pod with a new Label and updated data") podPatch, err := json.Marshal(v1.Pod{ @@ -932,18 +957,34 @@ var _ = framework.KubeDescribe("Pods", func() { }, }) framework.ExpectNoError(err, "failed to marshal JSON patch for Pod") - _, err = f.ClientSet.CoreV1().Pods(testNs).Patch(context.TODO(), testPodName, types.StrategicMergePatchType, []byte(podPatch), metav1.PatchOptions{}) - framework.ExpectNoError(err, "failed to patch Pod %s in namespace %s", testPodName, testNs) + _, err = f.ClientSet.CoreV1().Pods(testNamespaceName).Patch(context.TODO(), testPodName, types.StrategicMergePatchType, []byte(podPatch), metav1.PatchOptions{}) + framework.ExpectNoError(err, "failed to patch Pod %s in namespace %s", testPodName, testNamespaceName) + ctx, cancel = context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + _, err = watchtools.Until(ctx, podsList.ResourceVersion, w, func(event watch.Event) (bool, error) { + switch event.Type { + case watch.Modified: + if pod, ok := event.Object.(*v1.Pod); ok { + found := pod.ObjectMeta.Name == pod.Name && + pod.Labels["test-pod-static"] == "true" + return found, nil + } + default: + framework.Logf("observed event type %v", event.Type) + } + return false, nil + }) + framework.ExpectNoError(err, "failed to see %v event", watch.Modified) ginkgo.By("getting the Pod and ensuring that it's patched") - pod, err := f.ClientSet.CoreV1().Pods(testNs).Get(context.TODO(), testPodName, metav1.GetOptions{}) - framework.ExpectNoError(err, "failed to fetch Pod %s in namespace %s", testPodName, testNs) + pod, err := f.ClientSet.CoreV1().Pods(testNamespaceName).Get(context.TODO(), testPodName, metav1.GetOptions{}) + framework.ExpectNoError(err, "failed to fetch Pod %s in namespace %s", testPodName, testNamespaceName) framework.ExpectEqual(pod.ObjectMeta.Labels["test-pod"], "patched", "failed to patch Pod - missing label") framework.ExpectEqual(pod.Spec.Containers[0].Image, testPodImage2, "failed to patch Pod - wrong image") ginkgo.By("getting the PodStatus") - podStatusUnstructured, err := dc.Resource(podResource).Namespace(testNs).Get(context.TODO(), testPodName, metav1.GetOptions{}, "status") - framework.ExpectNoError(err, "failed to fetch PodStatus of Pod %s in namespace %s", testPodName, testNs) + podStatusUnstructured, err := dc.Resource(podResource).Namespace(testNamespaceName).Get(context.TODO(), testPodName, metav1.GetOptions{}, "status") + framework.ExpectNoError(err, "failed to fetch PodStatus of Pod %s in namespace %s", testPodName, testNamespaceName) podStatusBytes, err := json.Marshal(podStatusUnstructured) framework.ExpectNoError(err, "failed to marshal unstructured response") var podStatus v1.Pod @@ -961,8 +1002,8 @@ var _ = framework.KubeDescribe("Pods", func() { } } framework.ExpectEqual(podStatusFieldPatchCount, podStatusFieldPatchCountTotal, "failed to patch all relevant Pod conditions") - podStatusUpdate, err := f.ClientSet.CoreV1().Pods(testNs).UpdateStatus(context.TODO(), &podStatusUpdated, metav1.UpdateOptions{}) - framework.ExpectNoError(err, "failed to update PodStatus of Pod %s in namespace %s", testPodName, testNs) + podStatusUpdate, err := f.ClientSet.CoreV1().Pods(testNamespaceName).UpdateStatus(context.TODO(), &podStatusUpdated, metav1.UpdateOptions{}) + framework.ExpectNoError(err, "failed to update PodStatus of Pod %s in namespace %s", testPodName, testNamespaceName) ginkgo.By("check the Pod again to ensure its Ready conditions are False") podStatusFieldPatchCount = 0 @@ -975,18 +1016,26 @@ var _ = framework.KubeDescribe("Pods", func() { framework.ExpectEqual(podStatusFieldPatchCount, podStatusFieldPatchCountTotal, "failed to update PodStatus - field patch count doesn't match the total") ginkgo.By("deleting the Pod via a Collection with a LabelSelector") - err = f.ClientSet.CoreV1().Pods(testNs).DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: testPodLabelsFlat}) + err = f.ClientSet.CoreV1().Pods(testNamespaceName).DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: testPodLabelsFlat}) framework.ExpectNoError(err, "failed to delete Pod by collection") ginkgo.By("watching for the Pod to be deleted") - eventFound = false - for watchEvent := range podWatchChan { - if watchEvent.Type == watch.Deleted { - eventFound = true - break + ctx, cancel = context.WithTimeout(context.Background(), 30*time.Second) + defer cancel() + _, err = watchtools.Until(ctx, podsList.ResourceVersion, w, func(event watch.Event) (bool, error) { + switch event.Type { + case watch.Deleted: + if pod, ok := event.Object.(*v1.Pod); ok { + found := pod.ObjectMeta.Name == pod.Name && + pod.Labels["test-pod-static"] == "true" + return found, nil + } + default: + framework.Logf("observed event type %v", event.Type) } - } - framework.ExpectEqual(eventFound, true, "failed to find Pod %v event", watch.Deleted) + return false, nil + }) + framework.ExpectNoError(err, "failed to see %v event", watch.Deleted) }) }) From d26cb7150aebdeec74330acaeab87428e915f5f6 Mon Sep 17 00:00:00 2001 From: Caleb Woodbine Date: Wed, 22 Jul 2020 13:55:29 +1200 Subject: [PATCH 12/15] Remove created check --- test/e2e/common/pods.go | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/test/e2e/common/pods.go b/test/e2e/common/pods.go index 6d5c7f79750..5f81de37f56 100644 --- a/test/e2e/common/pods.go +++ b/test/e2e/common/pods.go @@ -910,27 +910,9 @@ var _ = framework.KubeDescribe("Pods", func() { } ginkgo.By("creating a Pod with a static label") _, err = f.ClientSet.CoreV1().Pods(testNamespaceName).Create(context.TODO(), &testPod, metav1.CreateOptions{}) - framework.ExpectNoError(err, "failed to create Pod %s in namespace %s", testPodName, testNamespaceName) - - ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) - defer cancel() - _, err = watchtools.Until(ctx, podsList.ResourceVersion, w, func(event watch.Event) (bool, error) { - switch event.Type { - case watch.Added: - if pod, ok := event.Object.(*v1.Pod); ok { - found := pod.ObjectMeta.Name == pod.Name && - pod.Labels["test-pod-static"] == "true" - return found, nil - } - default: - framework.Logf("observed event type %v", event.Type) - } - return false, nil - }) - framework.ExpectNoError(err, "failed to see %v event", watch.Added) ginkgo.By("watching for Pod to be ready") - ctx, cancel = context.WithTimeout(context.Background(), 30*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() _, err = watchtools.Until(ctx, podsList.ResourceVersion, w, func(event watch.Event) (bool, error) { if pod, ok := event.Object.(*v1.Pod); ok { From a0861aeb52b52d9243e551b4277fda8a79303aa9 Mon Sep 17 00:00:00 2001 From: Caleb Woodbine Date: Wed, 22 Jul 2020 15:23:56 +1200 Subject: [PATCH 13/15] Fix fmt and staticcheck --- test/e2e/common/pods.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/test/e2e/common/pods.go b/test/e2e/common/pods.go index 5f81de37f56..5e7c681e4f9 100644 --- a/test/e2e/common/pods.go +++ b/test/e2e/common/pods.go @@ -910,18 +910,19 @@ var _ = framework.KubeDescribe("Pods", func() { } ginkgo.By("creating a Pod with a static label") _, err = f.ClientSet.CoreV1().Pods(testNamespaceName).Create(context.TODO(), &testPod, metav1.CreateOptions{}) + framework.ExpectNoError(err, "failed to create Pod %v in namespace %v", testPod.ObjectMeta.Name, testNamespaceName) ginkgo.By("watching for Pod to be ready") ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() _, err = watchtools.Until(ctx, podsList.ResourceVersion, w, func(event watch.Event) (bool, error) { - if pod, ok := event.Object.(*v1.Pod); ok { - found := pod.ObjectMeta.Name == testPod.ObjectMeta.Name && - pod.ObjectMeta.Namespace == testNamespaceName && - pod.Labels["test-pod-static"] == "true" && - pod.Status.Phase == v1.PodRunning - return found, nil - } + if pod, ok := event.Object.(*v1.Pod); ok { + found := pod.ObjectMeta.Name == testPod.ObjectMeta.Name && + pod.ObjectMeta.Namespace == testNamespaceName && + pod.Labels["test-pod-static"] == "true" && + pod.Status.Phase == v1.PodRunning + return found, nil + } return false, nil }) framework.ExpectNoError(err, "failed to see Pod %v in namespace %v running", testPod.ObjectMeta.Name, testNamespaceName) From 080ad0990a4393c483a9fcc9fc50041f3a9a719a Mon Sep 17 00:00:00 2001 From: Caleb Woodbine Date: Wed, 22 Jul 2020 16:44:18 +1200 Subject: [PATCH 14/15] Add logs for Pod observations while watching for a running state --- test/e2e/common/pods.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/e2e/common/pods.go b/test/e2e/common/pods.go index 5e7c681e4f9..5b1523182dd 100644 --- a/test/e2e/common/pods.go +++ b/test/e2e/common/pods.go @@ -921,6 +921,9 @@ var _ = framework.KubeDescribe("Pods", func() { pod.ObjectMeta.Namespace == testNamespaceName && pod.Labels["test-pod-static"] == "true" && pod.Status.Phase == v1.PodRunning + if !found { + framework.Logf("observed Pod %v in namespace %v in phase %v", pod.ObjectMeta.Name, pod.ObjectMeta.Namespace, pod.Status.Phase) + } return found, nil } return false, nil From 642bed3c6c116891c98171f2a321f0c0f0afe2e5 Mon Sep 17 00:00:00 2001 From: Caleb Woodbine Date: Thu, 23 Jul 2020 14:13:40 +1200 Subject: [PATCH 15/15] Update test images to use conformance images --- test/e2e/common/pods.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/common/pods.go b/test/e2e/common/pods.go index 5b1523182dd..57bbea47f87 100644 --- a/test/e2e/common/pods.go +++ b/test/e2e/common/pods.go @@ -880,8 +880,8 @@ var _ = framework.KubeDescribe("Pods", func() { podResource := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"} testNamespaceName := f.Namespace.Name testPodName := "pod-test" - testPodImage := "nginx" - testPodImage2 := "httpd" + testPodImage := imageutils.GetE2EImage(imageutils.Agnhost) + testPodImage2 := imageutils.GetE2EImage(imageutils.Httpd) testPodLabels := map[string]string{"test-pod-static": "true"} testPodLabelsFlat := "test-pod-static=true"