From 76e4ef47f6a8dc571e3bfc347fa22da31d4a304c Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 9 Jun 2021 14:02:19 +0200 Subject: [PATCH] e2e: use docker:dind image as default, as docker:stable-dind is EOL The stable-dind image was stuck on Docker 19.03. Updating to "dind" now gives us docker 20.10. Docker 20.10 fixed an issue with the "docker pull" response previously not including the image name of the image that was pulled. This caused the test to fail, as the .golden file no longer matched. Signed-off-by: Sebastiaan van Stijn --- .github/workflows/e2e.yml | 5 ++--- e2e/compose-env.yaml | 2 +- e2e/image/pull_test.go | 2 ++ e2e/image/testdata/pull-with-content-trust.golden | 2 +- internal/test/environment/testenv.go | 6 ++++++ 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 60f99c5690c6..ee2b6c8918a4 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -28,11 +28,10 @@ jobs: - alpine - debian engine-version: -# - 20.10-dind # FIXME: Fails on 20.10 - - stable-dind # TODO: Use 20.10-dind, stable-dind is deprecated + - 24.0-dind include: - target: non-experimental - engine-version: 19.03-dind + engine-version: 24.0-dind steps: - name: Checkout diff --git a/e2e/compose-env.yaml b/e2e/compose-env.yaml index 9eade791b02a..6385325d3839 100644 --- a/e2e/compose-env.yaml +++ b/e2e/compose-env.yaml @@ -3,7 +3,7 @@ services: image: 'registry:2' engine: - image: 'docker:${TEST_ENGINE_VERSION:-stable-dind}' + image: 'docker:${TEST_ENGINE_VERSION:-dind}' privileged: true command: ['--insecure-registry=registry:5000'] environment: diff --git a/e2e/image/pull_test.go b/e2e/image/pull_test.go index c739e7e5e410..5ac883ffe6e2 100644 --- a/e2e/image/pull_test.go +++ b/e2e/image/pull_test.go @@ -1,6 +1,7 @@ package image import ( + "strings" "testing" "github.com/docker/cli/e2e/internal/fixtures" @@ -16,6 +17,7 @@ const registryPrefix = "registry:5000" func TestPullWithContentTrust(t *testing.T) { skip.If(t, environment.RemoteDaemon()) + skip.If(t, strings.HasPrefix(environment.DaemonVersion(), "19.03"), "skipping on 19.03 daemon, as output format differs") // Digests in golden files are linux/amd64 specific. // TODO: Fix this test and make it work on all platforms. diff --git a/e2e/image/testdata/pull-with-content-trust.golden b/e2e/image/testdata/pull-with-content-trust.golden index b21407e1172c..582a4e0cc9c8 100644 --- a/e2e/image/testdata/pull-with-content-trust.golden +++ b/e2e/image/testdata/pull-with-content-trust.golden @@ -1,5 +1,5 @@ Pull (1 of 1): registry:5000/trust-pull:latest@sha256:e2e16842c9b54d985bf1ef9242a313f36b856181f188de21313820e177002501 -sha256:e2e16842c9b54d985bf1ef9242a313f36b856181f188de21313820e177002501: Pulling from trust-pull +registry:5000/trust-pull@sha256:e2e16842c9b54d985bf1ef9242a313f36b856181f188de21313820e177002501: Pulling from trust-pull Digest: sha256:e2e16842c9b54d985bf1ef9242a313f36b856181f188de21313820e177002501 Status: Downloaded newer image for registry:5000/trust-pull@sha256:e2e16842c9b54d985bf1ef9242a313f36b856181f188de21313820e177002501 registry:5000/trust-pull:latest diff --git a/internal/test/environment/testenv.go b/internal/test/environment/testenv.go index 8b035fca1b8a..cc3506efb937 100644 --- a/internal/test/environment/testenv.go +++ b/internal/test/environment/testenv.go @@ -71,6 +71,12 @@ func boolFromString(val string) bool { // DefaultPollSettings used with gotestyourself/poll var DefaultPollSettings = poll.WithDelay(100 * time.Millisecond) +// DaemonVersion returns the version of the daemon +func DaemonVersion() string { + result := icmd.RunCmd(icmd.Command("docker", "info", "--format", "{{.ServerVersion}}")) + return strings.TrimSpace(result.Stdout()) +} + // SkipIfNotExperimentalDaemon returns whether the test docker daemon is in experimental mode func SkipIfNotExperimentalDaemon(t *testing.T) { t.Helper()