Skip to content

Commit

Permalink
switch to github.com/containerd/errdefs module
Browse files Browse the repository at this point in the history
containerd 1.7.18 and up alias the errdefs package to the new module,
and deprecate the package.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Jul 24, 2024
1 parent e5134df commit c4b7da6
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ linters-settings:
rules:
main:
deny:
- pkg: "github.com/containerd/containerd/errdefs"
desc: The containerd errdefs package was migrated to a separate module. Use github.com/containerd/errdefs instead.
- pkg: "github.com/containerd/containerd/log"
desc: The containerd log package was migrated to a separate module. Use github.com/containerd/log instead.
# govet:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ require (
github.com/containerd/cgroups/v3 v3.0.2
github.com/containerd/containerd v1.7.18
github.com/containerd/continuity v0.4.2
github.com/containerd/errdefs v0.1.0
github.com/containerd/fifo v1.1.0
github.com/containerd/log v0.1.0
github.com/containerd/nri v0.6.1
Expand Down Expand Up @@ -78,7 +79,6 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cilium/ebpf v0.9.1 // indirect
github.com/containerd/errdefs v0.1.0 // indirect
github.com/containerd/ttrpc v1.2.4 // indirect
github.com/containerd/typeurl/v2 v2.1.1 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion pkg/backend/localfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"path"

"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/errdefs"
"github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion pkg/backend/oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

"github.com/aliyun/aliyun-oss-go-sdk/oss"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/errdefs"
"github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion pkg/backend/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/errdefs"
"github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion pkg/converter/convert_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import (
"github.com/containerd/containerd/archive/compression"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/content/local"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/images/converter"
"github.com/containerd/containerd/labels"
"github.com/containerd/errdefs"
"github.com/containerd/fifo"
"github.com/klauspost/compress/zstd"
"github.com/opencontainers/go-digest"
Expand Down
2 changes: 1 addition & 1 deletion pkg/encryption/encryption.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"math/rand"

"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
"github.com/containerd/errdefs"

"github.com/containers/ocicrypt"
encconfig "github.com/containers/ocicrypt/config"
Expand Down
2 changes: 1 addition & 1 deletion pkg/errdefs/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"net"
"syscall"

"github.com/containerd/containerd/errdefs"
"github.com/containerd/errdefs"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/rafs/rafs.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/mohae/deepcopy"
"github.com/pkg/errors"

"github.com/containerd/containerd/errdefs"
"github.com/containerd/errdefs"

"github.com/containerd/nydus-snapshotter/config"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/remote/remotes/docker/authorizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"strings"
"sync"

"github.com/containerd/containerd/errdefs"
"github.com/containerd/errdefs"
"github.com/containerd/log"
"github.com/containerd/nydus-snapshotter/pkg/remote/remotes/docker/auth"
remoteerrors "github.com/containerd/nydus-snapshotter/pkg/remote/remotes/errors"
Expand Down
2 changes: 1 addition & 1 deletion pkg/remote/remotes/docker/config/hosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"strings"
"time"

"github.com/containerd/containerd/errdefs"
"github.com/containerd/errdefs"
"github.com/containerd/log"
"github.com/containerd/nydus-snapshotter/pkg/remote/remotes/docker"
"github.com/pelletier/go-toml"
Expand Down
2 changes: 1 addition & 1 deletion pkg/remote/remotes/docker/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"net/url"
"strings"

"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
"github.com/containerd/errdefs"
"github.com/containerd/log"
digest "github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/remote/remotes/docker/httpreadseeker.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"fmt"
"io"

"github.com/containerd/containerd/errdefs"
"github.com/containerd/errdefs"
"github.com/containerd/log"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/remote/remotes/docker/pusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (
"time"

"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
"github.com/containerd/errdefs"
"github.com/containerd/log"
"github.com/containerd/nydus-snapshotter/pkg/remote/remotes"
remoteserrors "github.com/containerd/nydus-snapshotter/pkg/remote/remotes/errors"
Expand Down
2 changes: 1 addition & 1 deletion pkg/remote/remotes/docker/pusher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"testing"

"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/errdefs"
"github.com/containerd/nydus-snapshotter/pkg/remote/remotes"
"github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/remote/remotes/docker/referrers.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"net/http"
"strings"

"github.com/containerd/containerd/errdefs"
"github.com/containerd/errdefs"
"github.com/containerd/log"
digest "github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/remote/remotes/docker/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ import (
"path"
"strings"

"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/reference"
"github.com/containerd/containerd/tracing"
"github.com/containerd/containerd/version"
"github.com/containerd/errdefs"
"github.com/containerd/log"
"github.com/containerd/nydus-snapshotter/pkg/remote/remotes"
"github.com/containerd/nydus-snapshotter/pkg/remote/remotes/docker/schema1" //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility.
Expand Down
2 changes: 1 addition & 1 deletion pkg/remote/remotes/docker/schema1/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ import (

"github.com/containerd/containerd/archive/compression"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/labels"
"github.com/containerd/errdefs"
"github.com/containerd/log"
"github.com/containerd/nydus-snapshotter/pkg/remote/remotes"
digest "github.com/opencontainers/go-digest"
Expand Down
2 changes: 1 addition & 1 deletion pkg/remote/remotes/docker/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"sync"

"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/errdefs"
"github.com/moby/locker"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/remote/remotes/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import (
"sync"

"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/labels"
"github.com/containerd/containerd/platforms"
"github.com/containerd/errdefs"
"github.com/containerd/log"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"golang.org/x/sync/semaphore"
Expand Down

0 comments on commit c4b7da6

Please sign in to comment.