chore: update docker and compose Go dependencies to the latest versions

This commit is contained in:
Pasha Sviderski
2025-10-08 13:56:58 +10:00
parent a2c6cbe633
commit a30ed600b6
25 changed files with 338 additions and 433 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ func TestConfigSpecsFromCompose(t *testing.T) {
{
Source: "nginx-config",
Target: "/etc/nginx/nginx.conf",
Mode: func() *uint32 { m := uint32(0o644); return &m }(),
Mode: func() *types.FileMode { m := types.FileMode(0o644); return &m }(),
},
},
expectedSpecs: []api.ConfigSpec{
-2
View File
@@ -1,7 +1,5 @@
package compose
// TODO: make compose, cli, and api packages public.
import (
"context"
"fmt"
+1 -1
View File
@@ -68,7 +68,7 @@ func ServiceSpecFromCompose(project *types.Project, serviceName string) (api.Ser
}
if machines, ok := service.Extensions[MachinesExtensionKey].(MachinesSource); ok {
spec.Placement.Machines = []string(machines)
spec.Placement.Machines = machines
}
// Map LogDriver if specified
+2 -2
View File
@@ -6,9 +6,9 @@ import (
"fmt"
"strings"
"github.com/containerd/errdefs"
"github.com/docker/compose/v2/pkg/progress"
"github.com/docker/docker/api/types/container"
dockerclient "github.com/docker/docker/client"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/psviderski/uncloud/internal/docker"
machinedocker "github.com/psviderski/uncloud/internal/machine/docker"
@@ -64,7 +64,7 @@ func (cli *Client) CreateContainer(
}
// NotFound (No such image) error is expected if the image is missing.
if !dockerclient.IsErrNotFound(err) || !strings.Contains(err.Error(), "No such image") {
if !errdefs.IsNotFound(err) || !strings.Contains(err.Error(), "No such image") {
return resp, err
}
+4 -3
View File
@@ -12,6 +12,7 @@ import (
"time"
"github.com/charmbracelet/lipgloss"
"github.com/containerd/errdefs"
"github.com/docker/compose/v2/pkg/progress"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
@@ -32,7 +33,7 @@ import (
func (cli *Client) InspectImage(ctx context.Context, id string) ([]api.MachineImage, error) {
images, err := cli.Docker.InspectImage(ctx, id)
if dockerclient.IsErrNotFound(err) {
if errdefs.IsNotFound(err) {
err = api.ErrNotFound
}
@@ -123,8 +124,8 @@ func (cli *Client) PushImage(ctx context.Context, image string, opts PushImageOp
defer dockerCli.Close()
// Check if Docker image exists locally.
if _, _, err = dockerCli.ImageInspectWithRaw(ctx, image); err != nil {
if dockerclient.IsErrNotFound(err) {
if _, err = dockerCli.ImageInspect(ctx, image); err != nil {
if errdefs.IsNotFound(err) {
return fmt.Errorf("image '%s' not found locally", image)
}
return fmt.Errorf("inspect image '%s' locally: %w", image, err)
+2 -2
View File
@@ -4,9 +4,9 @@ import (
"context"
"fmt"
"github.com/containerd/errdefs"
"github.com/docker/compose/v2/pkg/progress"
"github.com/docker/docker/api/types/volume"
dockerclient "github.com/docker/docker/client"
"github.com/psviderski/uncloud/internal/machine/api/pb"
"github.com/psviderski/uncloud/pkg/api"
)
@@ -123,7 +123,7 @@ func (cli *Client) RemoveVolume(ctx context.Context, machineNameOrID, volumeName
pw.Event(progress.RemovingEvent(eventID))
if err = cli.Docker.RemoveVolume(ctx, volumeName, force); err != nil {
if dockerclient.IsErrNotFound(err) {
if errdefs.IsNotFound(err) {
return api.ErrNotFound
}
return err