Skip to content

Commit aa4bdee

Browse files
jlewisourishkrout
authored andcommitted
dockerexec: negotiate Docker API version (#1042)
CI appears to have started failing. https://github.com/runmedev/runme/actions/runs/21955632206/job/63477672958 Error is. ``` --- FAIL: TestDockerCommand (0.00s) command_docker_test.go:22: Error Trace: /home/runner/work/runme/runme/command/command_docker_test.go:22 Error: Received unexpected error: Error response from daemon: client version 1.43 is too old. Minimum supported API version is 1.44, please upgrade your client to a newer version github.com/runmedev/runme/v3/internal/dockerexec.(*Docker).pullImage /home/runner/work/runme/runme/internal/dockerexec/docker.go:101 github.com/runmedev/runme/v3/internal/dockerexec.(*Docker).buildOrPullImage /home/runner/work/runme/runme/internal/dockerexec/docker.go:90 github.com/runmedev/runme/v3/internal/dockerexec.New /home/runner/work/runme/runme/internal/dockerexec/docker.go:49 github.com/runmedev/runme/v3/command.TestDockerCommand /home/runner/work/runme/runme/command/command_docker_test.go:21 testing.tRunner /opt/hostedtoolcache/go/1.25.7/x64/src/testing/testing.go:1934 runtime.goexit /opt/hostedtoolcache/go/1.25.7/x64/src/runtime/asm_amd64.s:1693 Test: TestDockerCommand FAIL ``` Guessing the docker version used in our images got updated but our go code is pinning to a specific version. Signed-off-by: Jeremy lewi <jeremy@lewi.us>
1 parent 84eaf48 commit aa4bdee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/dockerexec/docker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ type Options struct {
2323
}
2424

2525
func New(opts *Options) (*Docker, error) {
26-
// Typically, the version is dicted by the Docker API version in the CI (GitHub Actions).
27-
c, err := client.NewClientWithOpts(client.FromEnv, client.WithVersion("1.43"))
26+
// Negotiate API version with the daemon to avoid hard-coded mismatches across environments.
27+
c, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
2828
if err != nil {
2929
return nil, err
3030
}

0 commit comments

Comments
 (0)