mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.
Remove these imports in preparation of migrating our code to become an
actual go module.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
20 lines
661 B
Go
20 lines
661 B
Go
package 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)
|
|
}
|