Skip to content

Commit

Permalink
e2e: use docker:dind image as default, as docker:stable-dind is EOL
Browse files Browse the repository at this point in the history
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@gone.nl>
  • Loading branch information
thaJeztah committed Jan 7, 2023
1 parent d32f048 commit f99705a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ jobs:
- alpine
- bullseye
engine-version:
# - 20.10-dind # FIXME: Fails on 20.10
- stable-dind # TODO: Use 20.10-dind, stable-dind is deprecated
- 20.10-dind
include:
- target: non-experimental
engine-version: 19.03-dind
Expand Down
2 changes: 1 addition & 1 deletion e2e/compose-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,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:
Expand Down
2 changes: 2 additions & 0 deletions e2e/image/pull_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package image

import (
"strings"
"testing"

"github.com/docker/cli/e2e/internal/fixtures"
Expand All @@ -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")

dir := fixtures.SetupConfigFile(t)
defer dir.Remove()
Expand Down
2 changes: 1 addition & 1 deletion e2e/image/testdata/pull-with-content-trust.golden
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Pull (1 of 1): registry:5000/trust-pull:latest@sha256:641b95ddb2ea9dc2af1a0113b6b348ebc20872ba615204fbe12148e98fd6f23d
sha256:641b95ddb2ea9dc2af1a0113b6b348ebc20872ba615204fbe12148e98fd6f23d: Pulling from trust-pull
registry:5000/trust-pull@sha256:641b95ddb2ea9dc2af1a0113b6b348ebc20872ba615204fbe12148e98fd6f23d: Pulling from trust-pull
Digest: sha256:641b95ddb2ea9dc2af1a0113b6b348ebc20872ba615204fbe12148e98fd6f23d
Status: Downloaded newer image for registry:5000/trust-pull@sha256:641b95ddb2ea9dc2af1a0113b6b348ebc20872ba615204fbe12148e98fd6f23d
registry:5000/trust-pull:latest
6 changes: 6 additions & 0 deletions internal/test/environment/testenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit f99705a

Please sign in to comment.