Skip to content

Commit b375f90

Browse files
committed
Use k8s.gcr.io/pause:3.4.1 in pull-only tests
This reduces the need to pull random images from docker.io, and should greatly reduce the tendancy to hit their hourly rate-limit during integration test runs. TestImagePullSomePlatforms uses k8s.gcr.io/pause:3.2 so that it does not see the content pulled by TestImagePullAllPlatforms. This image is multi-arch, but not multi-os. Signed-off-by: Paul "TBBle" Hampson <[email protected]>
1 parent bcc0200 commit b375f90

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

integration/client/client_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ func TestImagePullAllPlatforms(t *testing.T) {
310310
defer cancel()
311311

312312
cs := client.ContentStore()
313-
img, err := client.Fetch(ctx, "docker.io/library/busybox:latest")
313+
img, err := client.Fetch(ctx, "k8s.gcr.io/pause:3.4.1")
314314
if err != nil {
315315
t.Fatal(err)
316316
}
@@ -358,7 +358,9 @@ func TestImagePullSomePlatforms(t *testing.T) {
358358
opts = append(opts, WithPlatform(platform))
359359
}
360360

361-
img, err := client.Fetch(ctx, "k8s.gcr.io/pause:3.4.1", opts...)
361+
// Note: Must be different to the image used in TestImagePullAllPlatforms
362+
// or it will see the content pulled by that, and fail.
363+
img, err := client.Fetch(ctx, "k8s.gcr.io/pause:3.2", opts...)
362364
if err != nil {
363365
t.Fatal(err)
364366
}

integration/client/image_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func TestImageIsUnpacked(t *testing.T) {
3535
t.Skip()
3636
}
3737

38-
const imageName = "docker.io/library/busybox:latest"
38+
const imageName = "k8s.gcr.io/pause:3.4.1"
3939
ctx, cancel := testContext(t)
4040
defer cancel()
4141

@@ -86,9 +86,9 @@ func TestImagePullWithDistSourceLabel(t *testing.T) {
8686
t.Skip()
8787
}
8888
var (
89-
source = "docker.io"
90-
repoName = "library/busybox"
91-
tag = "latest"
89+
source = "k8s.gcr.io"
90+
repoName = "pause"
91+
tag = "3.4.1"
9292
)
9393

9494
ctx, cancel := testContext(t)
@@ -144,7 +144,7 @@ func TestImageUsage(t *testing.T) {
144144
t.Skip()
145145
}
146146

147-
imageName := "docker.io/library/busybox:latest"
147+
imageName := "k8s.gcr.io/pause:3.4.1"
148148
ctx, cancel := testContext(t)
149149
defer cancel()
150150

@@ -241,7 +241,7 @@ func TestImageUsage(t *testing.T) {
241241
func TestImageSupportedBySnapshotter_Error(t *testing.T) {
242242
var unsupportedImage string
243243
if runtime.GOOS == "windows" {
244-
unsupportedImage = "docker.io/library/busybox:latest"
244+
unsupportedImage = "k8s.gcr.io/pause-amd64:3.2"
245245
} else {
246246
unsupportedImage = "mcr.microsoft.com/windows/nanoserver:1809"
247247
}

integration/client/lease_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func TestLeaseResources(t *testing.T) {
5555
defer ls.Delete(ctx, l, leases.SynchronousDelete)
5656

5757
// step 1: download image
58-
imageName := "docker.io/library/busybox:1.25"
58+
imageName := "k8s.gcr.io/pause:3.4.1"
5959

6060
image, err := client.Pull(ctx, imageName, WithPullUnpack, WithPullSnapshotter("native"))
6161
if err != nil {

0 commit comments

Comments
 (0)