Skip to content

Commit

Permalink
Use k8s.gcr.io/pause:3.4.1 in pull-only tests
Browse files Browse the repository at this point in the history
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 <Paul.Hampson@Pobox.com>
  • Loading branch information
TBBle committed Mar 13, 2021
1 parent bcc0200 commit b375f90
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
6 changes: 4 additions & 2 deletions integration/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func TestImagePullAllPlatforms(t *testing.T) {
defer cancel()

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

img, err := client.Fetch(ctx, "k8s.gcr.io/pause:3.4.1", opts...)
// Note: Must be different to the image used in TestImagePullAllPlatforms
// or it will see the content pulled by that, and fail.
img, err := client.Fetch(ctx, "k8s.gcr.io/pause:3.2", opts...)
if err != nil {
t.Fatal(err)
}
Expand Down
12 changes: 6 additions & 6 deletions integration/client/image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestImageIsUnpacked(t *testing.T) {
t.Skip()
}

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

Expand Down Expand Up @@ -86,9 +86,9 @@ func TestImagePullWithDistSourceLabel(t *testing.T) {
t.Skip()
}
var (
source = "docker.io"
repoName = "library/busybox"
tag = "latest"
source = "k8s.gcr.io"
repoName = "pause"
tag = "3.4.1"
)

ctx, cancel := testContext(t)
Expand Down Expand Up @@ -144,7 +144,7 @@ func TestImageUsage(t *testing.T) {
t.Skip()
}

imageName := "docker.io/library/busybox:latest"
imageName := "k8s.gcr.io/pause:3.4.1"
ctx, cancel := testContext(t)
defer cancel()

Expand Down Expand Up @@ -241,7 +241,7 @@ func TestImageUsage(t *testing.T) {
func TestImageSupportedBySnapshotter_Error(t *testing.T) {
var unsupportedImage string
if runtime.GOOS == "windows" {
unsupportedImage = "docker.io/library/busybox:latest"
unsupportedImage = "k8s.gcr.io/pause-amd64:3.2"
} else {
unsupportedImage = "mcr.microsoft.com/windows/nanoserver:1809"
}
Expand Down
2 changes: 1 addition & 1 deletion integration/client/lease_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestLeaseResources(t *testing.T) {
defer ls.Delete(ctx, l, leases.SynchronousDelete)

// step 1: download image
imageName := "docker.io/library/busybox:1.25"
imageName := "k8s.gcr.io/pause:3.4.1"

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

0 comments on commit b375f90

Please sign in to comment.