mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
chore: update docker and compose Go dependencies to the latest versions
This commit is contained in:
@@ -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{
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package compose
|
||||
|
||||
// TODO: make compose, cli, and api packages public.
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user