Skip to content

Commit

Permalink
Merge pull request #5195 from thaJeztah/0.15_backport_fix_wrong_errdefs
Browse files Browse the repository at this point in the history
[0.15 backport] snapshot/containerd: fix wrong errdefs package import
  • Loading branch information
AkihiroSuda authored Jul 30, 2024
2 parents 979542e + f3ed463 commit 509c08c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 54 deletions.
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ linters-settings:
desc: The containerd log package was migrated to a separate module. Use github.com/containerd/log instead.
- pkg: "github.com/containerd/containerd/platforms"
desc: The containerd platforms package was migrated to a separate module. Use github.com/containerd/platforms instead.
- pkg: "github.com/containerd/nydus-snapshotter/pkg/errdefs"
desc: You probably meant to use github.com/containerd/errdefs
- pkg: "github.com/opencontainers/runc/libcontainer/userns"
desc: Use github.com/moby/sys/user/userns instead.
- pkg: "io/ioutil"
desc: The io/ioutil package has been deprecated.
forbidigo:
Expand Down
6 changes: 3 additions & 3 deletions snapshot/containerd/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/containerd/containerd/content"
"github.com/containerd/containerd/namespaces"
"github.com/containerd/nydus-snapshotter/pkg/errdefs"
cerrdefs "github.com/containerd/errdefs"
digest "github.com/opencontainers/go-digest"
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
Expand Down Expand Up @@ -103,7 +103,7 @@ var _ content.Store = &nsFallbackStore{}
func (c *nsFallbackStore) Info(ctx context.Context, dgst digest.Digest) (content.Info, error) {
info, err := c.main.Info(ctx, dgst)
if err != nil {
if errdefs.IsNotFound(err) {
if cerrdefs.IsNotFound(err) {
return c.fb.Info(ctx, dgst)
}
}
Expand Down Expand Up @@ -137,7 +137,7 @@ func (c *nsFallbackStore) Abort(ctx context.Context, ref string) error {
func (c *nsFallbackStore) ReaderAt(ctx context.Context, desc ocispecs.Descriptor) (content.ReaderAt, error) {
ra, err := c.main.ReaderAt(ctx, desc)
if err != nil {
if errdefs.IsNotFound(err) {
if cerrdefs.IsNotFound(err) {
return c.fb.ReaderAt(ctx, desc)
}
}
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ github.com/containerd/log
## explicit; go 1.19
github.com/containerd/nydus-snapshotter/pkg/converter
github.com/containerd/nydus-snapshotter/pkg/converter/tool
github.com/containerd/nydus-snapshotter/pkg/errdefs
github.com/containerd/nydus-snapshotter/pkg/label
# github.com/containerd/platforms v0.2.1
## explicit; go 1.20
Expand Down

0 comments on commit 509c08c

Please sign in to comment.