Skip to content

Commit

Permalink
Update to containerd v2
Browse files Browse the repository at this point in the history
Signed-off-by: apostasie <[email protected]>
  • Loading branch information
apostasie committed Jul 25, 2024
1 parent bec95c4 commit 3a6f5f7
Show file tree
Hide file tree
Showing 182 changed files with 1,451 additions and 400 deletions.
2 changes: 1 addition & 1 deletion cmd/nerdctl/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"time"

"github.com/containerd/containerd"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/labels"
"github.com/containerd/nerdctl/v2/pkg/netutil"
Expand Down
6 changes: 3 additions & 3 deletions cmd/nerdctl/compose_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"strings"
"text/tabwriter"

"github.com/containerd/containerd"
"github.com/containerd/containerd/pkg/progress"
"github.com/containerd/containerd/snapshots"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/snapshots"
"github.com/containerd/containerd/v2/pkg/progress"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
"github.com/containerd/nerdctl/v2/pkg/formatter"
Expand Down
4 changes: 2 additions & 2 deletions cmd/nerdctl/compose_ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"text/tabwriter"
"time"

"github.com/containerd/containerd"
"github.com/containerd/containerd/runtime/restart"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/runtime/restart"
"github.com/containerd/errdefs"
gocni "github.com/containerd/go-cni"
"github.com/containerd/log"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/compose_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"fmt"
"os"

