Skip to content

Commit 899b2fa

Browse files
author
Michal Minář
committed
Extended test for registry garbage collector
Signed-off-by: Michal Minář <[email protected]>
1 parent 551b37b commit 899b2fa

File tree

8 files changed

+1009
-195
lines changed

8 files changed

+1009
-195
lines changed

test/extended/imageapis/limitrange_admission.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ func buildAndPushTestImagesTo(oc *exutil.CLI, isName string, tagPrefix string, n
235235

236236
for i := 1; i <= numberOfImages; i++ {
237237
tag := fmt.Sprintf("%s%d", tagPrefix, i)
238-
dgst, err := imagesutil.BuildAndPushImageOfSizeWithDocker(oc, dClient, isName, tag, imageSize, 2, g.GinkgoWriter, true)
238+
dgst, _, err := imagesutil.BuildAndPushImageOfSizeWithDocker(oc, dClient, isName, tag, imageSize, 2, g.GinkgoWriter, true, true)
239239
if err != nil {
240240
return nil, err
241241
}

test/extended/imageapis/quota_admission.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -60,40 +60,40 @@ var _ = g.Describe("[Feature:ImageQuota] Image resource quota", func() {
6060
o.Expect(err).NotTo(o.HaveOccurred())
6161

6262
g.By(fmt.Sprintf("trying to push image exceeding quota %v", quota))
63-
_, err = imagesutil.BuildAndPushImageOfSizeWithDocker(oc, dClient, "first", "refused", imageSize, 1, outSink, false)
63+
_, _, err = imagesutil.BuildAndPushImageOfSizeWithDocker(oc, dClient, "first", "refused", imageSize, 1, outSink, false, true)
6464
o.Expect(err).NotTo(o.HaveOccurred())
6565

6666
quota, err = bumpQuota(oc, imageapi.ResourceImageStreams, 1)
6767
o.Expect(err).NotTo(o.HaveOccurred())
6868

6969
g.By(fmt.Sprintf("trying to push image below quota %v", quota))
70-
_, err = imagesutil.BuildAndPushImageOfSizeWithDocker(oc, dClient, "first", "tag1", imageSize, 1, outSink, true)
70+
_, _, err = imagesutil.BuildAndPushImageOfSizeWithDocker(oc, dClient, "first", "tag1", imageSize, 1, outSink, true, true)
7171
o.Expect(err).NotTo(o.HaveOccurred())
7272
used, err := waitForResourceQuotaSync(oc, quotaName, quota)
7373
o.Expect(err).NotTo(o.HaveOccurred())
7474
o.Expect(assertQuotasEqual(used, quota)).NotTo(o.HaveOccurred())
7575

7676
g.By(fmt.Sprintf("trying to push image to existing image stream %v", quota))
77-
_, err = imagesutil.BuildAndPushImageOfSizeWithDocker(oc, dClient, "first", "tag2", imageSize, 1, outSink, true)
77+
_, _, err = imagesutil.BuildAndPushImageOfSizeWithDocker(oc, dClient, "first", "tag2", imageSize, 1, outSink, true, true)
7878
o.Expect(err).NotTo(o.HaveOccurred())
7979

8080
g.By(fmt.Sprintf("trying to push image exceeding quota %v", quota))
81-
_, err = imagesutil.BuildAndPushImageOfSizeWithDocker(oc, dClient, "second", "refused", imageSize, 1, outSink, false)
81+
_, _, err = imagesutil.BuildAndPushImageOfSizeWithDocker(oc, dClient, "second", "refused", imageSize, 1, outSink, false, true)
8282

8383
quota, err = bumpQuota(oc, imageapi.ResourceImageStreams, 2)
8484
o.Expect(err).NotTo(o.HaveOccurred())
8585
used, err = waitForResourceQuotaSync(oc, quotaName, used)
8686
o.Expect(err).NotTo(o.HaveOccurred())
8787

8888
g.By(fmt.Sprintf("trying to push image below quota %v", quota))
89-
_, err = imagesutil.BuildAndPushImageOfSizeWithDocker(oc, dClient, "second", "tag1", imageSize, 1, outSink, true)
89+
_, _, err = imagesutil.BuildAndPushImageOfSizeWithDocker(oc, dClient, "second", "tag1", imageSize, 1, outSink, true, true)
9090
o.Expect(err).NotTo(o.HaveOccurred())
9191
used, err = waitForResourceQuotaSync(oc, quotaName, quota)
9292
o.Expect(err).NotTo(o.HaveOccurred())
9393
o.Expect(assertQuotasEqual(used, quota)).NotTo(o.HaveOccurred())
9494

9595
g.By(fmt.Sprintf("trying to push image exceeding quota %v", quota))
96-
_, err = imagesutil.BuildAndPushImageOfSizeWithDocker(oc, dClient, "third", "refused", imageSize, 1, outSink, false)
96+
_, _, err = imagesutil.BuildAndPushImageOfSizeWithDocker(oc, dClient, "third", "refused", imageSize, 1, outSink, false, true)
9797
o.Expect(err).NotTo(o.HaveOccurred())
9898

9999
g.By("deleting first image stream")
@@ -110,7 +110,7 @@ var _ = g.Describe("[Feature:ImageQuota] Image resource quota", func() {
110110
o.Expect(assertQuotasEqual(used, kapi.ResourceList{imageapi.ResourceImageStreams: resource.MustParse("1")})).NotTo(o.HaveOccurred())
111111

112112
g.By(fmt.Sprintf("trying to push image below quota %v", quota))
113-
_, err = imagesutil.BuildAndPushImageOfSizeWithDocker(oc, dClient, "third", "tag", imageSize, 1, outSink, true)
113+
_, _, err = imagesutil.BuildAndPushImageOfSizeWithDocker(oc, dClient, "third", "tag", imageSize, 1, outSink, true, true)
114114
o.Expect(err).NotTo(o.HaveOccurred())
115115
used, err = waitForResourceQuotaSync(oc, quotaName, quota)
116116
o.Expect(err).NotTo(o.HaveOccurred())

0 commit comments

Comments
 (0)