From 3ba8f42f96b071d486a70497e037f72344a4a9e1 Mon Sep 17 00:00:00 2001 From: Caleb Woodbine Date: Thu, 16 Jan 2020 00:52:57 +0000 Subject: [PATCH] Update: podTemplateList name; Fix: initial fetching of PodTemplates --- test/e2e/common/podtemplates.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/e2e/common/podtemplates.go b/test/e2e/common/podtemplates.go index 755eda32332..7a347cc5d4f 100644 --- a/test/e2e/common/podtemplates.go +++ b/test/e2e/common/podtemplates.go @@ -36,7 +36,9 @@ var _ = ginkgo.Describe("[sig-architecture] PodTemplates", func() { podTemplateName := "nginx-pod-template-" + string(uuid.NewUUID()) // get a list of PodTemplates (in all namespaces to hit endpoint) - podTemplateList, err := f.ClientSet.CoreV1().PodTemplates("").List(metav1.ListOptions{}) + podTemplateList, err := f.ClientSet.CoreV1().PodTemplates("").List(metav1.ListOptions{ + LabelSelector: "podtemplate-static=true", + }) framework.ExpectNoError(err, "failed to list all PodTemplates") framework.ExpectEqual(len(podTemplateList.Items), 0, "unable to find templates") @@ -85,10 +87,10 @@ var _ = ginkgo.Describe("[sig-architecture] PodTemplates", func() { framework.ExpectNoError(err, "failed to delete PodTemplate") // list the PodTemplates - podTemplateListWithLabel, err := f.ClientSet.CoreV1().PodTemplates("").List(metav1.ListOptions{ + podTemplateList, err = f.ClientSet.CoreV1().PodTemplates("").List(metav1.ListOptions{ LabelSelector: "podtemplate-static=true", }) framework.ExpectNoError(err, "failed to list PodTemplate") - framework.ExpectEqual(len(podTemplateListWithLabel.Items), 0, "PodTemplate list returned items, failed to delete PodTemplate") + framework.ExpectEqual(len(podTemplateList.Items), 0, "PodTemplate list returned items, failed to delete PodTemplate") }) })