"github.com/containerd/containerd"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/errdefs"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/compose_top.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package main
import (
"fmt"

"github.com/containerd/containerd"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/compose"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/container_attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package main

import (
"github.com/containerd/containerd"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/container"
Expand Down
6 changes: 3 additions & 3 deletions cmd/nerdctl/container_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (
"path/filepath"
"time"

"github.com/containerd/containerd"
"github.com/containerd/containerd/leases"
"github.com/containerd/containerd/mount"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/leases"
"github.com/containerd/containerd/v2/core/mount"
"github.com/containerd/continuity/fs"
"github.com/containerd/log"
"github.com/containerd/nerdctl/v2/pkg/api/types"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/container_exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package main
import (
"errors"

"github.com/containerd/containerd"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/container"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/container_kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package main

import (
"github.com/containerd/containerd"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/container"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/container_pause.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package main

import (
"github.com/containerd/containerd"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/container"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/container_run_cgroup_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"testing"

"github.com/containerd/cgroups/v3"
"github.com/containerd/containerd/pkg/userns"
"github.com/containerd/containerd/v2/pkg/userns"
"github.com/containerd/continuity/testutil/loopback"
"github.com/containerd/nerdctl/v2/pkg/cmd/container"
"github.com/containerd/nerdctl/v2/pkg/testutil"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/container_run_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package main
import (
"strings"

"github.com/containerd/containerd/pkg/cap"
"github.com/containerd/containerd/v2/pkg/cap"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/container_run_mount_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"strings"
"testing"

"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/v2/core/mount"
"github.com/containerd/nerdctl/v2/pkg/rootlessutil"
"github.com/containerd/nerdctl/v2/pkg/testutil"
mobymount "github.com/moby/sys/mount"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/container_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ RUN echo '\
"path/filepath" \n\
"sync" \n\
\n\
"github.com/containerd/containerd/runtime/v2/logging"\n\
"github.com/containerd/containerd/v2/core/runtime/v2/logging"\n\
)\n\
func main() {\n\
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/container_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package main

import (
"github.com/containerd/containerd"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/container"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/container_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package main

import (
"github.com/containerd/containerd"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/container"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/container_stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package main
import (
"time"

"github.com/containerd/containerd"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/container"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/container_top.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"errors"
"fmt"

"github.com/containerd/containerd"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/container"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/container_unpause.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package main

import (
"github.com/containerd/containerd"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/container"
Expand Down
4 changes: 2 additions & 2 deletions cmd/nerdctl/container_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"fmt"
"runtime"

"github.com/containerd/containerd"
"github.com/containerd/containerd/containers"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/containers"
"github.com/containerd/errdefs"
"github.com/containerd/log"
"github.com/containerd/nerdctl/v2/pkg/api/types"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/container_wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package main

import (
"github.com/containerd/containerd"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/container"
Expand Down
4 changes: 2 additions & 2 deletions cmd/nerdctl/image_encrypt_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"path/filepath"
"testing"

"github.com/containerd/containerd"
"github.com/containerd/containerd/content"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/content"
"github.com/containerd/nerdctl/v2/pkg/buildkitutil"
"github.com/containerd/nerdctl/v2/pkg/testutil"
"github.com/containerd/nerdctl/v2/pkg/testutil/testregistry"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/image_history.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"text/template"
"time"

"github.com/containerd/containerd"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/log"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/formatter"
Expand Down
4 changes: 2 additions & 2 deletions cmd/nerdctl/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"path/filepath"
"testing"

"github.com/containerd/containerd"
"github.com/containerd/containerd/v2/defaults"
"github.com/containerd/nerdctl/v2/pkg/testutil"
"gotest.tools/v3/assert"
)
Expand Down Expand Up @@ -55,7 +55,7 @@ snapshotter = "dummy-snapshotter-via-toml"
base := testutil.NewBase(t)

// [Default]
base.Cmd("info", "-f", "{{.Driver}}").AssertOutExactly(containerd.DefaultSnapshotter + "\n")
base.Cmd("info", "-f", "{{.Driver}}").AssertOutExactly(defaults.DefaultSnapshotter + "\n")

// [TOML, Default]
base.Env = append(base.Env, "NERDCTL_TOML="+tomlPath)
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"strings"
"text/tabwriter"

"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/containerd/log"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/mountutil/volumestore"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/network_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package main
import (
"fmt"

"github.com/containerd/containerd/identifiers"
"github.com/containerd/containerd/v2/pkg/identifiers"
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/cmd/network"
"github.com/containerd/nerdctl/v2/pkg/strutil"
Expand Down
62 changes: 40 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,29 +1,46 @@
module github.com/containerd/nerdctl/v2

go 1.21.12
go 1.22.0

// Pending https://github.com/awslabs/soci-snapshotter/pull/1305
// Conditionnally approved - team wants to wait for containerd v2 formal release
replace github.com/awslabs/soci-snapshotter => github.com/apostasie/soci-snapshotter v0.0.0-20240710025418-f6462fe32c19

// Stale PR here: https://github.com/microsoft/hcsshim/pull/1958
// IMPORTANT NOTE: on the fork, there is two branches - main and v2-backport
// unfortunately, main has changes that would require modifying containerd itself
// v2-backport does take v0.12.4 and move it to containerd v2
replace github.com/Microsoft/hcsshim => github.com/apostasie/hcsshim v0.0.0-20240704213501-b090c2e314a6

// TBD no current PR
replace github.com/containerd/nydus-snapshotter => github.com/apostasie/nydus-snapshotter v0.0.0-20240710161430-455999b59639

// Pending moby updating to containerd v2 - no current PR AFAIK
// replace github.com/docker/docker/pkg/sysinfo => ./pkg2/sysinfo

require (
github.com/Masterminds/semver/v3 v3.2.1
github.com/Microsoft/go-winio v0.6.2
github.com/Microsoft/hcsshim v0.12.5
github.com/awslabs/soci-snapshotter v0.7.0
github.com/awslabs/soci-snapshotter v0.0.0-20240710024008-702560159c04
github.com/compose-spec/compose-go/v2 v2.1.5
github.com/containerd/accelerated-container-image v1.1.4
github.com/containerd/accelerated-container-image v1.1.5-0.20240712041225-3c4dd559fed4
github.com/containerd/cgroups v1.1.0
github.com/containerd/cgroups/v3 v3.0.3
github.com/containerd/console v1.0.4
github.com/containerd/containerd v1.7.20
github.com/containerd/containerd/api v1.7.19
github.com/containerd/containerd/api v1.8.0-rc.2
github.com/containerd/containerd/v2 v2.0.0-rc.3
github.com/containerd/continuity v0.4.3
github.com/containerd/errdefs v0.1.0
github.com/containerd/fifo v1.1.0
github.com/containerd/go-cni v1.1.10
github.com/containerd/imgcrypt v1.1.11
github.com/containerd/imgcrypt v1.2.0-rc1.0.20240709223013-f3769dc3e47f
github.com/containerd/log v0.1.0
github.com/containerd/nydus-snapshotter v0.13.13
github.com/containerd/nydus-snapshotter v0.13.14-0.20240705032021-831f849aa80f
github.com/containerd/platforms v0.2.1
github.com/containerd/stargz-snapshotter v0.15.1
github.com/containerd/stargz-snapshotter/estargz v0.15.1
github.com/containerd/stargz-snapshotter/ipfs v0.15.1
github.com/containerd/stargz-snapshotter v0.15.2-0.20240709063920-1dac5ef89319
github.com/containerd/stargz-snapshotter/estargz v0.15.2-0.20240709063920-1dac5ef89319
github.com/containerd/stargz-snapshotter/ipfs v0.15.2-0.20240709063920-1dac5ef89319
github.com/containerd/typeurl/v2 v2.2.0
github.com/containernetworking/cni v1.2.3
github.com/containernetworking/plugins v1.5.1
Expand All @@ -43,6 +60,7 @@ require (
github.com/mattn/go-isatty v0.0.20
github.com/mitchellh/mapstructure v1.5.0
github.com/moby/sys/mount v0.3.4
github.com/moby/sys/mountinfo v0.7.2
github.com/moby/sys/signal v0.7.1
github.com/moby/term v0.5.0
github.com/muesli/cancelreader v0.2.2
Expand Down Expand Up @@ -70,19 +88,19 @@ require (
)

require (
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240716105424-66b64c4bb379 // indirect
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20231105174938-2b5cbb29f3e2 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/cilium/ebpf v0.15.0 // indirect
github.com/containerd/go-runc v1.1.0 // indirect
github.com/containerd/plugin v0.1.0 // indirect
github.com/containerd/ttrpc v1.2.5 // indirect
github.com/containerd/typeurl v1.0.2 // indirect
github.com/containers/ocicrypt v1.2.0 // indirect
github.com/djherbis/times v1.6.0 // indirect
github.com/docker/docker-credential-helpers v0.8.2 // indirect
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-jose/go-jose/v4 v4.0.3 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
Expand All @@ -92,9 +110,6 @@ require (
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
Expand All @@ -104,9 +119,8 @@ require (
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/moby/sys/mountinfo v0.7.2 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/symlink v0.2.0 // indirect
github.com/moby/sys/sequential v0.6.0 // indirect
github.com/moby/sys/symlink v0.3.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
Expand All @@ -115,13 +129,14 @@ require (
github.com/multiformats/go-multibase v0.2.0 // indirect
github.com/multiformats/go-multihash v0.2.3 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/opencontainers/runtime-tools v0.9.1-0.20221107090550-2e043c6bd626 // indirect
github.com/opencontainers/selinux v1.11.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/philhofer/fwd v1.1.3-0.20240612014219-fbbf4953d986 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/stefanberger/go-pkcs11uri v0.0.0-20230803200340-78284954bff6 // indirect
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tinylib/msgp v1.2.0 // indirect
Expand All @@ -135,10 +150,13 @@ require (
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
golang.org/x/exp v0.0.0-20240707233637-46b078467d37 // indirect
google.golang.org/genproto v0.0.0-20240711142825-46eb208f015d // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/mod v0.19.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d // indirect
google.golang.org/grpc v1.65.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
lukechampine.com/blake3 v1.3.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
tags.cncf.io/container-device-interface v0.8.0 // indirect
tags.cncf.io/container-device-interface/specs-go v0.8.0 // indirect
)
Loading

0 comments on commit 3a6f5f7

Please sign in to comment.