fix(deps): update module github.com/docker/cli to v28.4.0+incompatible (#781)

* fix(deps): update module github.com/docker/cli to v28.4.0+incompatible

* chore: Update deprecated types with new ones

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Martin Wentzel <nitram.wentzel@gmail.com>
This commit is contained in:
renovate[bot] 2025-10-01 17:32:01 +02:00 committed by GitHub
parent 27d88c700f
commit 2a6f384a6f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 36 additions and 42 deletions

6
go.mod
View file

@ -7,10 +7,11 @@ toolchain go1.24.6
require (
github.com/client9/misspell v0.3.4
github.com/containerd/console v1.0.5
github.com/containerd/errdefs v1.0.0
github.com/distribution/reference v0.6.0
github.com/docker/buildx v0.23.0
github.com/docker/cli v28.1.1+incompatible
github.com/docker/docker v28.1.1+incompatible
github.com/docker/cli v28.4.0+incompatible
github.com/docker/docker v28.4.0+incompatible
github.com/docker/go-connections v0.6.0
github.com/docker/go-units v0.5.0
github.com/golangci/golangci-lint v1.64.8
@ -95,7 +96,6 @@ require (
github.com/containerd/containerd/api v1.8.0 // indirect
github.com/containerd/containerd/v2 v2.0.5 // indirect
github.com/containerd/continuity v0.4.5 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/platforms v1.0.0-rc.1 // indirect

8
go.sum
View file

@ -197,12 +197,12 @@ github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxK
github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/docker/buildx v0.23.0 h1:qoYhuWyZ6PVCrWbkxClLzBWDBCUkyFK6Chjzg6nU+V8=
github.com/docker/buildx v0.23.0/go.mod h1:y/6Zf/y3Bf0zTWqgg8PuNFATcqnuhFmQuNf4VyrnPtg=
github.com/docker/cli v28.1.1+incompatible h1:eyUemzeI45DY7eDPuwUcmDyDj1pM98oD5MdSpiItp8k=
github.com/docker/cli v28.1.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v28.4.0+incompatible h1:RBcf3Kjw2pMtwui5V0DIMdyeab8glEw5QY0UUU4C9kY=
github.com/docker/cli v28.4.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v28.1.1+incompatible h1:49M11BFLsVO1gxY9UX9p/zwkE/rswggs8AdFmXQw51I=
github.com/docker/docker v28.1.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v28.4.0+incompatible h1:KVC7bz5zJY/4AZe/78BIvCnPsLaC9T/zh72xnlrTTOk=
github.com/docker/docker v28.4.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8=
github.com/docker/docker-credential-helpers v0.9.3/go.mod h1:x+4Gbw9aGmChi3qTLZj8Dfn0TD20M/fuWy0E5+WDeCo=
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=

View file

@ -33,7 +33,7 @@ import (
"github.com/docker/buildx/util/progress"
"github.com/docker/cli/cli/command"
dockeropts "github.com/docker/cli/opts"
"github.com/docker/docker/api/types"
dockerBuildTypes "github.com/docker/docker/api/types/build"
"github.com/docker/docker/api/types/versions"
dockerclient "github.com/docker/docker/client"
"github.com/hashicorp/terraform-plugin-log/tflog"
@ -391,7 +391,7 @@ func canUseBuildx(ctx context.Context, client *dockerclient.Client) (bool, error
si, _ := client.Ping(ctx)
if !useBuilder {
if si.BuilderVersion != types.BuilderBuildKit && si.OSType == "windows" {
if si.BuilderVersion != dockerBuildTypes.BuilderBuildKit && si.OSType == "windows" {
// The daemon didn't advertise BuildKit as the preferred builder,
// so use the legacy builder, which is still the default for
// Windows / WCOW.

View file

@ -14,13 +14,13 @@ import (
"path/filepath"
"strings"
"github.com/containerd/errdefs"
"github.com/docker/cli/cli/command/image/build"
"github.com/docker/docker/api/types"
dockerBuildTypes "github.com/docker/docker/api/types/build"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/registry"
"github.com/docker/docker/api/types/versions"
"github.com/docker/docker/client"
"github.com/docker/docker/errdefs"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
@ -399,7 +399,7 @@ func buildDockerImage(ctx context.Context, rawBuild map[string]interface{}, imag
}
buildOptions.Dockerfile = relDockerfile
var response types.ImageBuildResponse
var response dockerBuildTypes.ImageBuildResponse
response, err = client.ImageBuild(ctx, buildCtx, buildOptions)
if err != nil {
if buildKitSession != nil {
@ -432,7 +432,7 @@ const minBuildkitDockerVersion = "1.39"
func enableBuildKitIfSupported(
ctx context.Context,
client *client.Client,
buildOptions *types.ImageBuildOptions,
buildOptions *dockerBuildTypes.ImageBuildOptions,
) (*session.Session, chan struct{}) {
dockerClientVersion := client.ClientVersion()
log.Printf("[DEBUG] DockerClientVersion: %v, minBuildKitDockerVersion: %v\n", dockerClientVersion, minBuildkitDockerVersion)
@ -450,10 +450,10 @@ func enableBuildKitIfSupported(
close(done)
}()
buildOptions.SessionID = s.ID()
buildOptions.Version = types.BuilderBuildKit
buildOptions.Version = dockerBuildTypes.BuilderBuildKit
return s, done
} else {
buildOptions.Version = types.BuilderV1
buildOptions.Version = dockerBuildTypes.BuilderV1
return nil, nil
}
}
@ -522,7 +522,7 @@ func getBuildContext(filePath string, excludes []string) io.ReadCloser {
return ctx
}
func decodeBuildMessages(response types.ImageBuildResponse) (string, error) {
func decodeBuildMessages(response dockerBuildTypes.ImageBuildResponse) (string, error) {
buf := new(bytes.Buffer)
buildErr := error(nil)

View file

@ -12,7 +12,7 @@ import (
"testing"
"time"
"github.com/docker/docker/api/types"
dockerBuildTypes "github.com/docker/docker/api/types/build"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/registry"
@ -87,7 +87,7 @@ func TestAccDockerRegistryImageResource_mapping(t *testing.T) {
assert(options.Target == "fooTarget", "Target")
assert(options.SessionID == "fooSessionId", "SessionID")
assert(options.Platform == "fooPlatform", "Platform")
assert(options.Version == types.BuilderVersion("1"), "Version")
assert(options.Version == dockerBuildTypes.BuilderVersion("1"), "Version")
assert(options.BuildID == "fooBuildId", "BuildID")
// output
d.SetId("foo")

View file

@ -12,7 +12,7 @@ import (
"net/http"
"strings"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/build"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/registry"
@ -138,7 +138,7 @@ type internalPushImageOptions struct {
Tag string
}
func createImageBuildOptions(buildOptions map[string]interface{}) types.ImageBuildOptions {
func createImageBuildOptions(buildOptions map[string]interface{}) build.ImageBuildOptions {
mapOfInterfacesToMapOfStrings := func(mapOfInterfaces map[string]interface{}) map[string]string {
mapOfStrings := make(map[string]string, len(mapOfInterfaces))
for k, v := range mapOfInterfaces {
@ -188,7 +188,7 @@ func createImageBuildOptions(buildOptions map[string]interface{}) types.ImageBui
return authConfigs
}
buildImageOptions := types.ImageBuildOptions{}
buildImageOptions := build.ImageBuildOptions{}
buildImageOptions.SuppressOutput = buildOptions["suppress_output"].(bool)
buildImageOptions.RemoteContext = buildOptions["remote_context"].(string)
buildImageOptions.NoCache = buildOptions["no_cache"].(bool)
@ -218,7 +218,7 @@ func createImageBuildOptions(buildOptions map[string]interface{}) types.ImageBui
buildImageOptions.Target = buildOptions["target"].(string)
buildImageOptions.SessionID = buildOptions["session_id"].(string)
buildImageOptions.Platform = buildOptions["platform"].(string)
buildImageOptions.Version = types.BuilderVersion(buildOptions["version"].(string))
buildImageOptions.Version = build.BuilderVersion(buildOptions["version"].(string))
buildImageOptions.BuildID = buildOptions["build_id"].(string)
// outputs

View file

@ -9,7 +9,6 @@ import (
"strings"
"time"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/registry"
@ -38,7 +37,7 @@ func resourceDockerServiceCreate(ctx context.Context, d *schema.ResourceData, me
return diag.FromErr(err)
}
serviceOptions := types.ServiceCreateOptions{}
serviceOptions := swarm.ServiceCreateOptions{}
marshalledAuth := retrieveAndMarshalAuth(d, meta, "create")
serviceOptions.EncodedRegistryAuth = base64.URLEncoding.EncodeToString(marshalledAuth)
serviceOptions.QueryRegistry = true
@ -115,7 +114,7 @@ func resourceDockerServiceReadRefreshFunc(ctx context.Context,
d.SetId("")
return serviceID, "removed", nil
}
service, _, err := client.ServiceInspectWithRaw(ctx, apiService.ID, types.ServiceInspectOptions{})
service, _, err := client.ServiceInspectWithRaw(ctx, apiService.ID, swarm.ServiceInspectOptions{})
if err != nil {
return serviceID, "", fmt.Errorf("Error inspecting service %s: %s", apiService.ID, err)
}
@ -164,7 +163,7 @@ func resourceDockerServiceReadRefreshFunc(ctx context.Context,
func resourceDockerServiceUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
client := meta.(*ProviderConfig).DockerClient
service, _, err := client.ServiceInspectWithRaw(ctx, d.Id(), types.ServiceInspectOptions{})
service, _, err := client.ServiceInspectWithRaw(ctx, d.Id(), swarm.ServiceInspectOptions{})
if err != nil {
return diag.FromErr(err)
}
@ -174,7 +173,7 @@ func resourceDockerServiceUpdate(ctx context.Context, d *schema.ResourceData, me
return diag.FromErr(err)
}
updateOptions := types.ServiceUpdateOptions{}
updateOptions := swarm.ServiceUpdateOptions{}
marshalledAuth := retrieveAndMarshalAuth(d, meta, "update")
if err != nil {
return diag.Errorf("error creating auth config: %s", err)
@ -232,7 +231,7 @@ func resourceDockerServiceDelete(ctx context.Context, d *schema.ResourceData, me
// ///////////////
// fetchDockerService fetches a service by its name or id
func fetchDockerService(ctx context.Context, ID string, name string, client *client.Client) (*swarm.Service, error) {
apiServices, err := client.ServiceList(ctx, types.ServiceListOptions{})
apiServices, err := client.ServiceList(ctx, swarm.ServiceListOptions{})
if err != nil {
return nil, fmt.Errorf("Error fetching service information from Docker: %s", err)
}
@ -253,7 +252,7 @@ func deleteService(ctx context.Context, serviceID string, d *schema.ResourceData
if v, ok := d.GetOk("task_spec.0.container_spec.0.stop_grace_period"); ok && v.(string) != "0s" {
filters := filters.NewArgs()
filters.Add("service", d.Get("name").(string))
tasks, err := client.TaskList(ctx, types.TaskListOptions{
tasks, err := client.TaskList(ctx, swarm.TaskListOptions{
Filters: filters,
})
if err != nil {
@ -360,12 +359,12 @@ func resourceDockerServiceCreateRefreshFunc(ctx context.Context,
filters.Add("desired-state", "running")
getUpToDateTasks := func() ([]swarm.Task, error) {
return client.TaskList(ctx, types.TaskListOptions{
return client.TaskList(ctx, swarm.TaskListOptions{
Filters: filters,
})
}
service, _, err := client.ServiceInspectWithRaw(ctx, serviceID, types.ServiceInspectOptions{})
service, _, err := client.ServiceInspectWithRaw(ctx, serviceID, swarm.ServiceInspectOptions{})
if err != nil {
return nil, "", err
}
@ -414,12 +413,12 @@ func resourceDockerServiceUpdateRefreshFunc(ctx context.Context,
filters.Add("desired-state", "running")
getUpToDateTasks := func() ([]swarm.Task, error) {
return client.TaskList(ctx, types.TaskListOptions{
return client.TaskList(ctx, swarm.TaskListOptions{
Filters: filters,
})
}
service, _, err := client.ServiceInspectWithRaw(ctx, serviceID, types.ServiceInspectOptions{})
service, _, err := client.ServiceInspectWithRaw(ctx, serviceID, swarm.ServiceInspectOptions{})
if err != nil {
return nil, "", err
}
@ -470,7 +469,7 @@ func resourceDockerServiceUpdateRefreshFunc(ctx context.Context,
// getActiveNodes gets the actives nodes withon a swarm
func getActiveNodes(ctx context.Context, client *client.Client) (map[string]struct{}, error) {
nodes, err := client.NodeList(ctx, types.NodeListOptions{})
nodes, err := client.NodeList(ctx, swarm.NodeListOptions{})
if err != nil {
return nil, err
}

View file

@ -9,7 +9,6 @@ import (
"testing"
"time"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/mount"
@ -240,7 +239,6 @@ func TestDockerSecretFromRegistryAuth_basic(t *testing.T) {
foundAuthConfig := fromRegistryAuth("repo.my-company.com:8787/my_image", authConfigs)
checkAttribute(t, "Username", foundAuthConfig.Username, "myuser")
checkAttribute(t, "Password", foundAuthConfig.Password, "mypass")
checkAttribute(t, "Email", foundAuthConfig.Email, "")
checkAttribute(t, "ServerAddress", foundAuthConfig.ServerAddress, "https://repo.my-company.com:8787")
}
@ -268,19 +266,16 @@ func TestDockerSecretFromRegistryAuth_multiple(t *testing.T) {
foundAuthConfig := fromRegistryAuth("nexus.my-fancy-company.com/the_image", authConfigs)
checkAttribute(t, "Username", foundAuthConfig.Username, "myuser33")
checkAttribute(t, "Password", foundAuthConfig.Password, "mypass123")
checkAttribute(t, "Email", foundAuthConfig.Email, "test@example.com")
checkAttribute(t, "ServerAddress", foundAuthConfig.ServerAddress, "https://nexus.my-fancy-company.com")
foundAuthConfig = fromRegistryAuth("http-nexus.my-fancy-company.com/the_image", authConfigs)
checkAttribute(t, "Username", foundAuthConfig.Username, "myuser33")
checkAttribute(t, "Password", foundAuthConfig.Password, "mypass123")
checkAttribute(t, "Email", foundAuthConfig.Email, "test@example.com")
checkAttribute(t, "ServerAddress", foundAuthConfig.ServerAddress, "http://http-nexus.my-fancy-company.com")
foundAuthConfig = fromRegistryAuth("alpine:3.1", authConfigs)
checkAttribute(t, "Username", foundAuthConfig.Username, "")
checkAttribute(t, "Password", foundAuthConfig.Password, "")
checkAttribute(t, "Email", foundAuthConfig.Email, "")
checkAttribute(t, "ServerAddress", foundAuthConfig.ServerAddress, "")
}
@ -1360,7 +1355,7 @@ func isServiceRemoved(serviceName string) resource.TestCheckFunc {
client := testAccProvider.Meta().(*ProviderConfig).DockerClient
filters := filters.NewArgs()
filters.Add("name", serviceName)
services, err := client.ServiceList(ctx, types.ServiceListOptions{
services, err := client.ServiceList(ctx, swarm.ServiceListOptions{
Filters: filters,
})
if err != nil {
@ -1441,7 +1436,7 @@ func testAccServiceRunning(resourceName string, service *swarm.Service) resource
}
client := testAccProvider.Meta().(*ProviderConfig).DockerClient
inspectedService, _, err := client.ServiceInspectWithRaw(ctx, rs.Primary.ID, types.ServiceInspectOptions{})
inspectedService, _, err := client.ServiceInspectWithRaw(ctx, rs.Primary.ID, swarm.ServiceInspectOptions{})
if err != nil {
return fmt.Errorf("Service with ID '%s': %w", rs.Primary.ID, err)
}

View file

@ -9,9 +9,9 @@ import (
"strings"
"time"
"github.com/containerd/errdefs"
"github.com/docker/cli/opts"
"github.com/docker/docker/api/types/volume"
"github.com/docker/docker/errdefs"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"