Skip to content

Commit

Permalink
[release-5.29] backport Docker Daemon fix #2260
Browse files Browse the repository at this point in the history
Backport the fix from main for #2260 to allow
for the lastest Docker Daemons to work with c/image.

Signed-off-by: tomsweeneyredhat <[email protected]>
  • Loading branch information
TomSweeneyRedHat committed Jan 30, 2024
1 parent 2f0d9ae commit 6cbd4f4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 1 addition & 6 deletions docker/daemon/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ import (
"github.com/docker/go-connections/tlsconfig"
)

const (
// The default API version to be used in case none is explicitly specified
defaultAPIVersion = "1.22"
)

// NewDockerClient initializes a new API client based on the passed SystemContext.
func newDockerClient(sys *types.SystemContext) (*dockerclient.Client, error) {
host := dockerclient.DefaultDockerHost
Expand All @@ -23,7 +18,7 @@ func newDockerClient(sys *types.SystemContext) (*dockerclient.Client, error) {

opts := []dockerclient.Opt{
dockerclient.WithHost(host),
dockerclient.WithVersion(defaultAPIVersion),
dockerclient.WithAPIVersionNegotiation(),
}

// We conditionalize building the TLS configuration only to TLS sockets:
Expand Down
2 changes: 0 additions & 2 deletions docker/daemon/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ func TestDockerClientFromNilSystemContext(t *testing.T) {
assert.NotNil(t, client, "A Docker client reference should have been returned")

assert.Equal(t, dockerclient.DefaultDockerHost, client.DaemonHost(), "The default docker host should have been used")
assert.Equal(t, defaultAPIVersion, client.ClientVersion(), "The default api version should have been used")

assert.NoError(t, client.Close())
}
Expand All @@ -39,7 +38,6 @@ func TestDockerClientFromCertContext(t *testing.T) {
assert.NotNil(t, client, "A Docker client reference should have been returned")

assert.Equal(t, host, client.DaemonHost())
assert.Equal(t, "1.22", client.ClientVersion())

assert.NoError(t, client.Close())
}
Expand Down

0 comments on commit 6cbd4f4

Please sign in to comment.