Skip to content

Commit bcd5cc9

Browse files
author
mingzhou.swx
committed
fix image list pull job e2e
Signed-off-by: mingzhou.swx <[email protected]>
1 parent 8bbac42 commit bcd5cc9

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

test/e2e/apps/imagelistpulljobs.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,20 @@ var _ = SIGDescribe("PullImages", func() {
194194
gomega.Expect(err).NotTo(gomega.HaveOccurred())
195195

196196
ginkgo.By("Check imagepulljob should be cleaned")
197+
time.Sleep(3 * time.Second)
197198
gomega.Eventually(func() bool {
198-
imagePullJobs, err := testerForImagePullJob.ListJobs(job.Namespace)
199+
imagePullJobLister, err := testerForImagePullJob.ListJobs(job.Namespace)
199200
gomega.Expect(err).NotTo(gomega.HaveOccurred())
200-
return len(imagePullJobs.Items) > 0
201-
}, 3*time.Second, time.Second).Should(gomega.Equal(false))
201+
var imagePullJobs []*appsv1alpha1.ImagePullJob
202+
for i := range imagePullJobLister.Items {
203+
pullJob := &imagePullJobLister.Items[i]
204+
if metav1.IsControlledBy(pullJob, job) {
205+
imagePullJobs = append(imagePullJobs, pullJob)
206+
}
207+
fmt.Printf("waiting imagePullJob GC: %v", imagePullJobs)
208+
}
209+
return len(imagePullJobs) == 0
210+
}, time.Minute, time.Second).Should(gomega.BeTrue())
202211
})
203212

204213
framework.ConformanceIt("create an always job to pull an image on all nodes", func() {

0 commit comments

Comments
 (0)