26 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
7e78088f8f daemon: remove workaround for c8d client connection timeout
This workaround was added in df519e9e1a, pending
a fix in containerd;

> daemon: Fix giving up too early while connecting to containerd socket
>
> Explicitly set the gRPC connection params to take the timeout into
> account to workaround the containerd v2 client not passing down the
> stack.
>
> containerd v2 replaced usages of deprecated gRPC functions but didn't
> pass the timeout to the actual dial connection options.

A fix for this was merged in [containerd@ee574e7], which is part of containerd
v2.1.0-beta.0, and backported to containerd v2.0.4 through [containerd@6b5efba].

[containerd@ee574e7]: ee574e76e7
[containerd@6b5efba]: 6b5efba83b

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-11 17:55:44 +01:00
David Warnquist
3848b16bca Removed all occurrences of wrapError in libcontainerd/remote
Signed-off-by: David Warnquist <voffffla@gmail.com>
2025-10-12 18:22:45 +02:00
Sebastiaan van Stijn
37d6a1909b libcontainerd/remote: wrapError: don't convert c8d errdefs error
The moby codebase is now able to handle containerd errdefs errors directly
so there's no need to wrap a c8d "NotFound" error. We still need to look
if we can remove this function altogether; it's unclear what conditions
could result in the string-matching being needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-03 12:31:57 +02:00
Sebastiaan van Stijn
36303969b9 libcontainerd/remote: container.NewTask: move vars to where used
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-03 12:31:53 +02:00
Sebastiaan van Stijn
fbad7b568d libcontainerd/remote: task.Exec: log warning on cleanup failure
Not exactly sure what errors we can expect here if the process failed
to start, but logging as a warning instead of discarding won't do harm.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-03 11:00:11 +02:00
Sebastiaan van Stijn
e67b3b0b90 libcontainerd/remote: task.Exec: rename processID -> execID
This argument is set from ExecConfig.ID, which we refer to as "execID"
in most places; rename the argument to match that terminology.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-03 10:58:33 +02:00
Sebastiaan van Stijn
003e17ff5a libcontainerd/remote: task.Exec: preserve parent context during cleanup
Use `context.WithoutCancel()` to preserve the parent context during cleanup
instead of creating a new context. This still prevents context-cancellation
from terminating the cleanup, but makes sure that tracing and logging are
wired up; https://github.com/containerd/containerd/blob/v2.1.4/client/process.go#L232-L263

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-03 10:58:17 +02:00
Sebastiaan van Stijn
167b0e9ea6 libcontainerd/remote: task.Exec: make defer error-handling more explicit
Use a named output variable to more clearly indicate what error is being
checked, and scope `err` variables used in this function.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-03 10:15:37 +02:00
Sebastiaan van Stijn
55c929c97f libcontainerd/remote: rename var that shadowed import
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-03 09:58:48 +02:00
Marat Radchenko
0ded8645b6 Fix custom runtimes handling on Windows
This commit partially reverts 7ccf750daa and 84965c0752

Closes #50542

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
2025-08-08 21:41:17 +02:00
Rob Murray
4b97831992 Merge pull request #50671 from mmorel-35/github.com/hashicorp/go-multierror
chore: use errors.Join instead of github.com/hashicorp/go-multierror
2025-08-08 19:40:36 +01:00
Matthieu MOREL
050fbbccca chore: use errors.Join instead of github.com/hashicorp/go-multierror
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-08-08 19:19:21 +02:00
Sebastiaan van Stijn
90eef3f0c9 Merge pull request #50672 from mmorel-35/revive-use-any
chore: enable use-any rule from revive
2025-08-08 18:00:49 +02:00
Matthieu MOREL
96f8c6395e chore: enable use-any rule from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-08-08 17:07:07 +02:00
Sebastiaan van Stijn
3862a0875c check for net.ErrClosed instead of "use of closed network connection"
The infamous "use of closed network connection" error was added in
[cl-5649076] as a non-exported error. This made it not possible to
write code to handle it as a sentinel error, other than through string-
matching.

Commit [moby@cc851db] (docker v0.6.4) added a [`IsClosedError`] utility
for this (as [net.errClosing@go1.1.2] did not yet export this error).
The `IsClosedError` was later moved to the `go-connections` module, but
various other places in our code used similar matching.

There was a feature-request [go-4373] to export it, which
got accepted and implemented in [CL 5649076], so starting with go1.16
we now have [net.ErrClosed@go1.16], so can remove the string matching.

[CL 5649076]: https://golang.org/cl/5649076
[moby@cc851db]: cc851dbb3f
[`IsClosedError`]: cc851dbb3f/utils/utils.go (L1032-L1040)
[net.errClosing@go1.1.2]: https://github.com/golang/go/blob/go1.1.2/src/pkg/net/net.go#L341
[go-4373]: https://github.com/golang/go/issues/4373
[net.ErrClosed@go1.16]: https://github.com/golang/go/blob/go1.16/src/net/net.go#L636-L645

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-08 09:58:06 +02:00
Derek McGowan
f74e5d48b3 Create github.com/moby/moby/v2 module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-31 10:13:29 -07:00
Paweł Gronowski
33f1ac3c83 Merge pull request #50398 from thaJeztah/less_pkg_system
pkg/system: remove EnableContainerdRuntime, ContainerdRuntimeSupported
2025-07-14 13:24:21 +02:00
Sebastiaan van Stijn
63bada41e5 pkg/system: deprecate EscapeArgs and move internal
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-12 19:49:22 +02:00
Sebastiaan van Stijn
0fc1493654 pkg/system: remove EnableContainerdRuntime, ContainerdRuntimeSupported
These functions were used internally to keep track of whether containerd
was enabled as runtime on Windows; move it to libcontainerd.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-12 19:16:30 +02:00
Derek McGowan
90f9ce14f1 Move libcontainerd to daemon/internal/libcontainerd
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:29:12 -07:00
Derek McGowan
3ee8c1e3a9 Move libcontainerd/types to daemon/internal/libcontainerd/types
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:28:56 -07:00
Derek McGowan
841a369b8f Move libcontainerd/supervisor to daemon/internal/libcontainerd/supervisor
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:28:40 -07:00
Derek McGowan
fe959261d3 Move libcontainerd/shimopts to daemon/internal/libcontainerd/shimopts
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:28:24 -07:00
Derek McGowan
4e8bd050bf Move libcontainerd/remote to daemon/internal/libcontainerd/remote
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:28:08 -07:00
Derek McGowan
dd1656e6bc Move libcontainerd/queue to daemon/internal/libcontainerd/queue
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:27:52 -07:00
Derek McGowan
6835f367e5 Move libcontainerd/local to daemon/internal/libcontainerd/local
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-06-27 14:27:36 -07:00