diff --git a/client/client.go b/client/client.go index b5b4dbe07..8894b46b0 100644 --- a/client/client.go +++ b/client/client.go @@ -53,13 +53,13 @@ import ( snproxy "github.com/containerd/containerd/v2/core/snapshots/proxy" "github.com/containerd/containerd/v2/defaults" "github.com/containerd/containerd/v2/pkg/dialer" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/events" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/plugins" "github.com/containerd/containerd/v2/plugins/services/introspection" "github.com/containerd/containerd/v2/protobuf" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/platforms" "github.com/containerd/typeurl/v2" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/client/container.go b/client/container.go index d989ee21b..c6b79bb27 100644 --- a/client/container.go +++ b/client/container.go @@ -31,9 +31,9 @@ import ( "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/runtime/v2/runc/options" "github.com/containerd/containerd/v2/pkg/cio" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/oci" "github.com/containerd/containerd/v2/protobuf" + "github.com/containerd/errdefs" "github.com/containerd/fifo" "github.com/containerd/typeurl/v2" ver "github.com/opencontainers/image-spec/specs-go" diff --git a/client/container_opts.go b/client/container_opts.go index 3983e6ea6..cf0e69c99 100644 --- a/client/container_opts.go +++ b/client/container_opts.go @@ -26,10 +26,10 @@ import ( "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/pkg/oci" "github.com/containerd/containerd/v2/protobuf" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" "github.com/opencontainers/image-spec/identity" v1 "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/client/container_opts_unix.go b/client/container_opts_unix.go index 275d61618..2e8554190 100644 --- a/client/container_opts_unix.go +++ b/client/container_opts_unix.go @@ -27,7 +27,7 @@ import ( "github.com/containerd/containerd/v2/core/containers" "github.com/containerd/containerd/v2/core/mount" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/opencontainers/image-spec/identity" ) diff --git a/client/containerstore.go b/client/containerstore.go index b7cdb5595..694e42039 100644 --- a/client/containerstore.go +++ b/client/containerstore.go @@ -23,9 +23,9 @@ import ( containersapi "github.com/containerd/containerd/v2/api/services/containers/v1" "github.com/containerd/containerd/v2/core/containers" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/protobuf" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/client/events.go b/client/events.go index 8ba213969..9f261d9f8 100644 --- a/client/events.go +++ b/client/events.go @@ -20,9 +20,9 @@ import ( "context" eventsapi "github.com/containerd/containerd/v2/api/services/events/v1" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/events" "github.com/containerd/containerd/v2/protobuf" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" ) diff --git a/client/image.go b/client/image.go index f0eef70ac..355bcba73 100644 --- a/client/image.go +++ b/client/image.go @@ -29,9 +29,9 @@ import ( "github.com/containerd/containerd/v2/core/images/usage" "github.com/containerd/containerd/v2/core/snapshots" "github.com/containerd/containerd/v2/internal/kmutex" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/labels" "github.com/containerd/containerd/v2/pkg/rootfs" + "github.com/containerd/errdefs" "github.com/containerd/platforms" "github.com/opencontainers/go-digest" "github.com/opencontainers/image-spec/identity" diff --git a/client/image_store.go b/client/image_store.go index 747b53db0..85f94b937 100644 --- a/client/image_store.go +++ b/client/image_store.go @@ -22,10 +22,10 @@ import ( imagesapi "github.com/containerd/containerd/v2/api/services/images/v1" "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/pkg/epoch" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/oci" "github.com/containerd/containerd/v2/protobuf" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "google.golang.org/protobuf/types/known/timestamppb" ) diff --git a/client/import.go b/client/import.go index 847d27c40..65ae95e22 100644 --- a/client/import.go +++ b/client/import.go @@ -22,7 +22,7 @@ import ( "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/images/archive" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/platforms" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/client/namespaces.go b/client/namespaces.go index 31bf9068b..0512291a2 100644 --- a/client/namespaces.go +++ b/client/namespaces.go @@ -21,9 +21,9 @@ import ( "strings" api "github.com/containerd/containerd/v2/api/services/namespaces/v1" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" ) // NewNamespaceStoreFromClient returns a new namespace store diff --git a/client/process.go b/client/process.go index f340465d1..fbb09a029 100644 --- a/client/process.go +++ b/client/process.go @@ -25,8 +25,8 @@ import ( "github.com/containerd/containerd/v2/api/services/tasks/v1" "github.com/containerd/containerd/v2/pkg/cio" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/protobuf" + "github.com/containerd/errdefs" ) // Process represents a system process diff --git a/client/pull.go b/client/pull.go index 9b8178694..d7d79c8cf 100644 --- a/client/pull.go +++ b/client/pull.go @@ -28,9 +28,9 @@ import ( "github.com/containerd/containerd/v2/core/remotes" "github.com/containerd/containerd/v2/core/remotes/docker" "github.com/containerd/containerd/v2/core/remotes/docker/schema1" //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/tracing" "github.com/containerd/containerd/v2/pkg/unpack" + "github.com/containerd/errdefs" "github.com/containerd/platforms" ) diff --git a/client/sandbox.go b/client/sandbox.go index e79ba08ca..237c2c82a 100644 --- a/client/sandbox.go +++ b/client/sandbox.go @@ -24,9 +24,9 @@ import ( "github.com/containerd/containerd/v2/core/containers" api "github.com/containerd/containerd/v2/core/sandbox" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/oci" "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" ) diff --git a/client/task.go b/client/task.go index 968acc793..483853097 100644 --- a/client/task.go +++ b/client/task.go @@ -34,12 +34,12 @@ import ( "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/core/runtime/v2/runc/options" "github.com/containerd/containerd/v2/pkg/cio" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/oci" "github.com/containerd/containerd/v2/pkg/rootfs" "github.com/containerd/containerd/v2/plugins" "github.com/containerd/containerd/v2/protobuf" google_protobuf "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" digest "github.com/opencontainers/go-digest" is "github.com/opencontainers/image-spec/specs-go" diff --git a/client/task_opts.go b/client/task_opts.go index 65868a52a..ea6658192 100644 --- a/client/task_opts.go +++ b/client/task_opts.go @@ -26,7 +26,7 @@ import ( "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/core/runtime/v2/runc/options" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/opencontainers/runtime-spec/specs-go" ) diff --git a/client/transfer.go b/client/transfer.go index 64e06fe9b..af240487a 100644 --- a/client/transfer.go +++ b/client/transfer.go @@ -23,11 +23,11 @@ import ( streamingapi "github.com/containerd/containerd/v2/api/services/streaming/v1" transferapi "github.com/containerd/containerd/v2/api/services/transfer/v1" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/streaming" "github.com/containerd/containerd/v2/pkg/transfer" "github.com/containerd/containerd/v2/pkg/transfer/proxy" "github.com/containerd/containerd/v2/protobuf" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" ) diff --git a/cmd/containerd-shim-runc-v2/manager/manager_linux.go b/cmd/containerd-shim-runc-v2/manager/manager_linux.go index a5ea7c3e1..cc3b53e5b 100644 --- a/cmd/containerd-shim-runc-v2/manager/manager_linux.go +++ b/cmd/containerd-shim-runc-v2/manager/manager_linux.go @@ -39,12 +39,12 @@ import ( "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/core/runtime/v2/runc/options" "github.com/containerd/containerd/v2/core/runtime/v2/shim" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/pkg/oci" "github.com/containerd/containerd/v2/pkg/schedcore" "github.com/containerd/containerd/v2/protobuf" "github.com/containerd/containerd/v2/version" + "github.com/containerd/errdefs" runcC "github.com/containerd/go-runc" "github.com/containerd/log" "github.com/opencontainers/runtime-spec/specs-go/features" diff --git a/cmd/containerd-shim-runc-v2/process/deleted_state.go b/cmd/containerd-shim-runc-v2/process/deleted_state.go index a2a2c2afd..231473267 100644 --- a/cmd/containerd-shim-runc-v2/process/deleted_state.go +++ b/cmd/containerd-shim-runc-v2/process/deleted_state.go @@ -24,8 +24,8 @@ import ( "fmt" "github.com/containerd/console" - "github.com/containerd/containerd/v2/pkg/errdefs" google_protobuf "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" ) type deletedState struct { diff --git a/cmd/containerd-shim-runc-v2/process/exec.go b/cmd/containerd-shim-runc-v2/process/exec.go index a38e21829..40344c13d 100644 --- a/cmd/containerd-shim-runc-v2/process/exec.go +++ b/cmd/containerd-shim-runc-v2/process/exec.go @@ -31,8 +31,8 @@ import ( "golang.org/x/sys/unix" "github.com/containerd/console" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/stdio" + "github.com/containerd/errdefs" "github.com/containerd/fifo" runc "github.com/containerd/go-runc" specs "github.com/opencontainers/runtime-spec/specs-go" diff --git a/cmd/containerd-shim-runc-v2/process/utils.go b/cmd/containerd-shim-runc-v2/process/utils.go index 86df22081..5a1c2ffaf 100644 --- a/cmd/containerd-shim-runc-v2/process/utils.go +++ b/cmd/containerd-shim-runc-v2/process/utils.go @@ -30,7 +30,7 @@ import ( "sync" "time" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" runc "github.com/containerd/go-runc" specs "github.com/opencontainers/runtime-spec/specs-go" "golang.org/x/sys/unix" diff --git a/cmd/containerd-shim-runc-v2/runc/container.go b/cmd/containerd-shim-runc-v2/runc/container.go index 615c70df0..a9febb450 100644 --- a/cmd/containerd-shim-runc-v2/runc/container.go +++ b/cmd/containerd-shim-runc-v2/runc/container.go @@ -34,9 +34,9 @@ import ( "github.com/containerd/containerd/v2/cmd/containerd-shim-runc-v2/process" "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/core/runtime/v2/runc/options" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/pkg/stdio" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/typeurl/v2" ) diff --git a/cmd/containerd-shim-runc-v2/task/service.go b/cmd/containerd-shim-runc-v2/task/service.go index 692c896a6..782212e60 100644 --- a/cmd/containerd-shim-runc-v2/task/service.go +++ b/cmd/containerd-shim-runc-v2/task/service.go @@ -35,7 +35,6 @@ import ( "github.com/containerd/containerd/v2/core/runtime" "github.com/containerd/containerd/v2/core/runtime/v2/runc/options" "github.com/containerd/containerd/v2/core/runtime/v2/shim" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/pkg/oom" oomv1 "github.com/containerd/containerd/v2/pkg/oom/v1" @@ -46,6 +45,7 @@ import ( "github.com/containerd/containerd/v2/pkg/userns" "github.com/containerd/containerd/v2/protobuf" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" runcC "github.com/containerd/go-runc" "github.com/containerd/log" "github.com/containerd/ttrpc" diff --git a/cmd/containerd/command/main.go b/cmd/containerd/command/main.go index 70f9ae857..c11057e1b 100644 --- a/cmd/containerd/command/main.go +++ b/cmd/containerd/command/main.go @@ -32,9 +32,9 @@ import ( _ "github.com/containerd/containerd/v2/core/metrics" // import containerd build info "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/defaults" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/sys" "github.com/containerd/containerd/v2/version" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/urfave/cli" "google.golang.org/grpc/grpclog" diff --git a/cmd/containerd/command/publish.go b/cmd/containerd/command/publish.go index 820618956..4afce093d 100644 --- a/cmd/containerd/command/publish.go +++ b/cmd/containerd/command/publish.go @@ -26,10 +26,10 @@ import ( eventsapi "github.com/containerd/containerd/v2/api/services/events/v1" "github.com/containerd/containerd/v2/pkg/dialer" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/protobuf/proto" "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/urfave/cli" "google.golang.org/grpc" "google.golang.org/grpc/backoff" diff --git a/cmd/containerd/command/service_windows.go b/cmd/containerd/command/service_windows.go index 497736d0b..f31bef1e7 100644 --- a/cmd/containerd/command/service_windows.go +++ b/cmd/containerd/command/service_windows.go @@ -25,7 +25,7 @@ import ( "time" "github.com/containerd/containerd/v2/cmd/containerd/server" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/sirupsen/logrus" "github.com/urfave/cli" "golang.org/x/sys/windows" diff --git a/cmd/containerd/server/config/config.go b/cmd/containerd/server/config/config.go index ac0a6e8a5..87eb321a4 100644 --- a/cmd/containerd/server/config/config.go +++ b/cmd/containerd/server/config/config.go @@ -36,7 +36,7 @@ import ( "dario.cat/mergo" "github.com/pelletier/go-toml/v2" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/plugin" ) diff --git a/cmd/ctr/commands/containers/checkpoint.go b/cmd/ctr/commands/containers/checkpoint.go index a5ad36ffb..4fef5c291 100644 --- a/cmd/ctr/commands/containers/checkpoint.go +++ b/cmd/ctr/commands/containers/checkpoint.go @@ -22,7 +22,7 @@ import ( containerd "github.com/containerd/containerd/v2/client" "github.com/containerd/containerd/v2/cmd/ctr/commands" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/containers/containers.go b/cmd/ctr/commands/containers/containers.go index a26874763..86c6699fb 100644 --- a/cmd/ctr/commands/containers/containers.go +++ b/cmd/ctr/commands/containers/containers.go @@ -28,7 +28,7 @@ import ( "github.com/containerd/containerd/v2/cmd/ctr/commands/run" "github.com/containerd/containerd/v2/core/containers" "github.com/containerd/containerd/v2/pkg/cio" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/typeurl/v2" "github.com/urfave/cli" diff --git a/cmd/ctr/commands/containers/restore.go b/cmd/ctr/commands/containers/restore.go index 720885f25..cdc5d26d8 100644 --- a/cmd/ctr/commands/containers/restore.go +++ b/cmd/ctr/commands/containers/restore.go @@ -24,7 +24,7 @@ import ( "github.com/containerd/containerd/v2/cmd/ctr/commands" "github.com/containerd/containerd/v2/cmd/ctr/commands/tasks" "github.com/containerd/containerd/v2/pkg/cio" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/content/content.go b/cmd/ctr/commands/content/content.go index 33dbf4a8c..e19bc701f 100644 --- a/cmd/ctr/commands/content/content.go +++ b/cmd/ctr/commands/content/content.go @@ -30,7 +30,7 @@ import ( "github.com/containerd/containerd/v2/cmd/ctr/commands" "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/core/remotes" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" units "github.com/docker/go-units" digest "github.com/opencontainers/go-digest" diff --git a/cmd/ctr/commands/content/fetch.go b/cmd/ctr/commands/content/fetch.go index da6c70f5a..4cf3cf529 100644 --- a/cmd/ctr/commands/content/fetch.go +++ b/cmd/ctr/commands/content/fetch.go @@ -31,8 +31,8 @@ import ( "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/remotes" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/progress" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/platforms" "github.com/opencontainers/go-digest" diff --git a/cmd/ctr/commands/images/images.go b/cmd/ctr/commands/images/images.go index a58b4f028..3e0e05308 100644 --- a/cmd/ctr/commands/images/images.go +++ b/cmd/ctr/commands/images/images.go @@ -26,8 +26,8 @@ import ( "github.com/containerd/containerd/v2/cmd/ctr/commands" "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/progress" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/platforms" "github.com/urfave/cli" diff --git a/cmd/ctr/commands/images/mount.go b/cmd/ctr/commands/images/mount.go index 32be49cb6..6050b2c08 100644 --- a/cmd/ctr/commands/images/mount.go +++ b/cmd/ctr/commands/images/mount.go @@ -25,7 +25,7 @@ import ( "github.com/containerd/containerd/v2/core/leases" "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/defaults" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/platforms" "github.com/opencontainers/image-spec/identity" "github.com/urfave/cli" diff --git a/cmd/ctr/commands/images/tag.go b/cmd/ctr/commands/images/tag.go index c65daa365..c01833988 100644 --- a/cmd/ctr/commands/images/tag.go +++ b/cmd/ctr/commands/images/tag.go @@ -22,8 +22,8 @@ import ( "github.com/urfave/cli" "github.com/containerd/containerd/v2/cmd/ctr/commands" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/transfer/image" + "github.com/containerd/errdefs" "github.com/distribution/reference" ) diff --git a/cmd/ctr/commands/images/unmount.go b/cmd/ctr/commands/images/unmount.go index 2f7ad06fb..a0a7d0d8a 100644 --- a/cmd/ctr/commands/images/unmount.go +++ b/cmd/ctr/commands/images/unmount.go @@ -22,7 +22,7 @@ import ( "github.com/containerd/containerd/v2/cmd/ctr/commands" "github.com/containerd/containerd/v2/core/leases" "github.com/containerd/containerd/v2/core/mount" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/namespaces/namespaces.go b/cmd/ctr/commands/namespaces/namespaces.go index 49f2d9ae3..e0de1867c 100644 --- a/cmd/ctr/commands/namespaces/namespaces.go +++ b/cmd/ctr/commands/namespaces/namespaces.go @@ -25,7 +25,7 @@ import ( "text/tabwriter" "github.com/containerd/containerd/v2/cmd/ctr/commands" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/urfave/cli" ) diff --git a/cmd/ctr/commands/run/run.go b/cmd/ctr/commands/run/run.go index 9df7f5a88..89516fb7a 100644 --- a/cmd/ctr/commands/run/run.go +++ b/cmd/ctr/commands/run/run.go @@ -33,9 +33,9 @@ import ( "github.com/containerd/containerd/v2/cmd/ctr/commands/tasks" "github.com/containerd/containerd/v2/core/containers" "github.com/containerd/containerd/v2/pkg/cio" - "github.com/containerd/containerd/v2/pkg/errdefs" clabels "github.com/containerd/containerd/v2/pkg/labels" "github.com/containerd/containerd/v2/pkg/oci" + "github.com/containerd/errdefs" "github.com/containerd/log" ) diff --git a/cmd/ctr/commands/signals.go b/cmd/ctr/commands/signals.go index 2e1077a1c..e78b6f718 100644 --- a/cmd/ctr/commands/signals.go +++ b/cmd/ctr/commands/signals.go @@ -23,7 +23,7 @@ import ( "syscall" containerd "github.com/containerd/containerd/v2/client" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" ) diff --git a/cmd/ctr/commands/tasks/start.go b/cmd/ctr/commands/tasks/start.go index 87074b400..81149c5b6 100644 --- a/cmd/ctr/commands/tasks/start.go +++ b/cmd/ctr/commands/tasks/start.go @@ -23,7 +23,7 @@ import ( containerd "github.com/containerd/containerd/v2/client" "github.com/containerd/containerd/v2/cmd/ctr/commands" "github.com/containerd/containerd/v2/pkg/cio" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/urfave/cli" ) diff --git a/contrib/diffservice/service.go b/contrib/diffservice/service.go index f6164c696..22cd4de7d 100644 --- a/contrib/diffservice/service.go +++ b/contrib/diffservice/service.go @@ -22,8 +22,8 @@ import ( diffapi "github.com/containerd/containerd/v2/api/services/diff/v1" "github.com/containerd/containerd/v2/core/diff" "github.com/containerd/containerd/v2/core/mount" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/oci" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/contrib/snapshotservice/service.go b/contrib/snapshotservice/service.go index 0f2286c08..3e765672a 100644 --- a/contrib/snapshotservice/service.go +++ b/contrib/snapshotservice/service.go @@ -22,8 +22,8 @@ import ( snapshotsapi "github.com/containerd/containerd/v2/api/services/snapshots/v1" "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/pkg/errdefs" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" ) var empty = &ptypes.Empty{} diff --git a/core/content/helpers.go b/core/content/helpers.go index 514127d0a..424db0fd8 100644 --- a/core/content/helpers.go +++ b/core/content/helpers.go @@ -25,7 +25,7 @@ import ( "time" "github.com/containerd/containerd/v2/internal/randutil" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/core/content/helpers_test.go b/core/content/helpers_test.go index d3b11d6eb..8601dc7b0 100644 --- a/core/content/helpers_test.go +++ b/core/content/helpers_test.go @@ -25,7 +25,7 @@ import ( "strings" "testing" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/opencontainers/go-digest" "github.com/stretchr/testify/assert" ) diff --git a/core/content/proxy/content_store.go b/core/content/proxy/content_store.go index d5e230b41..5d7edb770 100644 --- a/core/content/proxy/content_store.go +++ b/core/content/proxy/content_store.go @@ -22,9 +22,9 @@ import ( contentapi "github.com/containerd/containerd/v2/api/services/content/v1" "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/protobuf" protobuftypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/core/content/proxy/content_writer.go b/core/content/proxy/content_writer.go index 60d9deee3..1b32e0aae 100644 --- a/core/content/proxy/content_writer.go +++ b/core/content/proxy/content_writer.go @@ -23,8 +23,8 @@ import ( contentapi "github.com/containerd/containerd/v2/api/services/content/v1" "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/protobuf" + "github.com/containerd/errdefs" digest "github.com/opencontainers/go-digest" ) diff --git a/core/content/testsuite/testsuite.go b/core/content/testsuite/testsuite.go index c93a62c77..1dd2d816e 100644 --- a/core/content/testsuite/testsuite.go +++ b/core/content/testsuite/testsuite.go @@ -30,7 +30,7 @@ import ( "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/internal/testutil" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log/logtest" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/core/diff/apply/apply_linux.go b/core/diff/apply/apply_linux.go index 309cbf7f3..c43b071b4 100644 --- a/core/diff/apply/apply_linux.go +++ b/core/diff/apply/apply_linux.go @@ -25,8 +25,8 @@ import ( "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/pkg/archive" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/userns" + "github.com/containerd/errdefs" "golang.org/x/sys/unix" ) diff --git a/core/diff/proxy/differ.go b/core/diff/proxy/differ.go index 1eb438c7b..ec0d0e853 100644 --- a/core/diff/proxy/differ.go +++ b/core/diff/proxy/differ.go @@ -23,10 +23,10 @@ import ( "github.com/containerd/containerd/v2/core/diff" "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/pkg/epoch" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/oci" "github.com/containerd/containerd/v2/protobuf" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "google.golang.org/protobuf/types/known/timestamppb" diff --git a/core/images/archive/exporter.go b/core/images/archive/exporter.go index bd136a4b8..1377336a9 100644 --- a/core/images/archive/exporter.go +++ b/core/images/archive/exporter.go @@ -28,8 +28,8 @@ import ( "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/labels" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/platforms" digest "github.com/opencontainers/go-digest" diff --git a/core/images/archive/importer.go b/core/images/archive/importer.go index 314c22ab8..83030bea5 100644 --- a/core/images/archive/importer.go +++ b/core/images/archive/importer.go @@ -30,8 +30,8 @@ import ( "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/pkg/archive/compression" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/labels" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/platforms" digest "github.com/opencontainers/go-digest" diff --git a/core/images/converter/uncompress/uncompress.go b/core/images/converter/uncompress/uncompress.go index c57d275ad..f5d5acba3 100644 --- a/core/images/converter/uncompress/uncompress.go +++ b/core/images/converter/uncompress/uncompress.go @@ -25,8 +25,8 @@ import ( "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/images/converter" "github.com/containerd/containerd/v2/pkg/archive/compression" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/labels" + "github.com/containerd/errdefs" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/core/images/handlers.go b/core/images/handlers.go index 407030ab3..0487fdebd 100644 --- a/core/images/handlers.go +++ b/core/images/handlers.go @@ -23,7 +23,7 @@ import ( "sort" "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/platforms" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "golang.org/x/sync/errgroup" diff --git a/core/images/image.go b/core/images/image.go index 16bc9f74e..f9b3e38d9 100644 --- a/core/images/image.go +++ b/core/images/image.go @@ -24,7 +24,7 @@ import ( "time" "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/platforms" digest "github.com/opencontainers/go-digest" diff --git a/core/images/mediatypes.go b/core/images/mediatypes.go index 19976a239..cd51aa5eb 100644 --- a/core/images/mediatypes.go +++ b/core/images/mediatypes.go @@ -22,7 +22,7 @@ import ( "sort" "strings" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/core/images/usage/calculator.go b/core/images/usage/calculator.go index 738a459b8..35477ba1a 100644 --- a/core/images/usage/calculator.go +++ b/core/images/usage/calculator.go @@ -24,7 +24,7 @@ import ( "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/platforms" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/core/leases/proxy/manager.go b/core/leases/proxy/manager.go index bea57930b..d51b2b20b 100644 --- a/core/leases/proxy/manager.go +++ b/core/leases/proxy/manager.go @@ -21,8 +21,8 @@ import ( leasesapi "github.com/containerd/containerd/v2/api/services/leases/v1" "github.com/containerd/containerd/v2/core/leases" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/protobuf" + "github.com/containerd/errdefs" ) type proxyManager struct { diff --git a/core/metadata/containers.go b/core/metadata/containers.go index 4aebf18f5..9973c9b9f 100644 --- a/core/metadata/containers.go +++ b/core/metadata/containers.go @@ -25,13 +25,13 @@ import ( "github.com/containerd/containerd/v2/core/containers" "github.com/containerd/containerd/v2/core/metadata/boltutil" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/filters" "github.com/containerd/containerd/v2/pkg/identifiers" "github.com/containerd/containerd/v2/pkg/labels" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/protobuf/proto" "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" bolt "go.etcd.io/bbolt" ) diff --git a/core/metadata/containers_test.go b/core/metadata/containers_test.go index 4ca974630..e3110c916 100644 --- a/core/metadata/containers_test.go +++ b/core/metadata/containers_test.go @@ -26,11 +26,11 @@ import ( "time" "github.com/containerd/containerd/v2/core/containers" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/filters" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/protobuf" "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/log/logtest" "github.com/containerd/typeurl/v2" "github.com/google/go-cmp/cmp" diff --git a/core/metadata/content.go b/core/metadata/content.go index 68b88fc55..3c990cb1e 100644 --- a/core/metadata/content.go +++ b/core/metadata/content.go @@ -27,10 +27,10 @@ import ( "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/core/metadata/boltutil" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/filters" "github.com/containerd/containerd/v2/pkg/labels" "github.com/containerd/containerd/v2/pkg/namespaces" + "github.com/containerd/errdefs" "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/core/metadata/content_test.go b/core/metadata/content_test.go index f9b3df14a..62f5d5506 100644 --- a/core/metadata/content_test.go +++ b/core/metadata/content_test.go @@ -28,10 +28,10 @@ import ( "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/core/content/testsuite" "github.com/containerd/containerd/v2/core/leases" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/labels" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/plugins/content/local" + "github.com/containerd/errdefs" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" bolt "go.etcd.io/bbolt" diff --git a/core/metadata/db_test.go b/core/metadata/db_test.go index cf66619ee..10dfe562d 100644 --- a/core/metadata/db_test.go +++ b/core/metadata/db_test.go @@ -34,12 +34,12 @@ import ( "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/leases" "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/gc" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/plugins/content/local" "github.com/containerd/containerd/v2/plugins/snapshots/native" "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/log/logtest" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/core/metadata/images.go b/core/metadata/images.go index 7b34cfad3..8da3c6ed4 100644 --- a/core/metadata/images.go +++ b/core/metadata/images.go @@ -28,10 +28,10 @@ import ( "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/metadata/boltutil" "github.com/containerd/containerd/v2/pkg/epoch" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/filters" "github.com/containerd/containerd/v2/pkg/labels" "github.com/containerd/containerd/v2/pkg/namespaces" + "github.com/containerd/errdefs" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" bolt "go.etcd.io/bbolt" diff --git a/core/metadata/images_test.go b/core/metadata/images_test.go index e4a574c0e..50e8a8b2a 100644 --- a/core/metadata/images_test.go +++ b/core/metadata/images_test.go @@ -24,8 +24,8 @@ import ( "time" "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/filters" + "github.com/containerd/errdefs" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/core/metadata/leases.go b/core/metadata/leases.go index d20b5f309..649d77bc5 100644 --- a/core/metadata/leases.go +++ b/core/metadata/leases.go @@ -26,9 +26,9 @@ import ( "github.com/containerd/containerd/v2/core/leases" "github.com/containerd/containerd/v2/core/metadata/boltutil" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/filters" "github.com/containerd/containerd/v2/pkg/namespaces" + "github.com/containerd/errdefs" digest "github.com/opencontainers/go-digest" bolt "go.etcd.io/bbolt" ) diff --git a/core/metadata/leases_test.go b/core/metadata/leases_test.go index 2cc19871d..f95c4a4ed 100644 --- a/core/metadata/leases_test.go +++ b/core/metadata/leases_test.go @@ -23,7 +23,7 @@ import ( "testing" "github.com/containerd/containerd/v2/core/leases" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" bolt "go.etcd.io/bbolt" ) diff --git a/core/metadata/namespaces.go b/core/metadata/namespaces.go index 5b67f09b4..b3c56e629 100644 --- a/core/metadata/namespaces.go +++ b/core/metadata/namespaces.go @@ -21,10 +21,10 @@ import ( "fmt" "strings" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/identifiers" l "github.com/containerd/containerd/v2/pkg/labels" "github.com/containerd/containerd/v2/pkg/namespaces" + "github.com/containerd/errdefs" bolt "go.etcd.io/bbolt" ) diff --git a/core/metadata/sandbox.go b/core/metadata/sandbox.go index 53b516396..98a283a70 100644 --- a/core/metadata/sandbox.go +++ b/core/metadata/sandbox.go @@ -25,10 +25,10 @@ import ( "github.com/containerd/containerd/v2/core/metadata/boltutil" api "github.com/containerd/containerd/v2/core/sandbox" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/filters" "github.com/containerd/containerd/v2/pkg/identifiers" "github.com/containerd/containerd/v2/pkg/namespaces" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" "go.etcd.io/bbolt" ) diff --git a/core/metadata/sandbox_test.go b/core/metadata/sandbox_test.go index 898726f76..1cef52819 100644 --- a/core/metadata/sandbox_test.go +++ b/core/metadata/sandbox_test.go @@ -20,8 +20,8 @@ import ( "testing" api "github.com/containerd/containerd/v2/core/sandbox" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" "github.com/google/go-cmp/cmp" ) diff --git a/core/metadata/snapshot.go b/core/metadata/snapshot.go index b264b84b7..af4234baa 100644 --- a/core/metadata/snapshot.go +++ b/core/metadata/snapshot.go @@ -28,10 +28,10 @@ import ( "github.com/containerd/containerd/v2/core/metadata/boltutil" "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/filters" "github.com/containerd/containerd/v2/pkg/labels" "github.com/containerd/containerd/v2/pkg/namespaces" + "github.com/containerd/errdefs" "github.com/containerd/log" bolt "go.etcd.io/bbolt" ) diff --git a/core/metadata/snapshot_test.go b/core/metadata/snapshot_test.go index 261dc35ed..0f9028c83 100644 --- a/core/metadata/snapshot_test.go +++ b/core/metadata/snapshot_test.go @@ -31,10 +31,10 @@ import ( "github.com/containerd/containerd/v2/core/snapshots" "github.com/containerd/containerd/v2/core/snapshots/testsuite" "github.com/containerd/containerd/v2/internal/testutil" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/filters" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/plugins/snapshots/native" + "github.com/containerd/errdefs" bolt "go.etcd.io/bbolt" ) diff --git a/core/metrics/cgroups/v1/cgroups.go b/core/metrics/cgroups/v1/cgroups.go index 657a9ac2f..09622c84c 100644 --- a/core/metrics/cgroups/v1/cgroups.go +++ b/core/metrics/cgroups/v1/cgroups.go @@ -24,9 +24,9 @@ import ( cgroups "github.com/containerd/cgroups/v3/cgroup1" eventstypes "github.com/containerd/containerd/v2/api/events" "github.com/containerd/containerd/v2/core/runtime" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/events" "github.com/containerd/containerd/v2/pkg/namespaces" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/docker/go-metrics" ) diff --git a/core/remotes/docker/authorizer.go b/core/remotes/docker/authorizer.go index 75fcb8bc3..e9af2f76b 100644 --- a/core/remotes/docker/authorizer.go +++ b/core/remotes/docker/authorizer.go @@ -27,7 +27,7 @@ import ( "github.com/containerd/containerd/v2/core/remotes/docker/auth" remoteerrors "github.com/containerd/containerd/v2/core/remotes/errors" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" ) diff --git a/core/remotes/docker/config/hosts.go b/core/remotes/docker/config/hosts.go index cb4a25fbb..e6cba8760 100644 --- a/core/remotes/docker/config/hosts.go +++ b/core/remotes/docker/config/hosts.go @@ -31,7 +31,7 @@ import ( "time" "github.com/containerd/containerd/v2/core/remotes/docker" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/pelletier/go-toml/v2" tomlu "github.com/pelletier/go-toml/v2/unstable" diff --git a/core/remotes/docker/fetcher.go b/core/remotes/docker/fetcher.go index 1f1eb2496..2c7d880a9 100644 --- a/core/remotes/docker/fetcher.go +++ b/core/remotes/docker/fetcher.go @@ -30,7 +30,7 @@ import ( "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/remotes" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/klauspost/compress/zstd" digest "github.com/opencontainers/go-digest" diff --git a/core/remotes/docker/httpreadseeker.go b/core/remotes/docker/httpreadseeker.go index 6dfa40238..6739e7904 100644 --- a/core/remotes/docker/httpreadseeker.go +++ b/core/remotes/docker/httpreadseeker.go @@ -21,7 +21,7 @@ import ( "fmt" "io" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" ) diff --git a/core/remotes/docker/pusher.go b/core/remotes/docker/pusher.go index ec93dddb5..c3d0c6069 100644 --- a/core/remotes/docker/pusher.go +++ b/core/remotes/docker/pusher.go @@ -32,7 +32,7 @@ import ( "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/remotes" remoteserrors "github.com/containerd/containerd/v2/core/remotes/errors" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/core/remotes/docker/pusher_test.go b/core/remotes/docker/pusher_test.go index 22de402f9..8db32922c 100644 --- a/core/remotes/docker/pusher_test.go +++ b/core/remotes/docker/pusher_test.go @@ -31,8 +31,8 @@ import ( "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/core/remotes" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/reference" + "github.com/containerd/errdefs" "github.com/containerd/log/logtest" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/core/remotes/docker/resolver.go b/core/remotes/docker/resolver.go index 177c47e4a..962faf39a 100644 --- a/core/remotes/docker/resolver.go +++ b/core/remotes/docker/resolver.go @@ -32,10 +32,10 @@ import ( "github.com/containerd/containerd/v2/core/remotes" "github.com/containerd/containerd/v2/core/remotes/docker/schema1" //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. remoteerrors "github.com/containerd/containerd/v2/core/remotes/errors" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/reference" "github.com/containerd/containerd/v2/pkg/tracing" "github.com/containerd/containerd/v2/version" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/core/remotes/docker/resolver_test.go b/core/remotes/docker/resolver_test.go index 1f57609a5..4800112cf 100644 --- a/core/remotes/docker/resolver_test.go +++ b/core/remotes/docker/resolver_test.go @@ -35,7 +35,7 @@ import ( "github.com/containerd/containerd/v2/core/remotes" "github.com/containerd/containerd/v2/core/remotes/docker/auth" remoteerrors "github.com/containerd/containerd/v2/core/remotes/errors" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" digest "github.com/opencontainers/go-digest" specs "github.com/opencontainers/image-spec/specs-go" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/core/remotes/docker/schema1/converter.go b/core/remotes/docker/schema1/converter.go index f8876b185..e8a3534dd 100644 --- a/core/remotes/docker/schema1/converter.go +++ b/core/remotes/docker/schema1/converter.go @@ -36,8 +36,8 @@ import ( "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/remotes" "github.com/containerd/containerd/v2/pkg/archive/compression" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/labels" + "github.com/containerd/errdefs" "github.com/containerd/log" digest "github.com/opencontainers/go-digest" specs "github.com/opencontainers/image-spec/specs-go" diff --git a/core/remotes/docker/status.go b/core/remotes/docker/status.go index 1e02cfd2c..9835525ab 100644 --- a/core/remotes/docker/status.go +++ b/core/remotes/docker/status.go @@ -21,7 +21,7 @@ import ( "sync" "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/moby/locker" ) diff --git a/core/remotes/handlers.go b/core/remotes/handlers.go index 8e9cbebcc..16fcdbf84 100644 --- a/core/remotes/handlers.go +++ b/core/remotes/handlers.go @@ -27,8 +27,8 @@ import ( "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/labels" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/platforms" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/core/runtime/nsmap.go b/core/runtime/nsmap.go index d459f34b1..fec82113e 100644 --- a/core/runtime/nsmap.go +++ b/core/runtime/nsmap.go @@ -21,8 +21,8 @@ import ( "fmt" "sync" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/namespaces" + "github.com/containerd/errdefs" ) type object interface { diff --git a/core/runtime/v2/example/example.go b/core/runtime/v2/example/example.go index 43c712f50..d0933584e 100644 --- a/core/runtime/v2/example/example.go +++ b/core/runtime/v2/example/example.go @@ -24,10 +24,10 @@ import ( taskAPI "github.com/containerd/containerd/v2/api/runtime/task/v2" apitypes "github.com/containerd/containerd/v2/api/types" "github.com/containerd/containerd/v2/core/runtime/v2/shim" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/shutdown" "github.com/containerd/containerd/v2/plugins" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" "github.com/containerd/ttrpc" diff --git a/core/runtime/v2/manager.go b/core/runtime/v2/manager.go index ea6010864..62c3b535b 100644 --- a/core/runtime/v2/manager.go +++ b/core/runtime/v2/manager.go @@ -34,13 +34,13 @@ import ( shimbinary "github.com/containerd/containerd/v2/core/runtime/v2/shim" "github.com/containerd/containerd/v2/core/sandbox" "github.com/containerd/containerd/v2/internal/cleanup" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/events/exchange" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/pkg/timeout" "github.com/containerd/containerd/v2/plugins" "github.com/containerd/containerd/v2/protobuf" "github.com/containerd/containerd/v2/protobuf/proto" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/platforms" "github.com/containerd/plugin" diff --git a/core/runtime/v2/process.go b/core/runtime/v2/process.go index 674c4987a..5b638bd0c 100644 --- a/core/runtime/v2/process.go +++ b/core/runtime/v2/process.go @@ -23,8 +23,8 @@ import ( task "github.com/containerd/containerd/v2/api/runtime/task/v3" tasktypes "github.com/containerd/containerd/v2/api/types/task" "github.com/containerd/containerd/v2/core/runtime" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/protobuf" + "github.com/containerd/errdefs" "github.com/containerd/ttrpc" ) diff --git a/core/runtime/v2/shim.go b/core/runtime/v2/shim.go index 47ecfdc74..6d7bed38a 100644 --- a/core/runtime/v2/shim.go +++ b/core/runtime/v2/shim.go @@ -40,12 +40,12 @@ import ( "github.com/containerd/containerd/v2/api/types" "github.com/containerd/containerd/v2/core/runtime" client "github.com/containerd/containerd/v2/core/runtime/v2/shim" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/events/exchange" "github.com/containerd/containerd/v2/pkg/identifiers" "github.com/containerd/containerd/v2/pkg/timeout" "github.com/containerd/containerd/v2/protobuf" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/log" ) diff --git a/core/runtime/v2/shim/shim_windows.go b/core/runtime/v2/shim/shim_windows.go index 2af26556a..8181b4c81 100644 --- a/core/runtime/v2/shim/shim_windows.go +++ b/core/runtime/v2/shim/shim_windows.go @@ -22,7 +22,7 @@ import ( "net" "os" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/ttrpc" "github.com/sirupsen/logrus" ) diff --git a/core/runtime/v2/shim/util.go b/core/runtime/v2/shim/util.go index 7b8d601a4..cfcf07387 100644 --- a/core/runtime/v2/shim/util.go +++ b/core/runtime/v2/shim/util.go @@ -33,10 +33,10 @@ import ( "github.com/containerd/typeurl/v2" "github.com/containerd/containerd/v2/pkg/atomicfile" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/protobuf/proto" "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" ) type CommandConfig struct { diff --git a/core/runtime/v2/shim_load.go b/core/runtime/v2/shim_load.go index 1d5b48fce..12eff4f3c 100644 --- a/core/runtime/v2/shim_load.go +++ b/core/runtime/v2/shim_load.go @@ -24,9 +24,9 @@ import ( "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/internal/cleanup" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/pkg/timeout" + "github.com/containerd/errdefs" "github.com/containerd/log" ) diff --git a/core/runtime/v2/shim_test.go b/core/runtime/v2/shim_test.go index 69a31aea4..fe8a005d0 100644 --- a/core/runtime/v2/shim_test.go +++ b/core/runtime/v2/shim_test.go @@ -23,7 +23,7 @@ import ( "testing" client "github.com/containerd/containerd/v2/core/runtime/v2/shim" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/stretchr/testify/require" ) diff --git a/core/sandbox/proxy/controller.go b/core/sandbox/proxy/controller.go index 6992c4531..a4e5fddf1 100644 --- a/core/sandbox/proxy/controller.go +++ b/core/sandbox/proxy/controller.go @@ -23,7 +23,7 @@ import ( "github.com/containerd/containerd/v2/api/types" "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/core/sandbox" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/platforms" "google.golang.org/protobuf/types/known/anypb" ) diff --git a/core/sandbox/proxy/store.go b/core/sandbox/proxy/store.go index 8fc153edf..6fd60065c 100644 --- a/core/sandbox/proxy/store.go +++ b/core/sandbox/proxy/store.go @@ -21,7 +21,7 @@ import ( api "github.com/containerd/containerd/v2/api/services/sandbox/v1" sb "github.com/containerd/containerd/v2/core/sandbox" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" ) // remoteSandboxStore is a low-level containerd client to manage sandbox environments metadata diff --git a/core/sandbox/store.go b/core/sandbox/store.go index 95167703c..705e86fac 100644 --- a/core/sandbox/store.go +++ b/core/sandbox/store.go @@ -21,7 +21,7 @@ import ( "fmt" "time" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" ) diff --git a/core/snapshots/proxy/proxy.go b/core/snapshots/proxy/proxy.go index d3522da3d..92f277abd 100644 --- a/core/snapshots/proxy/proxy.go +++ b/core/snapshots/proxy/proxy.go @@ -23,8 +23,8 @@ import ( snapshotsapi "github.com/containerd/containerd/v2/api/services/snapshots/v1" "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/pkg/errdefs" protobuftypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" ) // NewSnapshotter returns a new Snapshotter which communicates over a GRPC diff --git a/core/snapshots/storage/bolt.go b/core/snapshots/storage/bolt.go index e1add50b8..728fb0df7 100644 --- a/core/snapshots/storage/bolt.go +++ b/core/snapshots/storage/bolt.go @@ -27,8 +27,8 @@ import ( "github.com/containerd/containerd/v2/core/metadata/boltutil" "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/filters" + "github.com/containerd/errdefs" bolt "go.etcd.io/bbolt" ) diff --git a/core/snapshots/storage/metastore_test.go b/core/snapshots/storage/metastore_test.go index d72bd3d9e..11395a685 100644 --- a/core/snapshots/storage/metastore_test.go +++ b/core/snapshots/storage/metastore_test.go @@ -24,7 +24,7 @@ import ( "time" "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/assert" ) diff --git a/core/snapshots/testsuite/testsuite.go b/core/snapshots/testsuite/testsuite.go index 1495a0a6f..a3d269fd1 100644 --- a/core/snapshots/testsuite/testsuite.go +++ b/core/snapshots/testsuite/testsuite.go @@ -32,9 +32,9 @@ import ( "github.com/containerd/containerd/v2/core/snapshots" "github.com/containerd/containerd/v2/internal/randutil" "github.com/containerd/containerd/v2/internal/testutil" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/continuity/fs/fstest" + "github.com/containerd/errdefs" "github.com/containerd/log/logtest" "github.com/stretchr/testify/assert" ) diff --git a/go.mod b/go.mod index 31311757d..7d6fec5ef 100644 --- a/go.mod +++ b/go.mod @@ -12,6 +12,7 @@ require ( github.com/containerd/cgroups/v3 v3.0.3 github.com/containerd/console v1.0.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.9 github.com/containerd/go-runc v1.1.0 diff --git a/go.sum b/go.sum index 3df548056..9f0f79903 100644 --- a/go.sum +++ b/go.sum @@ -48,6 +48,8 @@ github.com/containerd/containerd v1.7.8 h1:RkwgOW3AVUT3H/dyT0W03Dc8AzlpMG65lX48K github.com/containerd/containerd v1.7.8/go.mod h1:L/Hn9qylJtUFT7cPeM0Sr3fATj+WjHwRQ0lyrYk3OPY= github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7bEZ9Su8= github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= +github.com/containerd/errdefs v0.1.0 h1:m0wCRBiu1WJT/Fr+iOoQHMQS/eP5myQ8lCv4Dz5ZURM= +github.com/containerd/errdefs v0.1.0/go.mod h1:YgWiiHtLmSeBrvpw+UfPijzbLaB77mEG1WwJTDETIV0= github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY= github.com/containerd/fifo v1.1.0/go.mod h1:bmC4NWMbXlt2EZ0Hc7Fx7QzTFxgPID13eH0Qu+MAb2o= github.com/containerd/go-cni v1.1.9 h1:ORi7P1dYzCwVM6XPN4n3CbkuOx/NZ2DOqy+SHRdo9rU= diff --git a/integration/client/client_test.go b/integration/client/client_test.go index c363a6c18..691d07c7a 100644 --- a/integration/client/client_test.go +++ b/integration/client/client_test.go @@ -40,8 +40,8 @@ import ( "github.com/containerd/containerd/v2/defaults" imagelist "github.com/containerd/containerd/v2/integration/images" "github.com/containerd/containerd/v2/internal/testutil" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/namespaces" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/platforms" ) diff --git a/integration/client/container_linux_test.go b/integration/client/container_linux_test.go index e90a571be..fb7d6427b 100644 --- a/integration/client/container_linux_test.go +++ b/integration/client/container_linux_test.go @@ -38,10 +38,10 @@ import ( "github.com/containerd/containerd/v2/core/containers" "github.com/containerd/containerd/v2/core/runtime/v2/runc/options" "github.com/containerd/containerd/v2/pkg/cio" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/oci" "github.com/containerd/containerd/v2/pkg/sys" "github.com/containerd/containerd/v2/plugins" + "github.com/containerd/errdefs" "github.com/opencontainers/runtime-spec/specs-go" "github.com/stretchr/testify/require" diff --git a/integration/client/container_test.go b/integration/client/container_test.go index e5f554519..ce831e062 100644 --- a/integration/client/container_test.go +++ b/integration/client/container_test.go @@ -38,12 +38,12 @@ import ( _ "github.com/containerd/containerd/v2/core/runtime" "github.com/containerd/containerd/v2/core/runtime/v2/runc/options" "github.com/containerd/containerd/v2/pkg/cio" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/pkg/oci" "github.com/containerd/containerd/v2/plugins" gogotypes "github.com/containerd/containerd/v2/protobuf/types" "github.com/containerd/continuity/fs" + "github.com/containerd/errdefs" "github.com/containerd/go-runc" "github.com/containerd/log/logtest" "github.com/containerd/platforms" diff --git a/integration/client/content_test.go b/integration/client/content_test.go index 38ce387c8..ce78ff72a 100644 --- a/integration/client/content_test.go +++ b/integration/client/content_test.go @@ -25,8 +25,8 @@ import ( . "github.com/containerd/containerd/v2/client" "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/core/content/testsuite" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/namespaces" + "github.com/containerd/errdefs" ) func newContentStore(ctx context.Context, root string) (context.Context, content.Store, func() error, error) { diff --git a/integration/client/export_test.go b/integration/client/export_test.go index bf727f308..8f964f6d4 100644 --- a/integration/client/export_test.go +++ b/integration/client/export_test.go @@ -29,8 +29,8 @@ import ( "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/images/archive" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/namespaces" + "github.com/containerd/errdefs" "github.com/containerd/platforms" "github.com/google/uuid" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/integration/client/image_test.go b/integration/client/image_test.go index 3d907e0bb..ce7e105ab 100644 --- a/integration/client/image_test.go +++ b/integration/client/image_test.go @@ -27,8 +27,8 @@ import ( "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/defaults" imagelist "github.com/containerd/containerd/v2/integration/images" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/labels" + "github.com/containerd/errdefs" "github.com/containerd/platforms" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/integration/client/lease_test.go b/integration/client/lease_test.go index c6e661740..487843382 100644 --- a/integration/client/lease_test.go +++ b/integration/client/lease_test.go @@ -24,7 +24,7 @@ import ( "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/leases" imagelist "github.com/containerd/containerd/v2/integration/images" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/opencontainers/image-spec/identity" ) diff --git a/integration/containerd_image_test.go b/integration/containerd_image_test.go index a80fca1fc..03955b51c 100644 --- a/integration/containerd_image_test.go +++ b/integration/containerd_image_test.go @@ -28,8 +28,8 @@ import ( containerd "github.com/containerd/containerd/v2/client" "github.com/containerd/containerd/v2/integration/images" "github.com/containerd/containerd/v2/pkg/cri/labels" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/namespaces" + "github.com/containerd/errdefs" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/bandwidth/fake_shaper.go b/pkg/cri/bandwidth/fake_shaper.go index 203ef877f..58e4e1ab4 100644 --- a/pkg/cri/bandwidth/fake_shaper.go +++ b/pkg/cri/bandwidth/fake_shaper.go @@ -33,7 +33,7 @@ limitations under the License. package bandwidth import ( - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "k8s.io/apimachinery/pkg/api/resource" ) diff --git a/pkg/cri/bandwidth/unsupported.go b/pkg/cri/bandwidth/unsupported.go index a09a69330..29e9765f6 100644 --- a/pkg/cri/bandwidth/unsupported.go +++ b/pkg/cri/bandwidth/unsupported.go @@ -35,7 +35,7 @@ limitations under the License. package bandwidth import ( - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "k8s.io/apimachinery/pkg/api/resource" ) diff --git a/pkg/cri/instrument/instrumented_service.go b/pkg/cri/instrument/instrumented_service.go index b51930d74..a030bc7f8 100644 --- a/pkg/cri/instrument/instrumented_service.go +++ b/pkg/cri/instrument/instrumented_service.go @@ -19,8 +19,8 @@ package instrument import ( "context" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/tracing" + "github.com/containerd/errdefs" "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/nri/nri_api_linux.go b/pkg/cri/nri/nri_api_linux.go index e6ed0a736..e01aebe34 100644 --- a/pkg/cri/nri/nri_api_linux.go +++ b/pkg/cri/nri/nri_api_linux.go @@ -29,7 +29,7 @@ import ( cstore "github.com/containerd/containerd/v2/pkg/cri/store/container" sstore "github.com/containerd/containerd/v2/pkg/cri/store/sandbox" ctrdutil "github.com/containerd/containerd/v2/pkg/cri/util" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/typeurl/v2" runtimespec "github.com/opencontainers/runtime-spec/specs-go" diff --git a/pkg/cri/opts/container.go b/pkg/cri/opts/container.go index 95e1441e0..ba37006f9 100644 --- a/pkg/cri/opts/container.go +++ b/pkg/cri/opts/container.go @@ -30,7 +30,7 @@ import ( "github.com/containerd/containerd/v2/core/containers" "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" ) diff --git a/pkg/cri/opts/spec_nonwindows.go b/pkg/cri/opts/spec_nonwindows.go index efa906c16..8798d024b 100644 --- a/pkg/cri/opts/spec_nonwindows.go +++ b/pkg/cri/opts/spec_nonwindows.go @@ -22,8 +22,8 @@ import ( "context" "github.com/containerd/containerd/v2/core/containers" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/oci" + "github.com/containerd/errdefs" imagespec "github.com/opencontainers/image-spec/specs-go/v1" runtimespec "github.com/opencontainers/runtime-spec/specs-go" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/server/container_execsync.go b/pkg/cri/server/container_execsync.go index 3699d6bb1..53160e1d8 100644 --- a/pkg/cri/server/container_execsync.go +++ b/pkg/cri/server/container_execsync.go @@ -26,8 +26,8 @@ import ( containerd "github.com/containerd/containerd/v2/client" containerdio "github.com/containerd/containerd/v2/pkg/cio" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/oci" + "github.com/containerd/errdefs" "github.com/containerd/log" "k8s.io/client-go/tools/remotecommand" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/server/container_remove.go b/pkg/cri/server/container_remove.go index 4bcb18fe6..1bf53f8ba 100644 --- a/pkg/cri/server/container_remove.go +++ b/pkg/cri/server/container_remove.go @@ -24,7 +24,7 @@ import ( containerd "github.com/containerd/containerd/v2/client" containerstore "github.com/containerd/containerd/v2/pkg/cri/store/container" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/container_start.go b/pkg/cri/server/container_start.go index 836f17433..2a80d683b 100644 --- a/pkg/cri/server/container_start.go +++ b/pkg/cri/server/container_start.go @@ -25,7 +25,7 @@ import ( containerd "github.com/containerd/containerd/v2/client" containerdio "github.com/containerd/containerd/v2/pkg/cio" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/server/container_stats_list.go b/pkg/cri/server/container_stats_list.go index 83c2d8822..363a51a08 100644 --- a/pkg/cri/server/container_stats_list.go +++ b/pkg/cri/server/container_stats_list.go @@ -34,8 +34,8 @@ import ( "github.com/containerd/containerd/v2/api/types" containerstore "github.com/containerd/containerd/v2/pkg/cri/store/container" "github.com/containerd/containerd/v2/pkg/cri/store/stats" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/protobuf" + "github.com/containerd/errdefs" ) // ListContainerStats returns stats of all running containers. diff --git a/pkg/cri/server/container_status.go b/pkg/cri/server/container_status.go index 9fa26c275..7100e12e1 100644 --- a/pkg/cri/server/container_status.go +++ b/pkg/cri/server/container_status.go @@ -23,7 +23,7 @@ import ( containerstore "github.com/containerd/containerd/v2/pkg/cri/store/container" "github.com/containerd/containerd/v2/pkg/cri/util" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" runtimespec "github.com/opencontainers/runtime-spec/specs-go" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/server/container_stop.go b/pkg/cri/server/container_stop.go index bdccb7e1a..0c7047d72 100644 --- a/pkg/cri/server/container_stop.go +++ b/pkg/cri/server/container_stop.go @@ -26,8 +26,8 @@ import ( eventtypes "github.com/containerd/containerd/v2/api/events" containerstore "github.com/containerd/containerd/v2/pkg/cri/store/container" ctrdutil "github.com/containerd/containerd/v2/pkg/cri/util" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/protobuf" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/moby/sys/signal" diff --git a/pkg/cri/server/container_update_resources.go b/pkg/cri/server/container_update_resources.go index 5db3be8ce..605056d2b 100644 --- a/pkg/cri/server/container_update_resources.go +++ b/pkg/cri/server/container_update_resources.go @@ -29,7 +29,7 @@ import ( containerd "github.com/containerd/containerd/v2/client" "github.com/containerd/containerd/v2/core/containers" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" containerstore "github.com/containerd/containerd/v2/pkg/cri/store/container" diff --git a/pkg/cri/server/events.go b/pkg/cri/server/events.go index d83890872..0b88da227 100644 --- a/pkg/cri/server/events.go +++ b/pkg/cri/server/events.go @@ -36,9 +36,9 @@ import ( containerstore "github.com/containerd/containerd/v2/pkg/cri/store/container" sandboxstore "github.com/containerd/containerd/v2/pkg/cri/store/sandbox" ctrdutil "github.com/containerd/containerd/v2/pkg/cri/util" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/events" "github.com/containerd/containerd/v2/protobuf" + "github.com/containerd/errdefs" ) const ( diff --git a/pkg/cri/server/helpers.go b/pkg/cri/server/helpers.go index 8fcae64c1..eb0a3e558 100644 --- a/pkg/cri/server/helpers.go +++ b/pkg/cri/server/helpers.go @@ -36,8 +36,8 @@ import ( crilabels "github.com/containerd/containerd/v2/pkg/cri/labels" containerstore "github.com/containerd/containerd/v2/pkg/cri/store/container" imagestore "github.com/containerd/containerd/v2/pkg/cri/store/image" - "github.com/containerd/containerd/v2/pkg/errdefs" clabels "github.com/containerd/containerd/v2/pkg/labels" + "github.com/containerd/errdefs" "github.com/containerd/log" ) diff --git a/pkg/cri/server/images/image_pull.go b/pkg/cri/server/images/image_pull.go index 60389c869..6355a161f 100644 --- a/pkg/cri/server/images/image_pull.go +++ b/pkg/cri/server/images/image_pull.go @@ -47,9 +47,9 @@ import ( "github.com/containerd/containerd/v2/pkg/cri/annotations" criconfig "github.com/containerd/containerd/v2/pkg/cri/config" crilabels "github.com/containerd/containerd/v2/pkg/cri/labels" - "github.com/containerd/containerd/v2/pkg/errdefs" snpkg "github.com/containerd/containerd/v2/pkg/snapshotters" "github.com/containerd/containerd/v2/pkg/tracing" + "github.com/containerd/errdefs" ) // For image management: diff --git a/pkg/cri/server/images/image_remove.go b/pkg/cri/server/images/image_remove.go index 7c5b7b8b7..33fd10f4e 100644 --- a/pkg/cri/server/images/image_remove.go +++ b/pkg/cri/server/images/image_remove.go @@ -22,8 +22,8 @@ import ( eventstypes "github.com/containerd/containerd/v2/api/events" "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/tracing" + "github.com/containerd/errdefs" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/images/image_status.go b/pkg/cri/server/images/image_status.go index 3990c0e9a..cc4f022dc 100644 --- a/pkg/cri/server/images/image_status.go +++ b/pkg/cri/server/images/image_status.go @@ -25,8 +25,8 @@ import ( imagestore "github.com/containerd/containerd/v2/pkg/cri/store/image" "github.com/containerd/containerd/v2/pkg/cri/util" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/tracing" + "github.com/containerd/errdefs" "github.com/containerd/log" imagespec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/pkg/cri/server/images/service_test.go b/pkg/cri/server/images/service_test.go index 177992051..0e9272e66 100644 --- a/pkg/cri/server/images/service_test.go +++ b/pkg/cri/server/images/service_test.go @@ -23,7 +23,7 @@ import ( criconfig "github.com/containerd/containerd/v2/pkg/cri/config" imagestore "github.com/containerd/containerd/v2/pkg/cri/store/image" snapshotstore "github.com/containerd/containerd/v2/pkg/cri/store/snapshot" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/platforms" "github.com/stretchr/testify/assert" ) diff --git a/pkg/cri/server/images/snapshots.go b/pkg/cri/server/images/snapshots.go index 74af6bff4..d8c98d69e 100644 --- a/pkg/cri/server/images/snapshots.go +++ b/pkg/cri/server/images/snapshots.go @@ -24,7 +24,7 @@ import ( snapshot "github.com/containerd/containerd/v2/core/snapshots" snapshotstore "github.com/containerd/containerd/v2/pkg/cri/store/snapshot" ctrdutil "github.com/containerd/containerd/v2/pkg/cri/util" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" ) diff --git a/pkg/cri/server/podsandbox/controller.go b/pkg/cri/server/podsandbox/controller.go index 96a94f5b1..6ab044112 100644 --- a/pkg/cri/server/podsandbox/controller.go +++ b/pkg/cri/server/podsandbox/controller.go @@ -35,11 +35,11 @@ import ( "github.com/containerd/containerd/v2/pkg/cri/server/podsandbox/types" imagestore "github.com/containerd/containerd/v2/pkg/cri/store/image" ctrdutil "github.com/containerd/containerd/v2/pkg/cri/util" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/oci" osinterface "github.com/containerd/containerd/v2/pkg/os" "github.com/containerd/containerd/v2/plugins" "github.com/containerd/containerd/v2/protobuf" + "github.com/containerd/errdefs" "github.com/containerd/platforms" ) diff --git a/pkg/cri/server/podsandbox/recover.go b/pkg/cri/server/podsandbox/recover.go index 7eabef8d5..6ae3214c2 100644 --- a/pkg/cri/server/podsandbox/recover.go +++ b/pkg/cri/server/podsandbox/recover.go @@ -30,8 +30,8 @@ import ( "github.com/containerd/containerd/v2/pkg/cri/server/podsandbox/types" sandboxstore "github.com/containerd/containerd/v2/pkg/cri/store/sandbox" ctrdutil "github.com/containerd/containerd/v2/pkg/cri/util" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/netns" + "github.com/containerd/errdefs" ) // loadContainerTimeout is the default timeout for loading a container/sandbox. diff --git a/pkg/cri/server/podsandbox/sandbox_delete.go b/pkg/cri/server/podsandbox/sandbox_delete.go index b40890644..7bdc1ccca 100644 --- a/pkg/cri/server/podsandbox/sandbox_delete.go +++ b/pkg/cri/server/podsandbox/sandbox_delete.go @@ -22,7 +22,7 @@ import ( apitasks "github.com/containerd/containerd/v2/api/services/tasks/v1" containerd "github.com/containerd/containerd/v2/client" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" ) diff --git a/pkg/cri/server/podsandbox/sandbox_run.go b/pkg/cri/server/podsandbox/sandbox_run.go index 904a1d08b..c791ff7ef 100644 --- a/pkg/cri/server/podsandbox/sandbox_run.go +++ b/pkg/cri/server/podsandbox/sandbox_run.go @@ -40,7 +40,7 @@ import ( imagestore "github.com/containerd/containerd/v2/pkg/cri/store/image" sandboxstore "github.com/containerd/containerd/v2/pkg/cri/store/sandbox" ctrdutil "github.com/containerd/containerd/v2/pkg/cri/util" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" ) func init() { diff --git a/pkg/cri/server/podsandbox/sandbox_stats.go b/pkg/cri/server/podsandbox/sandbox_stats.go index 5d7f7ed82..7c5141d0a 100644 --- a/pkg/cri/server/podsandbox/sandbox_stats.go +++ b/pkg/cri/server/podsandbox/sandbox_stats.go @@ -20,7 +20,7 @@ import ( "context" "github.com/containerd/containerd/v2/api/types" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" ) // TODO(dcantah): Implement metrics to be used for SandboxStats rpc. diff --git a/pkg/cri/server/podsandbox/sandbox_status.go b/pkg/cri/server/podsandbox/sandbox_status.go index 7439f6e3d..d75b376f5 100644 --- a/pkg/cri/server/podsandbox/sandbox_status.go +++ b/pkg/cri/server/podsandbox/sandbox_status.go @@ -28,7 +28,7 @@ import ( "github.com/containerd/containerd/v2/core/sandbox" "github.com/containerd/containerd/v2/pkg/cri/server/base" "github.com/containerd/containerd/v2/pkg/cri/server/podsandbox/types" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" ) func (c *Controller) Status(ctx context.Context, sandboxID string, verbose bool) (sandbox.ControllerStatus, error) { diff --git a/pkg/cri/server/podsandbox/sandbox_stop.go b/pkg/cri/server/podsandbox/sandbox_stop.go index d3d564b2a..d0c30580f 100644 --- a/pkg/cri/server/podsandbox/sandbox_stop.go +++ b/pkg/cri/server/podsandbox/sandbox_stop.go @@ -30,8 +30,8 @@ import ( "github.com/containerd/containerd/v2/pkg/cri/server/podsandbox/types" sandboxstore "github.com/containerd/containerd/v2/pkg/cri/store/sandbox" ctrdutil "github.com/containerd/containerd/v2/pkg/cri/util" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/protobuf" + "github.com/containerd/errdefs" ) func (c *Controller) Stop(ctx context.Context, sandboxID string, _ ...sandbox.StopOpt) error { diff --git a/pkg/cri/server/restart.go b/pkg/cri/server/restart.go index acdb13025..a6353bc9c 100644 --- a/pkg/cri/server/restart.go +++ b/pkg/cri/server/restart.go @@ -28,8 +28,8 @@ import ( criconfig "github.com/containerd/containerd/v2/pkg/cri/config" crilabels "github.com/containerd/containerd/v2/pkg/cri/labels" "github.com/containerd/containerd/v2/pkg/cri/server/podsandbox" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/netns" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/typeurl/v2" "golang.org/x/sync/errgroup" diff --git a/pkg/cri/server/sandbox_portforward_other.go b/pkg/cri/server/sandbox_portforward_other.go index 78e72f443..2c7fbc1b5 100644 --- a/pkg/cri/server/sandbox_portforward_other.go +++ b/pkg/cri/server/sandbox_portforward_other.go @@ -23,7 +23,7 @@ import ( "fmt" "io" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" ) // portForward uses netns to enter the sandbox namespace, and forwards a stream inside the diff --git a/pkg/cri/server/sandbox_remove.go b/pkg/cri/server/sandbox_remove.go index 930026985..ed3b1ae97 100644 --- a/pkg/cri/server/sandbox_remove.go +++ b/pkg/cri/server/sandbox_remove.go @@ -21,7 +21,7 @@ import ( "fmt" "time" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/server/sandbox_stats_linux.go b/pkg/cri/server/sandbox_stats_linux.go index 5cfe20230..a781db4a0 100644 --- a/pkg/cri/server/sandbox_stats_linux.go +++ b/pkg/cri/server/sandbox_stats_linux.go @@ -25,7 +25,7 @@ import ( "github.com/containerd/cgroups/v3/cgroup1" cgroupsv2 "github.com/containerd/cgroups/v3/cgroup2" sandboxstore "github.com/containerd/containerd/v2/pkg/cri/store/sandbox" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containernetworking/plugins/pkg/ns" "github.com/vishvananda/netlink" diff --git a/pkg/cri/server/sandbox_stats_list.go b/pkg/cri/server/sandbox_stats_list.go index 7222689c8..95381bbb7 100644 --- a/pkg/cri/server/sandbox_stats_list.go +++ b/pkg/cri/server/sandbox_stats_list.go @@ -22,7 +22,7 @@ import ( "fmt" sandboxstore "github.com/containerd/containerd/v2/pkg/cri/store/sandbox" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/sandbox_stats_other.go b/pkg/cri/server/sandbox_stats_other.go index ab102553b..585a478ca 100644 --- a/pkg/cri/server/sandbox_stats_other.go +++ b/pkg/cri/server/sandbox_stats_other.go @@ -23,7 +23,7 @@ import ( "fmt" sandboxstore "github.com/containerd/containerd/v2/pkg/cri/store/sandbox" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/server/sandbox_stats_windows.go b/pkg/cri/server/sandbox_stats_windows.go index a7bbc6e9b..6fb9773f9 100644 --- a/pkg/cri/server/sandbox_stats_windows.go +++ b/pkg/cri/server/sandbox_stats_windows.go @@ -30,8 +30,8 @@ import ( sandboxstore "github.com/containerd/containerd/v2/pkg/cri/store/sandbox" "github.com/containerd/containerd/v2/pkg/cri/store/stats" ctrdutil "github.com/containerd/containerd/v2/pkg/cri/util" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/protobuf" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/typeurl/v2" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/server/sandbox_status.go b/pkg/cri/server/sandbox_status.go index 48c6ccff5..1bbd539f5 100644 --- a/pkg/cri/server/sandbox_status.go +++ b/pkg/cri/server/sandbox_status.go @@ -26,7 +26,7 @@ import ( "github.com/containerd/containerd/v2/pkg/cri/server/base" sandboxstore "github.com/containerd/containerd/v2/pkg/cri/store/sandbox" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" ) // PodSandboxStatus returns the status of the PodSandbox. diff --git a/pkg/cri/server/sandbox_stop.go b/pkg/cri/server/sandbox_stop.go index e5b80ba72..687962726 100644 --- a/pkg/cri/server/sandbox_stop.go +++ b/pkg/cri/server/sandbox_stop.go @@ -26,7 +26,7 @@ import ( runtime "k8s.io/cri-api/pkg/apis/runtime/v1" sandboxstore "github.com/containerd/containerd/v2/pkg/cri/store/sandbox" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" ) // StopPodSandbox stops the sandbox. If there are any running containers in the diff --git a/pkg/cri/server/service_test.go b/pkg/cri/server/service_test.go index 4b1e4aaa4..4d8cc047b 100644 --- a/pkg/cri/server/service_test.go +++ b/pkg/cri/server/service_test.go @@ -29,8 +29,8 @@ import ( "github.com/containerd/containerd/v2/pkg/cri/store/label" sandboxstore "github.com/containerd/containerd/v2/pkg/cri/store/sandbox" servertesting "github.com/containerd/containerd/v2/pkg/cri/testing" - "github.com/containerd/containerd/v2/pkg/errdefs" ostesting "github.com/containerd/containerd/v2/pkg/os/testing" + "github.com/containerd/errdefs" "github.com/containerd/platforms" ) diff --git a/pkg/cri/store/container/container.go b/pkg/cri/store/container/container.go index 069f0af90..e3839c6d4 100644 --- a/pkg/cri/store/container/container.go +++ b/pkg/cri/store/container/container.go @@ -25,7 +25,7 @@ import ( "github.com/containerd/containerd/v2/pkg/cri/store" "github.com/containerd/containerd/v2/pkg/cri/store/label" "github.com/containerd/containerd/v2/pkg/cri/store/stats" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) diff --git a/pkg/cri/store/container/container_test.go b/pkg/cri/store/container/container_test.go index 71b625167..56143c5b5 100644 --- a/pkg/cri/store/container/container_test.go +++ b/pkg/cri/store/container/container_test.go @@ -24,7 +24,7 @@ import ( cio "github.com/containerd/containerd/v2/pkg/cri/io" "github.com/containerd/containerd/v2/pkg/cri/store/label" "github.com/containerd/containerd/v2/pkg/cri/store/stats" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/opencontainers/selinux/go-selinux" assertlib "github.com/stretchr/testify/assert" diff --git a/pkg/cri/store/image/image.go b/pkg/cri/store/image/image.go index 34ecc1d04..bcbd515df 100644 --- a/pkg/cri/store/image/image.go +++ b/pkg/cri/store/image/image.go @@ -27,7 +27,7 @@ import ( "github.com/containerd/containerd/v2/core/images/usage" "github.com/containerd/containerd/v2/pkg/cri/labels" "github.com/containerd/containerd/v2/pkg/cri/util" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/platforms" docker "github.com/distribution/reference" "k8s.io/apimachinery/pkg/util/sets" diff --git a/pkg/cri/store/image/image_test.go b/pkg/cri/store/image/image_test.go index fbaa6864f..5376cb617 100644 --- a/pkg/cri/store/image/image_test.go +++ b/pkg/cri/store/image/image_test.go @@ -21,7 +21,7 @@ import ( "strings" "testing" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "k8s.io/apimachinery/pkg/util/sets" "github.com/opencontainers/go-digest/digestset" diff --git a/pkg/cri/store/sandbox/sandbox.go b/pkg/cri/store/sandbox/sandbox.go index f88db82a1..9e4aa58cb 100644 --- a/pkg/cri/store/sandbox/sandbox.go +++ b/pkg/cri/store/sandbox/sandbox.go @@ -24,8 +24,8 @@ import ( "github.com/containerd/containerd/v2/pkg/cri/store" "github.com/containerd/containerd/v2/pkg/cri/store/label" "github.com/containerd/containerd/v2/pkg/cri/store/stats" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/netns" + "github.com/containerd/errdefs" ) // Sandbox contains all resources associated with the sandbox. All methods to diff --git a/pkg/cri/store/sandbox/sandbox_test.go b/pkg/cri/store/sandbox/sandbox_test.go index ec389144d..5e70f75d2 100644 --- a/pkg/cri/store/sandbox/sandbox_test.go +++ b/pkg/cri/store/sandbox/sandbox_test.go @@ -22,7 +22,7 @@ import ( "github.com/containerd/containerd/v2/pkg/cri/store/label" "github.com/containerd/containerd/v2/pkg/cri/store/stats" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" assertlib "github.com/stretchr/testify/assert" runtime "k8s.io/cri-api/pkg/apis/runtime/v1" diff --git a/pkg/cri/store/snapshot/snapshot.go b/pkg/cri/store/snapshot/snapshot.go index 13614fb75..418877908 100644 --- a/pkg/cri/store/snapshot/snapshot.go +++ b/pkg/cri/store/snapshot/snapshot.go @@ -20,7 +20,7 @@ import ( "sync" snapshot "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" ) type Key struct { diff --git a/pkg/cri/store/snapshot/snapshot_test.go b/pkg/cri/store/snapshot/snapshot_test.go index 5a4da9ee1..20add72b1 100644 --- a/pkg/cri/store/snapshot/snapshot_test.go +++ b/pkg/cri/store/snapshot/snapshot_test.go @@ -21,7 +21,7 @@ import ( "time" snapshot "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" assertlib "github.com/stretchr/testify/assert" ) diff --git a/pkg/events/exchange/exchange.go b/pkg/events/exchange/exchange.go index 269d1e258..6eaeb40df 100644 --- a/pkg/events/exchange/exchange.go +++ b/pkg/events/exchange/exchange.go @@ -22,11 +22,11 @@ import ( "strings" "time" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/events" "github.com/containerd/containerd/v2/pkg/filters" "github.com/containerd/containerd/v2/pkg/identifiers" "github.com/containerd/containerd/v2/pkg/namespaces" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/typeurl/v2" goevents "github.com/docker/go-events" diff --git a/pkg/events/exchange/exchange_test.go b/pkg/events/exchange/exchange_test.go index a6f9ece60..09b79a632 100644 --- a/pkg/events/exchange/exchange_test.go +++ b/pkg/events/exchange/exchange_test.go @@ -23,10 +23,10 @@ import ( "time" eventstypes "github.com/containerd/containerd/v2/api/events" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/events" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/protobuf" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" "github.com/google/go-cmp/cmp" ) diff --git a/pkg/filters/parser.go b/pkg/filters/parser.go index b50511363..f07fd33bd 100644 --- a/pkg/filters/parser.go +++ b/pkg/filters/parser.go @@ -20,7 +20,7 @@ import ( "fmt" "io" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" ) /* diff --git a/pkg/identifiers/validate.go b/pkg/identifiers/validate.go index 92bba3f6f..0acbf3fc4 100644 --- a/pkg/identifiers/validate.go +++ b/pkg/identifiers/validate.go @@ -28,7 +28,7 @@ import ( "fmt" "regexp" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" ) const ( diff --git a/pkg/identifiers/validate_test.go b/pkg/identifiers/validate_test.go index 077ece9f9..615e6ab7d 100644 --- a/pkg/identifiers/validate_test.go +++ b/pkg/identifiers/validate_test.go @@ -20,7 +20,7 @@ import ( "strings" "testing" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" ) func TestValidIdentifiers(t *testing.T) { diff --git a/pkg/labels/validate.go b/pkg/labels/validate.go index e19a019d3..6f23cdd7c 100644 --- a/pkg/labels/validate.go +++ b/pkg/labels/validate.go @@ -19,7 +19,7 @@ package labels import ( "fmt" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" ) const ( diff --git a/pkg/labels/validate_test.go b/pkg/labels/validate_test.go index 96d752736..16be11df3 100644 --- a/pkg/labels/validate_test.go +++ b/pkg/labels/validate_test.go @@ -20,7 +20,7 @@ import ( "strings" "testing" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/stretchr/testify/assert" ) diff --git a/pkg/namespaces/context.go b/pkg/namespaces/context.go index 2cd50d640..dbbc28615 100644 --- a/pkg/namespaces/context.go +++ b/pkg/namespaces/context.go @@ -21,8 +21,8 @@ import ( "fmt" "os" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/identifiers" + "github.com/containerd/errdefs" ) const ( diff --git a/pkg/nri/domain.go b/pkg/nri/domain.go index 319be05f5..86a11a5af 100644 --- a/pkg/nri/domain.go +++ b/pkg/nri/domain.go @@ -21,8 +21,8 @@ import ( "fmt" "sync" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/namespaces" + "github.com/containerd/errdefs" "github.com/containerd/log" nri "github.com/containerd/nri/pkg/adaptation" ) diff --git a/pkg/oci/spec_opts_test.go b/pkg/oci/spec_opts_test.go index 8033d1ada..1638dcfd2 100644 --- a/pkg/oci/spec_opts_test.go +++ b/pkg/oci/spec_opts_test.go @@ -38,8 +38,8 @@ import ( "github.com/containerd/containerd/v2/core/containers" "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/namespaces" + "github.com/containerd/errdefs" ) type blob []byte diff --git a/pkg/rootfs/apply.go b/pkg/rootfs/apply.go index ac9115669..2955d549f 100644 --- a/pkg/rootfs/apply.go +++ b/pkg/rootfs/apply.go @@ -26,7 +26,7 @@ import ( "github.com/containerd/containerd/v2/core/diff" "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/opencontainers/go-digest" "github.com/opencontainers/image-spec/identity" diff --git a/pkg/tracing/plugin/otlp.go b/pkg/tracing/plugin/otlp.go index b972a0e54..489233a7c 100644 --- a/pkg/tracing/plugin/otlp.go +++ b/pkg/tracing/plugin/otlp.go @@ -24,9 +24,9 @@ import ( "net/url" "time" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/tracing" "github.com/containerd/containerd/v2/plugins" + "github.com/containerd/errdefs" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" "github.com/sirupsen/logrus" diff --git a/pkg/tracing/plugin/otlp_test.go b/pkg/tracing/plugin/otlp_test.go index 1f31705f6..2f314b4df 100644 --- a/pkg/tracing/plugin/otlp_test.go +++ b/pkg/tracing/plugin/otlp_test.go @@ -21,7 +21,7 @@ import ( "errors" "testing" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "go.opentelemetry.io/otel/sdk/trace" "go.opentelemetry.io/otel/sdk/trace/tracetest" ) diff --git a/pkg/transfer/image/imagestore.go b/pkg/transfer/image/imagestore.go index 16cb86631..9802966b3 100644 --- a/pkg/transfer/image/imagestore.go +++ b/pkg/transfer/image/imagestore.go @@ -29,10 +29,10 @@ import ( "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/images/archive" "github.com/containerd/containerd/v2/core/remotes" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/streaming" "github.com/containerd/containerd/v2/pkg/transfer" "github.com/containerd/containerd/v2/pkg/transfer/plugins" + "github.com/containerd/errdefs" "github.com/containerd/platforms" ) diff --git a/pkg/transfer/image/imagestore_test.go b/pkg/transfer/image/imagestore_test.go index 2a233dfcf..5c4a45025 100644 --- a/pkg/transfer/image/imagestore_test.go +++ b/pkg/transfer/image/imagestore_test.go @@ -24,7 +24,7 @@ import ( "testing" "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/pkg/transfer/local/import.go b/pkg/transfer/local/import.go index 73182f652..2ff5a21d5 100644 --- a/pkg/transfer/local/import.go +++ b/pkg/transfer/local/import.go @@ -25,9 +25,9 @@ import ( "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/core/images" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/transfer" "github.com/containerd/containerd/v2/pkg/unpack" + "github.com/containerd/errdefs" "github.com/containerd/log" ) diff --git a/pkg/transfer/local/pull.go b/pkg/transfer/local/pull.go index 19ea9f936..16287e4e8 100644 --- a/pkg/transfer/local/pull.go +++ b/pkg/transfer/local/pull.go @@ -25,9 +25,9 @@ import ( "github.com/containerd/containerd/v2/core/remotes" "github.com/containerd/containerd/v2/core/remotes/docker" "github.com/containerd/containerd/v2/defaults" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/transfer" "github.com/containerd/containerd/v2/pkg/unpack" + "github.com/containerd/errdefs" "github.com/containerd/log" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" diff --git a/pkg/transfer/local/push.go b/pkg/transfer/local/push.go index 120ae1688..52aa6b1bc 100644 --- a/pkg/transfer/local/push.go +++ b/pkg/transfer/local/push.go @@ -25,8 +25,8 @@ import ( "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/remotes" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/transfer" + "github.com/containerd/errdefs" "github.com/containerd/platforms" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/pkg/transfer/local/transfer.go b/pkg/transfer/local/transfer.go index 43d7a6f95..99c4b3c07 100644 --- a/pkg/transfer/local/transfer.go +++ b/pkg/transfer/local/transfer.go @@ -29,10 +29,10 @@ import ( "github.com/containerd/containerd/v2/core/images" "github.com/containerd/containerd/v2/core/leases" "github.com/containerd/containerd/v2/internal/kmutex" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/imageverifier" "github.com/containerd/containerd/v2/pkg/transfer" "github.com/containerd/containerd/v2/pkg/unpack" + "github.com/containerd/errdefs" ) type localTransferService struct { diff --git a/pkg/transfer/plugins/plugins.go b/pkg/transfer/plugins/plugins.go index d2c1e3de0..1769fea3c 100644 --- a/pkg/transfer/plugins/plugins.go +++ b/pkg/transfer/plugins/plugins.go @@ -21,7 +21,7 @@ import ( "reflect" "sync" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" ) diff --git a/pkg/unpack/unpacker.go b/pkg/unpack/unpacker.go index 07bcc769b..91d9e8111 100644 --- a/pkg/unpack/unpacker.go +++ b/pkg/unpack/unpacker.go @@ -35,9 +35,9 @@ import ( "github.com/containerd/containerd/v2/core/snapshots" "github.com/containerd/containerd/v2/internal/cleanup" "github.com/containerd/containerd/v2/internal/kmutex" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/labels" "github.com/containerd/containerd/v2/pkg/tracing" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/platforms" "github.com/opencontainers/go-digest" diff --git a/plugins/content/local/locks.go b/plugins/content/local/locks.go index 1601aaade..4caffcc02 100644 --- a/plugins/content/local/locks.go +++ b/plugins/content/local/locks.go @@ -21,7 +21,7 @@ import ( "sync" "time" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" ) // Handles locking references diff --git a/plugins/content/local/readerat.go b/plugins/content/local/readerat.go index 096da8da0..59198fd6e 100644 --- a/plugins/content/local/readerat.go +++ b/plugins/content/local/readerat.go @@ -22,7 +22,7 @@ import ( "os" "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" ) // readerat implements io.ReaderAt in a completely stateless manner by opening diff --git a/plugins/content/local/store.go b/plugins/content/local/store.go index 02f8a6a11..4b06351a0 100644 --- a/plugins/content/local/store.go +++ b/plugins/content/local/store.go @@ -28,8 +28,8 @@ import ( "time" "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/filters" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/opencontainers/go-digest" diff --git a/plugins/content/local/store_test.go b/plugins/content/local/store_test.go index 905d81bd0..6253a4e1f 100644 --- a/plugins/content/local/store_test.go +++ b/plugins/content/local/store_test.go @@ -36,7 +36,7 @@ import ( "github.com/containerd/containerd/v2/core/content/testsuite" "github.com/containerd/containerd/v2/internal/randutil" "github.com/containerd/containerd/v2/internal/testutil" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/plugins/content/local/writer.go b/plugins/content/local/writer.go index a3a4aa1c9..26cef0aae 100644 --- a/plugins/content/local/writer.go +++ b/plugins/content/local/writer.go @@ -27,7 +27,7 @@ import ( "time" "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/opencontainers/go-digest" ) diff --git a/plugins/diff/lcow/lcow.go b/plugins/diff/lcow/lcow.go index 9f87658e0..dec9bed12 100644 --- a/plugins/diff/lcow/lcow.go +++ b/plugins/diff/lcow/lcow.go @@ -34,8 +34,8 @@ import ( "github.com/containerd/containerd/v2/core/diff" "github.com/containerd/containerd/v2/core/metadata" "github.com/containerd/containerd/v2/core/mount" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/plugins" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" diff --git a/plugins/diff/walking/differ.go b/plugins/diff/walking/differ.go index ab7f14f50..92080b157 100644 --- a/plugins/diff/walking/differ.go +++ b/plugins/diff/walking/differ.go @@ -31,8 +31,8 @@ import ( "github.com/containerd/containerd/v2/pkg/archive" "github.com/containerd/containerd/v2/pkg/archive/compression" "github.com/containerd/containerd/v2/pkg/epoch" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/labels" + "github.com/containerd/errdefs" "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/plugins/diff/windows/cimfs.go b/plugins/diff/windows/cimfs.go index d4985ce0d..218b70336 100644 --- a/plugins/diff/windows/cimfs.go +++ b/plugins/diff/windows/cimfs.go @@ -29,8 +29,8 @@ import ( "github.com/containerd/containerd/v2/core/metadata" "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/pkg/archive" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/plugins" + "github.com/containerd/errdefs" "github.com/containerd/platforms" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" diff --git a/plugins/diff/windows/windows.go b/plugins/diff/windows/windows.go index d9fec7e12..35bd9efa8 100644 --- a/plugins/diff/windows/windows.go +++ b/plugins/diff/windows/windows.go @@ -35,9 +35,9 @@ import ( "github.com/containerd/containerd/v2/pkg/archive" "github.com/containerd/containerd/v2/pkg/archive/compression" "github.com/containerd/containerd/v2/pkg/epoch" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/labels" "github.com/containerd/containerd/v2/plugins" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/platforms" "github.com/containerd/plugin" diff --git a/plugins/metadata/plugin.go b/plugins/metadata/plugin.go index 3146e3f13..a77e6e142 100644 --- a/plugins/metadata/plugin.go +++ b/plugins/metadata/plugin.go @@ -25,10 +25,10 @@ import ( "github.com/containerd/containerd/v2/core/content" "github.com/containerd/containerd/v2/core/metadata" "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/events" "github.com/containerd/containerd/v2/pkg/timeout" "github.com/containerd/containerd/v2/plugins" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" diff --git a/plugins/sandbox/controller.go b/plugins/sandbox/controller.go index 1020bff73..fe2dcb4e7 100644 --- a/plugins/sandbox/controller.go +++ b/plugins/sandbox/controller.go @@ -27,10 +27,10 @@ import ( "github.com/containerd/containerd/v2/core/runtime" v2 "github.com/containerd/containerd/v2/core/runtime/v2" "github.com/containerd/containerd/v2/core/sandbox" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/events" "github.com/containerd/containerd/v2/pkg/events/exchange" "github.com/containerd/containerd/v2/plugins" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/platforms" "github.com/containerd/plugin" diff --git a/plugins/services/containers/local.go b/plugins/services/containers/local.go index 01b70e78e..3c79c1bad 100644 --- a/plugins/services/containers/local.go +++ b/plugins/services/containers/local.go @@ -24,11 +24,11 @@ import ( api "github.com/containerd/containerd/v2/api/services/containers/v1" "github.com/containerd/containerd/v2/core/containers" "github.com/containerd/containerd/v2/core/metadata" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/events" "github.com/containerd/containerd/v2/plugins" "github.com/containerd/containerd/v2/plugins/services" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" bolt "go.etcd.io/bbolt" diff --git a/plugins/services/content/contentserver/contentserver.go b/plugins/services/content/contentserver/contentserver.go index 130889efa..4099df18a 100644 --- a/plugins/services/content/contentserver/contentserver.go +++ b/plugins/services/content/contentserver/contentserver.go @@ -24,9 +24,9 @@ import ( api "github.com/containerd/containerd/v2/api/services/content/v1" "github.com/containerd/containerd/v2/core/content" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/protobuf" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/plugins/services/diff/local.go b/plugins/services/diff/local.go index c59c63379..4471c2fdd 100644 --- a/plugins/services/diff/local.go +++ b/plugins/services/diff/local.go @@ -23,10 +23,10 @@ import ( diffapi "github.com/containerd/containerd/v2/api/services/diff/v1" "github.com/containerd/containerd/v2/core/diff" "github.com/containerd/containerd/v2/core/mount" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/oci" "github.com/containerd/containerd/v2/plugins" "github.com/containerd/containerd/v2/plugins/services" + "github.com/containerd/errdefs" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" "github.com/containerd/typeurl/v2" diff --git a/plugins/services/events/service.go b/plugins/services/events/service.go index 0abdffd0a..3bea13467 100644 --- a/plugins/services/events/service.go +++ b/plugins/services/events/service.go @@ -22,12 +22,12 @@ import ( api "github.com/containerd/containerd/v2/api/services/events/v1" apittrpc "github.com/containerd/containerd/v2/api/services/ttrpc/events/v1" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/events" "github.com/containerd/containerd/v2/pkg/events/exchange" "github.com/containerd/containerd/v2/plugins" "github.com/containerd/containerd/v2/protobuf" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" "github.com/containerd/ttrpc" diff --git a/plugins/services/events/ttrpc.go b/plugins/services/events/ttrpc.go index 37a19d047..dc0d4f4fc 100644 --- a/plugins/services/events/ttrpc.go +++ b/plugins/services/events/ttrpc.go @@ -20,11 +20,11 @@ import ( "context" api "github.com/containerd/containerd/v2/api/services/ttrpc/events/v1" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/events" "github.com/containerd/containerd/v2/pkg/events/exchange" "github.com/containerd/containerd/v2/protobuf" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" ) type ttrpcService struct { diff --git a/plugins/services/images/local.go b/plugins/services/images/local.go index 80d2494b9..9adb90c8f 100644 --- a/plugins/services/images/local.go +++ b/plugins/services/images/local.go @@ -30,13 +30,13 @@ import ( "github.com/containerd/containerd/v2/core/metadata" "github.com/containerd/containerd/v2/pkg/deprecation" "github.com/containerd/containerd/v2/pkg/epoch" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/events" "github.com/containerd/containerd/v2/pkg/gc" "github.com/containerd/containerd/v2/plugins" "github.com/containerd/containerd/v2/plugins/services" "github.com/containerd/containerd/v2/plugins/services/warning" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" ) diff --git a/plugins/services/introspection/introspection.go b/plugins/services/introspection/introspection.go index 1ae0ad810..b455dc3ee 100644 --- a/plugins/services/introspection/introspection.go +++ b/plugins/services/introspection/introspection.go @@ -20,8 +20,8 @@ import ( context "context" api "github.com/containerd/containerd/v2/api/services/introspection/v1" - "github.com/containerd/containerd/v2/pkg/errdefs" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/log" ) diff --git a/plugins/services/introspection/local.go b/plugins/services/introspection/local.go index 65a77e267..29f261d9e 100644 --- a/plugins/services/introspection/local.go +++ b/plugins/services/introspection/local.go @@ -33,13 +33,13 @@ import ( api "github.com/containerd/containerd/v2/api/services/introspection/v1" "github.com/containerd/containerd/v2/api/types" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/filters" "github.com/containerd/containerd/v2/plugins" "github.com/containerd/containerd/v2/plugins/services" "github.com/containerd/containerd/v2/plugins/services/warning" "github.com/containerd/containerd/v2/protobuf" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" "github.com/containerd/typeurl/v2" diff --git a/plugins/services/leases/service.go b/plugins/services/leases/service.go index 38d0b0aeb..813a1b8c0 100644 --- a/plugins/services/leases/service.go +++ b/plugins/services/leases/service.go @@ -21,10 +21,10 @@ import ( api "github.com/containerd/containerd/v2/api/services/leases/v1" "github.com/containerd/containerd/v2/core/leases" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/plugins" "github.com/containerd/containerd/v2/protobuf" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" "google.golang.org/grpc" diff --git a/plugins/services/namespaces/local.go b/plugins/services/namespaces/local.go index 4451790e6..7ca6f0f2d 100644 --- a/plugins/services/namespaces/local.go +++ b/plugins/services/namespaces/local.go @@ -23,12 +23,12 @@ import ( eventstypes "github.com/containerd/containerd/v2/api/events" api "github.com/containerd/containerd/v2/api/services/namespaces/v1" "github.com/containerd/containerd/v2/core/metadata" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/events" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/plugins" "github.com/containerd/containerd/v2/plugins/services" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" bolt "go.etcd.io/bbolt" diff --git a/plugins/services/sandbox/controller_service.go b/plugins/services/sandbox/controller_service.go index 3909f7be1..f9581d552 100644 --- a/plugins/services/sandbox/controller_service.go +++ b/plugins/services/sandbox/controller_service.go @@ -27,10 +27,10 @@ import ( eventtypes "github.com/containerd/containerd/v2/api/events" api "github.com/containerd/containerd/v2/api/services/sandbox/v1" "github.com/containerd/containerd/v2/core/sandbox" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/events" "github.com/containerd/containerd/v2/plugins" "github.com/containerd/containerd/v2/protobuf" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" diff --git a/plugins/services/sandbox/store_service.go b/plugins/services/sandbox/store_service.go index e6e761450..65ef21b0e 100644 --- a/plugins/services/sandbox/store_service.go +++ b/plugins/services/sandbox/store_service.go @@ -24,8 +24,8 @@ import ( api "github.com/containerd/containerd/v2/api/services/sandbox/v1" "github.com/containerd/containerd/v2/api/types" "github.com/containerd/containerd/v2/core/sandbox" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/plugins" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" diff --git a/plugins/services/snapshots/service.go b/plugins/services/snapshots/service.go index 6356d685a..f0de4a976 100644 --- a/plugins/services/snapshots/service.go +++ b/plugins/services/snapshots/service.go @@ -22,10 +22,10 @@ import ( snapshotsapi "github.com/containerd/containerd/v2/api/services/snapshots/v1" "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/core/snapshots" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/plugins" "github.com/containerd/containerd/v2/plugins/services" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" diff --git a/plugins/services/streaming/service.go b/plugins/services/streaming/service.go index f8224fec1..e65f63106 100644 --- a/plugins/services/streaming/service.go +++ b/plugins/services/streaming/service.go @@ -21,11 +21,11 @@ import ( "io" api "github.com/containerd/containerd/v2/api/services/streaming/v1" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/streaming" "github.com/containerd/containerd/v2/plugins" "github.com/containerd/containerd/v2/protobuf" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" diff --git a/plugins/services/tasks/local.go b/plugins/services/tasks/local.go index ee64c88d6..25224d340 100644 --- a/plugins/services/tasks/local.go +++ b/plugins/services/tasks/local.go @@ -38,7 +38,6 @@ import ( "github.com/containerd/containerd/v2/core/runtime/v2/runc/options" "github.com/containerd/containerd/v2/pkg/archive" "github.com/containerd/containerd/v2/pkg/blockio" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/events" "github.com/containerd/containerd/v2/pkg/filters" "github.com/containerd/containerd/v2/pkg/rdt" @@ -48,6 +47,7 @@ import ( "github.com/containerd/containerd/v2/protobuf" "github.com/containerd/containerd/v2/protobuf/proto" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" diff --git a/plugins/services/transfer/service.go b/plugins/services/transfer/service.go index cface0dda..8d921dbaa 100644 --- a/plugins/services/transfer/service.go +++ b/plugins/services/transfer/service.go @@ -22,13 +22,13 @@ import ( transferapi "github.com/containerd/containerd/v2/api/services/transfer/v1" "github.com/containerd/containerd/v2/api/types" transferTypes "github.com/containerd/containerd/v2/api/types/transfer" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/oci" "github.com/containerd/containerd/v2/pkg/streaming" "github.com/containerd/containerd/v2/pkg/transfer" tplugins "github.com/containerd/containerd/v2/pkg/transfer/plugins" "github.com/containerd/containerd/v2/plugins" ptypes "github.com/containerd/containerd/v2/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" diff --git a/plugins/snapshots/devmapper/metadata.go b/plugins/snapshots/devmapper/metadata.go index 81f467373..f6dc0e3fb 100644 --- a/plugins/snapshots/devmapper/metadata.go +++ b/plugins/snapshots/devmapper/metadata.go @@ -25,7 +25,7 @@ import ( "fmt" "strconv" - "github.com/containerd/containerd/v2/pkg/errdefs" + "github.com/containerd/errdefs" bolt "go.etcd.io/bbolt" ) diff --git a/plugins/snapshots/devmapper/snapshotter.go b/plugins/snapshots/devmapper/snapshotter.go index 5b0199db5..650b79de0 100644 --- a/plugins/snapshots/devmapper/snapshotter.go +++ b/plugins/snapshots/devmapper/snapshotter.go @@ -31,8 +31,8 @@ import ( "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/core/snapshots" "github.com/containerd/containerd/v2/core/snapshots/storage" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/plugins/snapshots/devmapper/dmsetup" + "github.com/containerd/errdefs" "github.com/containerd/log" ) diff --git a/plugins/snapshots/lcow/lcow.go b/plugins/snapshots/lcow/lcow.go index 43808275c..78d4bc498 100644 --- a/plugins/snapshots/lcow/lcow.go +++ b/plugins/snapshots/lcow/lcow.go @@ -37,9 +37,9 @@ import ( "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/core/snapshots" "github.com/containerd/containerd/v2/core/snapshots/storage" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/plugins" "github.com/containerd/continuity/fs" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" diff --git a/plugins/snapshots/windows/cimfs.go b/plugins/snapshots/windows/cimfs.go index f60214267..b5b979161 100644 --- a/plugins/snapshots/windows/cimfs.go +++ b/plugins/snapshots/windows/cimfs.go @@ -32,8 +32,8 @@ import ( "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/core/snapshots" "github.com/containerd/containerd/v2/core/snapshots/storage" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/plugins" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/platforms" "github.com/containerd/plugin" diff --git a/plugins/snapshots/windows/windows.go b/plugins/snapshots/windows/windows.go index 87588eac2..9c6130b6d 100644 --- a/plugins/snapshots/windows/windows.go +++ b/plugins/snapshots/windows/windows.go @@ -32,9 +32,9 @@ import ( "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/core/snapshots" "github.com/containerd/containerd/v2/core/snapshots/storage" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/plugins" "github.com/containerd/continuity/fs" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/platforms" "github.com/containerd/plugin" diff --git a/plugins/streaming/manager.go b/plugins/streaming/manager.go index 4548c7d75..8a3cddffb 100644 --- a/plugins/streaming/manager.go +++ b/plugins/streaming/manager.go @@ -23,11 +23,11 @@ import ( "github.com/containerd/containerd/v2/core/leases" "github.com/containerd/containerd/v2/core/metadata" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/gc" "github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/pkg/streaming" "github.com/containerd/containerd/v2/plugins" + "github.com/containerd/errdefs" "github.com/containerd/plugin" "github.com/containerd/plugin/registry" ) diff --git a/plugins/transfer/plugin.go b/plugins/transfer/plugin.go index a3ea0d183..5737b2936 100644 --- a/plugins/transfer/plugin.go +++ b/plugins/transfer/plugin.go @@ -23,11 +23,11 @@ import ( "github.com/containerd/containerd/v2/core/leases" "github.com/containerd/containerd/v2/core/metadata" "github.com/containerd/containerd/v2/defaults" - "github.com/containerd/containerd/v2/pkg/errdefs" "github.com/containerd/containerd/v2/pkg/imageverifier" "github.com/containerd/containerd/v2/pkg/transfer/local" "github.com/containerd/containerd/v2/pkg/unpack" "github.com/containerd/containerd/v2/plugins" + "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/platforms" "github.com/containerd/plugin" diff --git a/vendor/github.com/containerd/errdefs/LICENSE b/vendor/github.com/containerd/errdefs/LICENSE new file mode 100644 index 000000000..584149b6e --- /dev/null +++ b/vendor/github.com/containerd/errdefs/LICENSE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright The containerd Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/containerd/errdefs/README.md b/vendor/github.com/containerd/errdefs/README.md new file mode 100644 index 000000000..bd418c63f --- /dev/null +++ b/vendor/github.com/containerd/errdefs/README.md @@ -0,0 +1,13 @@ +# errdefs + +A Go package for defining and checking common containerd errors. + +## Project details + +**errdefs** is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE). +As a containerd sub-project, you will find the: + * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md), + * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS), + * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md) + +information in our [`containerd/project`](https://github.com/containerd/project) repository. diff --git a/vendor/github.com/containerd/errdefs/errors.go b/vendor/github.com/containerd/errdefs/errors.go new file mode 100644 index 000000000..876225597 --- /dev/null +++ b/vendor/github.com/containerd/errdefs/errors.go @@ -0,0 +1,92 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// Package errdefs defines the common errors used throughout containerd +// packages. +// +// Use with fmt.Errorf to add context to an error. +// +// To detect an error class, use the IsXXX functions to tell whether an error +// is of a certain type. +// +// The functions ToGRPC and FromGRPC can be used to map server-side and +// client-side errors to the correct types. +package errdefs + +import ( + "context" + "errors" +) + +// Definitions of common error types used throughout containerd. All containerd +// errors returned by most packages will map into one of these errors classes. +// Packages should return errors of these types when they want to instruct a +// client to take a particular action. +// +// For the most part, we just try to provide local grpc errors. Most conditions +// map very well to those defined by grpc. +var ( + ErrUnknown = errors.New("unknown") // used internally to represent a missed mapping. + ErrInvalidArgument = errors.New("invalid argument") + ErrNotFound = errors.New("not found") + ErrAlreadyExists = errors.New("already exists") + ErrFailedPrecondition = errors.New("failed precondition") + ErrUnavailable = errors.New("unavailable") + ErrNotImplemented = errors.New("not implemented") // represents not supported and unimplemented +) + +// IsInvalidArgument returns true if the error is due to an invalid argument +func IsInvalidArgument(err error) bool { + return errors.Is(err, ErrInvalidArgument) +} + +// IsNotFound returns true if the error is due to a missing object +func IsNotFound(err error) bool { + return errors.Is(err, ErrNotFound) +} + +// IsAlreadyExists returns true if the error is due to an already existing +// metadata item +func IsAlreadyExists(err error) bool { + return errors.Is(err, ErrAlreadyExists) +} + +// IsFailedPrecondition returns true if an operation could not proceed to the +// lack of a particular condition +func IsFailedPrecondition(err error) bool { + return errors.Is(err, ErrFailedPrecondition) +} + +// IsUnavailable returns true if the error is due to a resource being unavailable +func IsUnavailable(err error) bool { + return errors.Is(err, ErrUnavailable) +} + +// IsNotImplemented returns true if the error is due to not being implemented +func IsNotImplemented(err error) bool { + return errors.Is(err, ErrNotImplemented) +} + +// IsCanceled returns true if the error is due to `context.Canceled`. +func IsCanceled(err error) bool { + return errors.Is(err, context.Canceled) +} + +// IsDeadlineExceeded returns true if the error is due to +// `context.DeadlineExceeded`. +func IsDeadlineExceeded(err error) bool { + return errors.Is(err, context.DeadlineExceeded) +} diff --git a/vendor/github.com/containerd/errdefs/grpc.go b/vendor/github.com/containerd/errdefs/grpc.go new file mode 100644 index 000000000..7a9b33e05 --- /dev/null +++ b/vendor/github.com/containerd/errdefs/grpc.go @@ -0,0 +1,147 @@ +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package errdefs + +import ( + "context" + "fmt" + "strings" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// ToGRPC will attempt to map the backend containerd error into a grpc error, +// using the original error message as a description. +// +// Further information may be extracted from certain errors depending on their +// type. +// +// If the error is unmapped, the original error will be returned to be handled +// by the regular grpc error handling stack. +func ToGRPC(err error) error { + if err == nil { + return nil + } + + if isGRPCError(err) { + // error has already been mapped to grpc + return err + } + + switch { + case IsInvalidArgument(err): + return status.Errorf(codes.InvalidArgument, err.Error()) + case IsNotFound(err): + return status.Errorf(codes.NotFound, err.Error()) + case IsAlreadyExists(err): + return status.Errorf(codes.AlreadyExists, err.Error()) + case IsFailedPrecondition(err): + return status.Errorf(codes.FailedPrecondition, err.Error()) + case IsUnavailable(err): + return status.Errorf(codes.Unavailable, err.Error()) + case IsNotImplemented(err): + return status.Errorf(codes.Unimplemented, err.Error()) + case IsCanceled(err): + return status.Errorf(codes.Canceled, err.Error()) + case IsDeadlineExceeded(err): + return status.Errorf(codes.DeadlineExceeded, err.Error()) + } + + return err +} + +// ToGRPCf maps the error to grpc error codes, assembling the formatting string +// and combining it with the target error string. +// +// This is equivalent to errdefs.ToGRPC(fmt.Errorf("%s: %w", fmt.Sprintf(format, args...), err)) +func ToGRPCf(err error, format string, args ...interface{}) error { + return ToGRPC(fmt.Errorf("%s: %w", fmt.Sprintf(format, args...), err)) +} + +// FromGRPC returns the underlying error from a grpc service based on the grpc error code +func FromGRPC(err error) error { + if err == nil { + return nil + } + + var cls error // divide these into error classes, becomes the cause + + switch code(err) { + case codes.InvalidArgument: + cls = ErrInvalidArgument + case codes.AlreadyExists: + cls = ErrAlreadyExists + case codes.NotFound: + cls = ErrNotFound + case codes.Unavailable: + cls = ErrUnavailable + case codes.FailedPrecondition: + cls = ErrFailedPrecondition + case codes.Unimplemented: + cls = ErrNotImplemented + case codes.Canceled: + cls = context.Canceled + case codes.DeadlineExceeded: + cls = context.DeadlineExceeded + default: + cls = ErrUnknown + } + + msg := rebaseMessage(cls, err) + if msg != "" { + err = fmt.Errorf("%s: %w", msg, cls) + } else { + err = cls + } + + return err +} + +// rebaseMessage removes the repeats for an error at the end of an error +// string. This will happen when taking an error over grpc then remapping it. +// +// Effectively, we just remove the string of cls from the end of err if it +// appears there. +func rebaseMessage(cls error, err error) string { + desc := errDesc(err) + clss := cls.Error() + if desc == clss { + return "" + } + + return strings.TrimSuffix(desc, ": "+clss) +} + +func isGRPCError(err error) bool { + _, ok := status.FromError(err) + return ok +} + +func code(err error) codes.Code { + if s, ok := status.FromError(err); ok { + return s.Code() + } + return codes.Unknown +} + +func errDesc(err error) string { + if s, ok := status.FromError(err); ok { + return s.Message() + } + return err.Error() +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 962f4a870..3559ca6c1 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -115,6 +115,9 @@ github.com/containerd/continuity/proto github.com/containerd/continuity/sysx github.com/containerd/continuity/testutil github.com/containerd/continuity/testutil/loopback +# github.com/containerd/errdefs v0.1.0 +## explicit; go 1.20 +github.com/containerd/errdefs # github.com/containerd/fifo v1.1.0 ## explicit; go 1.18 github.com/containerd/fifo