Files
moby/libcontainerd/libcontainerd_windows.go
Sebastiaan van Stijn 12f89cc19b libcontainerd/local: NewClient: remove unused cli, stateDir, ns args
The "local" client does not use containerd, but implements the same interface,
many args are not used though, so remove these to make it more clear what's
actually in use.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-26 19:00:20 +01:00

20 lines
712 B
Go

package libcontainerd // import "github.com/docker/docker/libcontainerd"
import (
"context"
containerd "github.com/containerd/containerd/v2/client"
"github.com/docker/docker/libcontainerd/local"
"github.com/docker/docker/libcontainerd/remote"
libcontainerdtypes "github.com/docker/docker/libcontainerd/types"
"github.com/docker/docker/pkg/system"
)
// NewClient creates a new libcontainerd client from a containerd client
func NewClient(ctx context.Context, cli *containerd.Client, stateDir, ns string, b libcontainerdtypes.Backend) (libcontainerdtypes.Client, error) {
if !system.ContainerdRuntimeSupported() {
return local.NewClient(ctx, b)
}
return remote.NewClient(ctx, cli, stateDir, ns, b)
}