diff --git a/.golangci.yml b/.golangci.yml index 52ad1e3a9..bf69a17ad 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -48,8 +48,10 @@ linters-settings: rules: main: deny: - # The io/ioutil package has been deprecated. - # https://go.dev/doc/go1.16#ioutil + - 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. - pkg: "io/ioutil" desc: The io/ioutil package has been deprecated. forbidigo: @@ -62,10 +64,16 @@ linters-settings: - '^ctx\.Err(# use context\.Cause instead)?$' importas: alias: + # Enforce alias to prevent it accidentally being used instead of our + # own errdefs package (or vice-versa). + - pkg: "github.com/containerd/errdefs" + alias: "cerrdefs" - pkg: "github.com/opencontainers/image-spec/specs-go/v1" alias: "ocispecs" - pkg: "github.com/opencontainers/go-digest" alias: "digest" + + # Do not allow unaliased imports of aliased packages. no-unaliased: true gosec: excludes: diff --git a/cache/blobs_linux.go b/cache/blobs_linux.go index 99fc756cb..aeda7a7c8 100644 --- a/cache/blobs_linux.go +++ b/cache/blobs_linux.go @@ -9,9 +9,9 @@ import ( "io" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" labelspkg "github.com/containerd/containerd/labels" "github.com/containerd/containerd/mount" + cerrdefs "github.com/containerd/errdefs" "github.com/moby/buildkit/util/bklog" "github.com/moby/buildkit/util/compression" "github.com/moby/buildkit/util/overlay" @@ -98,7 +98,7 @@ func (sr *immutableRef) tryComputeOverlayBlob(ctx context.Context, lower, upper } dgst := cw.Digest() if err := cw.Commit(ctx, 0, dgst, commitopts...); err != nil { - if !errdefs.IsAlreadyExists(err) { + if !cerrdefs.IsAlreadyExists(err) { return emptyDesc, false, errors.Wrap(err, "failed to commit") } } diff --git a/cache/compression_nydus.go b/cache/compression_nydus.go index b50d7971f..3dfdaef16 100644 --- a/cache/compression_nydus.go +++ b/cache/compression_nydus.go @@ -9,8 +9,8 @@ import ( "io" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/labels" + cerrdefs "github.com/containerd/errdefs" "github.com/moby/buildkit/session" "github.com/moby/buildkit/util/compression" digest "github.com/opencontainers/go-digest" @@ -95,7 +95,7 @@ func MergeNydus(ctx context.Context, ref ImmutableRef, comp compression.Config, if err := cw.Commit(ctx, 0, compressedDgst, content.WithLabels(map[string]string{ labels.LabelUncompressed: uncompressedDgst.Digest().String(), })); err != nil { - if !errdefs.IsAlreadyExists(err) { + if !cerrdefs.IsAlreadyExists(err) { return nil, errors.Wrap(err, "commit to content store") } } diff --git a/cache/manager.go b/cache/manager.go index 32307d8c6..9f7d4f062 100644 --- a/cache/manager.go +++ b/cache/manager.go @@ -10,11 +10,11 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/diff" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/filters" "github.com/containerd/containerd/gc" "github.com/containerd/containerd/labels" "github.com/containerd/containerd/leases" + cerrdefs "github.com/containerd/errdefs" "github.com/docker/docker/pkg/idtools" "github.com/moby/buildkit/cache/metadata" "github.com/moby/buildkit/client" @@ -137,7 +137,7 @@ func (cm *cacheManager) GetByBlob(ctx context.Context, desc ocispecs.Descriptor, descHandlers := descHandlersOf(opts...) if desc.Digest != "" && (descHandlers == nil || descHandlers[desc.Digest] == nil) { - if _, err := cm.ContentStore.Info(ctx, desc.Digest); errors.Is(err, errdefs.ErrNotFound) { + if _, err := cm.ContentStore.Info(ctx, desc.Digest); errors.Is(err, cerrdefs.ErrNotFound) { return nil, NeedsRemoteProviderError([]digest.Digest{desc.Digest}) } else if err != nil { return nil, err @@ -253,7 +253,7 @@ func (cm *cacheManager) GetByBlob(ctx context.Context, desc ocispecs.Descriptor, if err := cm.LeaseManager.AddResource(ctx, l, leases.Resource{ ID: snapshotID, Type: "snapshots/" + cm.Snapshotter.Name(), - }); err != nil && !errdefs.IsAlreadyExists(err) { + }); err != nil && !cerrdefs.IsAlreadyExists(err) { return nil, errors.Wrapf(err, "failed to add snapshot %s to lease", id) } @@ -484,7 +484,7 @@ func (cm *cacheManager) getRecord(ctx context.Context, id string, opts ...RefOpt if rec.mutable { // If the record is mutable, then the snapshot must exist if _, err := cm.Snapshotter.Stat(ctx, rec.ID()); err != nil { - if !errdefs.IsNotFound(err) { + if !cerrdefs.IsNotFound(err) { return nil, errors.Wrap(err, "failed to check mutable ref snapshot") } // the snapshot doesn't exist, clear this record @@ -609,7 +609,7 @@ func (cm *cacheManager) New(ctx context.Context, s ImmutableRef, sess session.Gr if err := cm.LeaseManager.AddResource(ctx, l, leases.Resource{ ID: snapshotID, Type: "snapshots/" + cm.Snapshotter.Name(), - }); err != nil && !errdefs.IsAlreadyExists(err) { + }); err != nil && !cerrdefs.IsAlreadyExists(err) { return nil, errors.Wrapf(err, "failed to add snapshot %s to lease", snapshotID) } diff --git a/cache/manager_test.go b/cache/manager_test.go index f59518e98..733d524c8 100644 --- a/cache/manager_test.go +++ b/cache/manager_test.go @@ -24,7 +24,6 @@ import ( "github.com/containerd/containerd/content/local" "github.com/containerd/containerd/diff/apply" "github.com/containerd/containerd/diff/walking" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/labels" "github.com/containerd/containerd/leases" ctdmetadata "github.com/containerd/containerd/metadata" @@ -33,6 +32,7 @@ import ( "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots/native" "github.com/containerd/continuity/fs/fstest" + cerrdefs "github.com/containerd/errdefs" "github.com/containerd/stargz-snapshotter/estargz" "github.com/klauspost/compress/zstd" "github.com/moby/buildkit/cache/config" @@ -1196,7 +1196,7 @@ func TestLoopLeaseContent(t *testing.T) { dgst := cur.Digest visited[dgst] = struct{}{} info, err := co.cs.Info(ctx, dgst) - if err != nil && !errors.Is(err, errdefs.ErrNotFound) { + if err != nil && !errors.Is(err, cerrdefs.ErrNotFound) { require.NoError(t, err) } var children []ocispecs.Descriptor @@ -1232,7 +1232,7 @@ func TestLoopLeaseContent(t *testing.T) { // Check if contents are cleaned up for _, d := range gotChain { _, err := co.cs.Info(ctx, d) - require.ErrorIs(t, err, errdefs.ErrNotFound) + require.ErrorIs(t, err, cerrdefs.ErrNotFound) } } @@ -2005,7 +2005,7 @@ func checkDescriptor(ctx context.Context, t *testing.T, cs content.Store, desc o // Check annotation values are valid c := new(iohelper.Counter) ra, err := cs.ReaderAt(ctx, desc) - if err != nil && errdefs.IsNotFound(err) { + if err != nil && cerrdefs.IsNotFound(err) { return // lazy layer } require.NoError(t, err) diff --git a/cache/migrate_v2.go b/cache/migrate_v2.go index 803b0173a..327cfd674 100644 --- a/cache/migrate_v2.go +++ b/cache/migrate_v2.go @@ -7,10 +7,10 @@ import ( "time" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/leases" "github.com/containerd/containerd/snapshots" + cerrdefs "github.com/containerd/errdefs" "github.com/moby/buildkit/cache/metadata" "github.com/moby/buildkit/snapshot" "github.com/moby/buildkit/util/bklog" @@ -185,7 +185,7 @@ func MigrateV2(ctx context.Context, from, to string, cs content.Store, s snapsho }) if err != nil { // if we are running the migration twice - if errors.Is(err, errdefs.ErrAlreadyExists) { + if errors.Is(err, cerrdefs.ErrAlreadyExists) { continue } return errors.Wrap(err, "failed to create lease") @@ -216,7 +216,7 @@ func MigrateV2(ctx context.Context, from, to string, cs content.Store, s snapsho if _, err := s.Update(ctx, snapshots.Info{ Name: md.getSnapshotID(), }, "labels.containerd.io/gc.root"); err != nil { - if !errors.Is(err, errdefs.ErrNotFound) { + if !errors.Is(err, cerrdefs.ErrNotFound) { return err } } @@ -237,7 +237,7 @@ func MigrateV2(ctx context.Context, from, to string, cs content.Store, s snapsho if _, err := s.Update(ctx, snapshots.Info{ Name: info.Name, }, "labels.containerd.io/gc.root"); err != nil { - if !errors.Is(err, errdefs.ErrNotFound) { + if !errors.Is(err, cerrdefs.ErrNotFound) { return err } } diff --git a/cache/refs.go b/cache/refs.go index 72ec91616..f22478913 100644 --- a/cache/refs.go +++ b/cache/refs.go @@ -10,13 +10,13 @@ import ( "time" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/labels" "github.com/containerd/containerd/leases" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/userns" "github.com/containerd/containerd/snapshots" + cerrdefs "github.com/containerd/errdefs" "github.com/docker/docker/pkg/idtools" "github.com/hashicorp/go-multierror" "github.com/moby/buildkit/cache/config" @@ -292,7 +292,7 @@ func (cr *cacheRecord) isLazy(ctx context.Context) (bool, error) { return false, nil } _, err := cr.cm.ContentStore.Info(ctx, dgst) - if errors.Is(err, errdefs.ErrNotFound) { + if errors.Is(err, cerrdefs.ErrNotFound) { return true, nil } else if err != nil { return false, err @@ -349,7 +349,7 @@ func (cr *cacheRecord) size(ctx context.Context) (int64, error) { if isDead { return 0, nil } - if !errors.Is(err, errdefs.ErrNotFound) { + if !errors.Is(err, cerrdefs.ErrNotFound) { return s, errors.Wrapf(err, "failed to get usage for %s", cr.ID()) } } @@ -401,7 +401,7 @@ func (cr *cacheRecord) mount(ctx context.Context) (_ snapshot.Mountable, rerr er "containerd.io/gc.flat": time.Now().UTC().Format(time.RFC3339Nano), } return nil - }, leaseutil.MakeTemporary); err != nil && !errdefs.IsAlreadyExists(err) { + }, leaseutil.MakeTemporary); err != nil && !cerrdefs.IsAlreadyExists(err) { return nil, err } defer func() { @@ -412,14 +412,14 @@ func (cr *cacheRecord) mount(ctx context.Context) (_ snapshot.Mountable, rerr er if err := cr.cm.LeaseManager.AddResource(ctx, leases.Lease{ID: cr.viewLeaseID()}, leases.Resource{ ID: mountSnapshotID, Type: "snapshots/" + cr.cm.Snapshotter.Name(), - }); err != nil && !errdefs.IsAlreadyExists(err) { + }); err != nil && !cerrdefs.IsAlreadyExists(err) { return nil, err } // Return the mount direct from View rather than setting it using the Mounts call below. // The two are equivalent for containerd snapshotters but the moby snapshotter requires // the use of the mountable returned by View in this case. mnts, err := cr.cm.Snapshotter.View(ctx, mountSnapshotID, cr.getSnapshotID()) - if err != nil && !errdefs.IsAlreadyExists(err) { + if err != nil && !cerrdefs.IsAlreadyExists(err) { return nil, err } cr.mountCache = mnts @@ -455,12 +455,12 @@ func (cr *cacheRecord) remove(ctx context.Context, removeSnapshot bool) (rerr er if removeSnapshot { if err := cr.cm.LeaseManager.Delete(ctx, leases.Lease{ ID: cr.ID(), - }); err != nil && !errdefs.IsNotFound(err) { + }); err != nil && !cerrdefs.IsNotFound(err) { return errors.Wrapf(err, "failed to delete lease for %s", cr.ID()) } if err := cr.cm.LeaseManager.Delete(ctx, leases.Lease{ ID: cr.compressionVariantsLeaseID(), - }); err != nil && !errdefs.IsNotFound(err) { + }); err != nil && !cerrdefs.IsNotFound(err) { return errors.Wrapf(err, "failed to delete compression variant lease for %s", cr.ID()) } } @@ -764,7 +764,7 @@ func (sr *immutableRef) linkBlob(ctx context.Context, desc ocispecs.Descriptor) l.ID = sr.compressionVariantsLeaseID() // do not make it flat lease to allow linking blobs using gc label return nil - }); err != nil && !errdefs.IsAlreadyExists(err) { + }); err != nil && !cerrdefs.IsAlreadyExists(err) { return err } if err := sr.cm.LeaseManager.AddResource(ctx, leases.Lease{ID: sr.compressionVariantsLeaseID()}, leases.Resource{ @@ -828,7 +828,7 @@ func getBlobWithCompression(ctx context.Context, cs content.Store, desc ocispecs } return true }); err != nil || target == nil { - return ocispecs.Descriptor{}, errdefs.ErrNotFound + return ocispecs.Descriptor{}, cerrdefs.ErrNotFound } return *target, nil } @@ -849,7 +849,7 @@ func walkBlobVariantsOnly(ctx context.Context, cs content.Store, dgst digest.Dig } visited[dgst] = struct{}{} info, err := cs.Info(ctx, dgst) - if errors.Is(err, errdefs.ErrNotFound) { + if errors.Is(err, cerrdefs.ErrNotFound) { return true, nil } else if err != nil { return false, err @@ -1025,9 +1025,9 @@ func (sr *immutableRef) withRemoteSnapshotLabelsStargzMode(ctx context.Context, for _, r := range sr.layerChain() { r := r info, err := r.cm.Snapshotter.Stat(ctx, r.getSnapshotID()) - if err != nil && !errdefs.IsNotFound(err) { + if err != nil && !cerrdefs.IsNotFound(err) { return err - } else if errdefs.IsNotFound(err) { + } else if cerrdefs.IsNotFound(err) { continue // This snpashot doesn't exist; skip } else if _, ok := info.Labels["containerd.io/snapshot/remote"]; !ok { continue // This isn't a remote snapshot; skip @@ -1100,7 +1100,7 @@ func (sr *immutableRef) prepareRemoteSnapshotsStargzMode(ctx context.Context, s parentID = r.layerParent.getSnapshotID() } if err := r.cm.Snapshotter.Prepare(ctx, key, parentID, opts...); err != nil { - if errdefs.IsAlreadyExists(err) { + if cerrdefs.IsAlreadyExists(err) { // Check if the targeting snapshot ID has been prepared as // a remote snapshot in the snapshotter. info, err := r.cm.Snapshotter.Stat(ctx, snapshotID) @@ -1332,7 +1332,7 @@ func (sr *immutableRef) unlazyLayer(ctx context.Context, dhs DescHandlers, pg pr return err } if err := sr.cm.Snapshotter.Commit(ctx, sr.getSnapshotID(), key); err != nil { - if !errors.Is(err, errdefs.ErrAlreadyExists) { + if !errors.Is(err, cerrdefs.ErrAlreadyExists) { return err } } @@ -1391,7 +1391,7 @@ func (sr *immutableRef) release(ctx context.Context) (rerr error) { if sr.equalMutable != nil { sr.equalMutable.release(ctx) } else { - if err := sr.cm.LeaseManager.Delete(ctx, leases.Lease{ID: sr.viewLeaseID()}); err != nil && !errdefs.IsNotFound(err) { + if err := sr.cm.LeaseManager.Delete(ctx, leases.Lease{ID: sr.viewLeaseID()}); err != nil && !cerrdefs.IsNotFound(err) { return err } sr.mountCache = nil @@ -1422,7 +1422,7 @@ func (cr *cacheRecord) finalize(ctx context.Context) error { return nil }) if err != nil { - if !errors.Is(err, errdefs.ErrAlreadyExists) { // migrator adds leases for everything + if !errors.Is(err, cerrdefs.ErrAlreadyExists) { // migrator adds leases for everything return errors.Wrap(err, "failed to create lease") } } diff --git a/cache/remote.go b/cache/remote.go index 4f5fd091f..19ffb47e8 100644 --- a/cache/remote.go +++ b/cache/remote.go @@ -7,8 +7,8 @@ import ( "strings" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/reference" + cerrdefs "github.com/containerd/errdefs" "github.com/moby/buildkit/cache/config" "github.com/moby/buildkit/session" "github.com/moby/buildkit/solver" @@ -301,7 +301,7 @@ type lazyRefProvider struct { func (p lazyRefProvider) ReaderAt(ctx context.Context, desc ocispecs.Descriptor) (content.ReaderAt, error) { if desc.Digest != p.desc.Digest { - return nil, errdefs.ErrNotFound + return nil, cerrdefs.ErrNotFound } if err := p.Unlazy(ctx); err != nil { return nil, err @@ -311,7 +311,7 @@ func (p lazyRefProvider) ReaderAt(ctx context.Context, desc ocispecs.Descriptor) func (p lazyRefProvider) Info(ctx context.Context, dgst digest.Digest) (content.Info, error) { if dgst != p.desc.Digest { - return content.Info{}, errdefs.ErrNotFound + return content.Info{}, cerrdefs.ErrNotFound } info, err := p.ref.cm.ContentStore.Info(ctx, dgst) if err == nil { diff --git a/client/client_test.go b/client/client_test.go index 10e843edb..9880a5233 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -30,13 +30,13 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/content/local" "github.com/containerd/containerd/content/proxy" - ctderrdefs "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/remotes/docker" "github.com/containerd/containerd/snapshots" "github.com/containerd/continuity/fs/fstest" + cerrdefs "github.com/containerd/errdefs" "github.com/distribution/reference" intoto "github.com/in-toto/in-toto-golang/in_toto" controlapi "github.com/moby/buildkit/api/services/control" @@ -492,12 +492,12 @@ func testExportedImageLabels(t *testing.T, sb integration.Sandbox) { // layers should be deleted _, err = store.Info(ctx, mfst.Layers[1].Digest) require.Error(t, err) - require.True(t, errors.Is(err, ctderrdefs.ErrNotFound)) + require.True(t, errors.Is(err, cerrdefs.ErrNotFound)) // config should be deleted _, err = store.Info(ctx, mfst.Config.Digest) require.Error(t, err) - require.True(t, errors.Is(err, ctderrdefs.ErrNotFound)) + require.True(t, errors.Is(err, cerrdefs.ErrNotFound)) // buildkit contentstore still has the layer because it is multi-ns bkstore := proxy.NewContentStore(c.ContentClient()) @@ -3926,7 +3926,7 @@ func testBuildExportWithForeignLayer(t *testing.T, sb integration.Sandbox) { // The request is only made when we attempt to read from the reader. buf := make([]byte, 1) _, err = rc.Read(buf) - require.Truef(t, ctderrdefs.IsNotFound(err), "expected error for blob that should not be in registry: %s, %v", mfst.Layers[0].Digest, err) + require.Truef(t, cerrdefs.IsNotFound(err), "expected error for blob that should not be in registry: %s, %v", mfst.Layers[0].Digest, err) }) t.Run("propagate=0", func(t *testing.T) { registry, err := sb.NewRegistry() @@ -4681,7 +4681,7 @@ func testStargzLazyRegistryCacheImportExport(t *testing.T, sb integration.Sandbo var sgzLayers []ocispecs.Descriptor for i, layer := range manifest.Layers[:len(manifest.Layers)-1] { _, err = contentStore.Info(ctx, layer.Digest) - require.ErrorIs(t, err, ctderrdefs.ErrNotFound, "unexpected error %v on layer %+v (%d)", err, layer, i) + require.ErrorIs(t, err, cerrdefs.ErrNotFound, "unexpected error %v on layer %+v (%d)", err, layer, i) sgzLayers = append(sgzLayers, layer) } require.NotEqual(t, 0, len(sgzLayers), "no layer can be used for checking lazypull") @@ -4871,7 +4871,7 @@ func testStargzLazyInlineCacheImportExport(t *testing.T, sb integration.Sandbox) var sgzLayers []ocispecs.Descriptor for i, layer := range manifest.Layers[:len(manifest.Layers)-1] { _, err = contentStore.Info(ctx, layer.Digest) - require.ErrorIs(t, err, ctderrdefs.ErrNotFound, "unexpected error %v on layer %+v (%d)", err, layer, i) + require.ErrorIs(t, err, cerrdefs.ErrNotFound, "unexpected error %v on layer %+v (%d)", err, layer, i) sgzLayers = append(sgzLayers, layer) } require.NotEqual(t, 0, len(sgzLayers), "no layer can be used for checking lazypull") @@ -5009,7 +5009,7 @@ func testStargzLazyPull(t *testing.T, sb integration.Sandbox) { var sgzLayers []ocispecs.Descriptor for _, layer := range manifest.Layers[:len(manifest.Layers)-1] { _, err = contentStore.Info(ctx, layer.Digest) - require.ErrorIs(t, err, ctderrdefs.ErrNotFound, "unexpected error %v", err) + require.ErrorIs(t, err, cerrdefs.ErrNotFound, "unexpected error %v", err) sgzLayers = append(sgzLayers, layer) } require.NotEqual(t, 0, len(sgzLayers), "no layer can be used for checking lazypull") @@ -5167,7 +5167,7 @@ func testLazyImagePush(t *testing.T, sb integration.Sandbox) { for _, layer := range manifest.Layers { _, err = contentStore.Info(ctx, layer.Digest) - require.ErrorIs(t, err, ctderrdefs.ErrNotFound, "unexpected error %v", err) + require.ErrorIs(t, err, cerrdefs.ErrNotFound, "unexpected error %v", err) } // clear all local state out again @@ -5201,7 +5201,7 @@ func testLazyImagePush(t *testing.T, sb integration.Sandbox) { for _, layer := range manifest.Layers { _, err = contentStore.Info(ctx, layer.Digest) - require.ErrorIs(t, err, ctderrdefs.ErrNotFound, "unexpected error %v", err) + require.ErrorIs(t, err, cerrdefs.ErrNotFound, "unexpected error %v", err) } // check that a subsequent build can use the previously lazy image in an exec @@ -6006,7 +6006,7 @@ func testRegistryEmptyCacheExport(t *testing.T, sb integration.Sandbox) { defer client.Close() _, err := client.Fetch(ctx, cacheTarget) - require.ErrorIs(t, err, ctderrdefs.ErrNotFound, "unexpected error %v", err) + require.ErrorIs(t, err, cerrdefs.ErrNotFound, "unexpected error %v", err) } }) } @@ -7317,7 +7317,7 @@ func testMergeOpCache(t *testing.T, sb integration.Sandbox, mode string) { for _, layer := range busyboxManifest.Layers { _, err = contentStore.Info(ctx, layer.Digest) - require.ErrorIs(t, err, ctderrdefs.ErrNotFound, "unexpected error %v", err) + require.ErrorIs(t, err, cerrdefs.ErrNotFound, "unexpected error %v", err) } // make a new merge that includes the lazy busybox as a base and exports inline cache @@ -7403,7 +7403,7 @@ func testMergeOpCache(t *testing.T, sb integration.Sandbox, mode string) { // verify that the busybox image stayed lazy for _, layer := range busyboxManifest.Layers { _, err = contentStore.Info(ctx, layer.Digest) - require.ErrorIs(t, err, ctderrdefs.ErrNotFound, "unexpected error %v", err) + require.ErrorIs(t, err, cerrdefs.ErrNotFound, "unexpected error %v", err) } // get the random value at /bar/2 @@ -7435,7 +7435,7 @@ func testMergeOpCache(t *testing.T, sb integration.Sandbox, mode string) { for _, layer := range manifest.Layers { _, err = contentStore.Info(ctx, layer.Digest) - require.ErrorIs(t, err, ctderrdefs.ErrNotFound, "unexpected error %v", err) + require.ErrorIs(t, err, cerrdefs.ErrNotFound, "unexpected error %v", err) } // re-run the same build with cache imports and verify everything stays lazy @@ -7463,7 +7463,7 @@ func testMergeOpCache(t *testing.T, sb integration.Sandbox, mode string) { for i, layer := range manifest.Layers { _, err = contentStore.Info(ctx, layer.Digest) - require.ErrorIs(t, err, ctderrdefs.ErrNotFound, "unexpected error %v for index %d (%s)", err, i, layer.Digest) + require.ErrorIs(t, err, cerrdefs.ErrNotFound, "unexpected error %v for index %d (%s)", err, i, layer.Digest) } // re-run the build with a change only to input1 using the remote cache @@ -7504,7 +7504,7 @@ func testMergeOpCache(t *testing.T, sb integration.Sandbox, mode string) { case 0, 2: // bottom and top layer should stay lazy as they didn't change _, err = contentStore.Info(ctx, layer.Digest) - require.ErrorIs(t, err, ctderrdefs.ErrNotFound, "unexpected error %v for index %d", err, i) + require.ErrorIs(t, err, cerrdefs.ErrNotFound, "unexpected error %v for index %d", err, i) case 1: // middle layer had to be rebuilt, should exist locally _, err = contentStore.Info(ctx, layer.Digest) @@ -7540,7 +7540,7 @@ func testMergeOpCache(t *testing.T, sb integration.Sandbox, mode string) { for _, layer := range manifest.Layers { _, err = contentStore.Info(ctx, layer.Digest) - require.ErrorIs(t, err, ctderrdefs.ErrNotFound, "unexpected error %v", err) + require.ErrorIs(t, err, cerrdefs.ErrNotFound, "unexpected error %v", err) } mergePlusLayer := merge.File(llb.Mkfile("/3", 0444, nil)) @@ -7589,7 +7589,7 @@ func testMergeOpCache(t *testing.T, sb integration.Sandbox, mode string) { for _, layer := range manifest.Layers { _, err = contentStore.Info(ctx, layer.Digest) - require.ErrorIs(t, err, ctderrdefs.ErrNotFound, "unexpected error %v", err) + require.ErrorIs(t, err, cerrdefs.ErrNotFound, "unexpected error %v", err) } _, err = c.Solve(sb.Context(), def, SolveOpt{ @@ -7615,7 +7615,7 @@ func testMergeOpCache(t *testing.T, sb integration.Sandbox, mode string) { for i, layer := range manifest.Layers { _, err = contentStore.Info(ctx, layer.Digest) - require.ErrorIs(t, err, ctderrdefs.ErrNotFound, "unexpected error %v for index %d", err, i) + require.ErrorIs(t, err, cerrdefs.ErrNotFound, "unexpected error %v for index %d", err, i) } } diff --git a/client/mergediff_test.go b/client/mergediff_test.go index adeeeb81b..d1ffc9f56 100644 --- a/client/mergediff_test.go +++ b/client/mergediff_test.go @@ -6,10 +6,10 @@ import ( "strings" "testing" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/namespaces" "github.com/containerd/continuity/fs/fstest" + cerrdefs "github.com/containerd/errdefs" "github.com/moby/buildkit/client/llb" "github.com/moby/buildkit/util/testutil/integration" "github.com/moby/buildkit/util/testutil/workers" @@ -1321,7 +1321,7 @@ func (tc verifyContents) Run(t *testing.T, sb integration.Sandbox) { if err == nil { unexpectedLayers = append(unexpectedLayers, desc) } else { - require.True(t, errdefs.IsNotFound(err)) + require.True(t, cerrdefs.IsNotFound(err)) } } return images.Children(ctx, client.ContentStore(), desc) diff --git a/exporter/containerimage/export.go b/exporter/containerimage/export.go index 56bd9467a..ef4172e21 100644 --- a/exporter/containerimage/export.go +++ b/exporter/containerimage/export.go @@ -10,7 +10,6 @@ import ( "strings" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/labels" "github.com/containerd/containerd/leases" @@ -18,6 +17,7 @@ import ( "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/remotes/docker" "github.com/containerd/containerd/rootfs" + cerrdefs "github.com/containerd/errdefs" "github.com/moby/buildkit/cache" cacheconfig "github.com/moby/buildkit/cache/config" "github.com/moby/buildkit/exporter" @@ -270,7 +270,7 @@ func (e *imageExporterInstance) Export(ctx context.Context, src *exporter.Source for _, sfx := range sfx { img.Name = targetName + sfx if _, err := e.opt.Images.Update(imageClientCtx, img); err != nil { - if !errors.Is(err, errdefs.ErrNotFound) { + if !errors.Is(err, cerrdefs.ErrNotFound) { return nil, nil, tagDone(err) } @@ -284,7 +284,7 @@ func (e *imageExporterInstance) Export(ctx context.Context, src *exporter.Source if e.unpack { if opts.RewriteTimestamp { // e.unpackImage cannot be used because src ref does not point to the rewritten image - /// + // / // TODO: change e.unpackImage so that it takes Result[Remote] as parameter. // https://github.com/moby/buildkit/pull/4057#discussion_r1324106088 return nil, nil, errors.New("exporter option \"rewrite-timestamp\" conflicts with \"unpack\"") diff --git a/go.mod b/go.mod index 2f5ba449a..05300d8e0 100644 --- a/go.mod +++ b/go.mod @@ -15,8 +15,9 @@ require ( github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.15 github.com/aws/aws-sdk-go-v2/service/s3 v1.48.1 github.com/containerd/console v1.0.4 - github.com/containerd/containerd v1.7.17 + github.com/containerd/containerd v1.7.18 github.com/containerd/continuity v0.4.3 + github.com/containerd/errdefs v0.1.0 github.com/containerd/fuse-overlayfs-snapshotter v1.0.8 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 dc95eedba..74aa507ea 100644 --- a/go.sum +++ b/go.sum @@ -94,10 +94,12 @@ github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaD github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= github.com/containerd/console v1.0.4 h1:F2g4+oChYvBTsASRTz8NP6iIAi97J3TtSAsLbIFn4ro= github.com/containerd/console v1.0.4/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= -github.com/containerd/containerd v1.7.17 h1:KjNnn0+tAVQHAoaWRjmdak9WlvnFR/8rU1CHHy8Rm2A= -github.com/containerd/containerd v1.7.17/go.mod h1:vK+hhT4TIv2uejlcDlbVIc8+h/BqtKLIyNrtCZol8lI= +github.com/containerd/containerd v1.7.18 h1:jqjZTQNfXGoEaZdW1WwPU0RqSn1Bm2Ay/KJPUuO8nao= +github.com/containerd/containerd v1.7.18/go.mod h1:IYEk9/IO6wAPUz2bCMVUbsfXjzw5UNP5fLz4PsUygQ4= 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/fuse-overlayfs-snapshotter v1.0.8 h1:O471INHO59/fnSVE+B+THGjvRA2d1K6/FdpUuhNnXwk= diff --git a/session/content/attachable.go b/session/content/attachable.go index 4656908fe..5c0801ac9 100644 --- a/session/content/attachable.go +++ b/session/content/attachable.go @@ -5,8 +5,8 @@ import ( api "github.com/containerd/containerd/api/services/content/v1" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/services/content/contentserver" + cerrdefs "github.com/containerd/errdefs" "github.com/moby/buildkit/session" digest "github.com/opencontainers/go-digest" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" @@ -25,17 +25,17 @@ type attachableContentStore struct { func (cs *attachableContentStore) choose(ctx context.Context) (content.Store, error) { md, ok := metadata.FromIncomingContext(ctx) if !ok { - return nil, errors.Wrap(errdefs.ErrInvalidArgument, "request lacks metadata") + return nil, errors.Wrap(cerrdefs.ErrInvalidArgument, "request lacks metadata") } values := md[GRPCHeaderID] if len(values) == 0 { - return nil, errors.Wrapf(errdefs.ErrInvalidArgument, "request lacks metadata %q", GRPCHeaderID) + return nil, errors.Wrapf(cerrdefs.ErrInvalidArgument, "request lacks metadata %q", GRPCHeaderID) } id := values[0] store, ok := cs.stores[id] if !ok { - return nil, errors.Wrapf(errdefs.ErrNotFound, "unknown store %s", id) + return nil, errors.Wrapf(cerrdefs.ErrNotFound, "unknown store %s", id) } return store, nil } diff --git a/snapshot/localmounter_windows.go b/snapshot/localmounter_windows.go index 0e0a37fe6..348641e4f 100644 --- a/snapshot/localmounter_windows.go +++ b/snapshot/localmounter_windows.go @@ -4,8 +4,8 @@ import ( "os" "github.com/Microsoft/go-winio/pkg/bindfilter" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/mount" + cerrdefs "github.com/containerd/errdefs" "github.com/pkg/errors" "golang.org/x/sys/windows" ) @@ -26,7 +26,7 @@ func (lm *localMounter) Mount() (string, error) { // Windows can only mount a single mount at a given location. // Parent layers are carried in Options, opaquely to localMounter. if len(lm.mounts) != 1 { - return "", errors.Wrapf(errdefs.ErrNotImplemented, "request to mount %d layers, only 1 is supported", len(lm.mounts)) + return "", errors.Wrapf(cerrdefs.ErrNotImplemented, "request to mount %d layers, only 1 is supported", len(lm.mounts)) } m := lm.mounts[0] @@ -66,7 +66,7 @@ func (lm *localMounter) Unmount() error { // Calling Mount() would fail on an instance of the localMounter where mounts contains // anything other than 1 mount. if len(lm.mounts) != 1 { - return errors.Wrapf(errdefs.ErrNotImplemented, "request to mount %d layers, only 1 is supported", len(lm.mounts)) + return errors.Wrapf(cerrdefs.ErrNotImplemented, "request to mount %d layers, only 1 is supported", len(lm.mounts)) } m := lm.mounts[0] diff --git a/solver/llbsolver/history.go b/solver/llbsolver/history.go index e62549ca3..307a71fef 100644 --- a/solver/llbsolver/history.go +++ b/solver/llbsolver/history.go @@ -14,8 +14,8 @@ import ( "time" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/leases" + cerrdefs "github.com/containerd/errdefs" controlapi "github.com/moby/buildkit/api/services/control" "github.com/moby/buildkit/client" "github.com/moby/buildkit/cmd/buildkitd/config" @@ -137,7 +137,7 @@ func (h *HistoryQueue) migrateV2() error { return b.ForEach(func(key, dt []byte) error { recs, err := h.opt.LeaseManager.ListResources(ctx, leases.Lease{ID: h.leaseID(string(key))}) if err != nil { - if errdefs.IsNotFound(err) { + if cerrdefs.IsNotFound(err) { return nil } return err @@ -157,7 +157,7 @@ func (h *HistoryQueue) migrateV2() error { l, err := h.hLeaseManager.Create(ctx, leases.WithID(h.leaseID(string(key)))) if err != nil { - if !errors.Is(err, errdefs.ErrAlreadyExists) { + if !errors.Is(err, cerrdefs.ErrAlreadyExists) { return err } l = leases.Lease{ID: string(key)} @@ -242,7 +242,7 @@ func (h *HistoryQueue) migrateBlobV2(ctx context.Context, id string, detectSkipL Digest: dgst, }), content.WithRef("history-migrate-"+id)) if err != nil { - if errdefs.IsAlreadyExists(err) { + if cerrdefs.IsAlreadyExists(err) { return true, nil } return false, err @@ -365,7 +365,7 @@ func (h *HistoryQueue) addResource(ctx context.Context, l leases.Lease, desc *co return nil } if _, err := h.hContentStore.Info(ctx, desc.Digest); err != nil { - if errdefs.IsNotFound(err) { + if cerrdefs.IsNotFound(err) { lr, ctx, err := leaseutil.NewLease(ctx, h.hLeaseManager, leases.WithID("history_migration_"+identity.NewID()), leaseutil.MakeTemporary) if err != nil { return err @@ -509,7 +509,7 @@ func (h *HistoryQueue) update(ctx context.Context, rec controlapi.BuildHistoryRe l, err := h.hLeaseManager.Create(ctx, leases.WithID(h.leaseID(rec.Ref))) created := true if err != nil { - if !errors.Is(err, errdefs.ErrAlreadyExists) { + if !errors.Is(err, cerrdefs.ErrAlreadyExists) { return err } l = leases.Lease{ID: h.leaseID(rec.Ref)} @@ -645,7 +645,7 @@ func (w *Writer) Commit(ctx context.Context) (*ocispecs.Descriptor, func(), erro dgst := w.dgstr.Digest() sz := int64(w.sz) if err := w.w.Commit(leases.WithLease(ctx, w.l.ID), int64(w.sz), dgst); err != nil { - if !errdefs.IsAlreadyExists(err) { + if !cerrdefs.IsAlreadyExists(err) { w.Discard() return nil, nil, err } diff --git a/source/containerimage/pull.go b/source/containerimage/pull.go index 2ed18c257..27d8975a0 100644 --- a/source/containerimage/pull.go +++ b/source/containerimage/pull.go @@ -7,12 +7,12 @@ import ( "time" "github.com/containerd/containerd/content" - containerderrdefs "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/leases" "github.com/containerd/containerd/remotes" "github.com/containerd/containerd/remotes/docker" "github.com/containerd/containerd/snapshots" + cerrdefs "github.com/containerd/errdefs" "github.com/moby/buildkit/cache" "github.com/moby/buildkit/client" "github.com/moby/buildkit/client/llb/sourceresolver" @@ -249,7 +249,7 @@ func (p *puller) Snapshot(ctx context.Context, g session.Group) (ir cache.Immuta } for _, desc := range p.manifest.Nonlayers { - if _, err := p.ContentStore.Info(ctx, desc.Digest); containerderrdefs.IsNotFound(err) { + if _, err := p.ContentStore.Info(ctx, desc.Digest); cerrdefs.IsNotFound(err) { // manifest or config must have gotten gc'd after CacheKey, re-pull them ctx, done, err := leaseutil.WithLease(ctx, p.LeaseManager, leaseutil.MakeTemporary) if err != nil { diff --git a/util/contentutil/buffer.go b/util/contentutil/buffer.go index 3698cb267..050c063bb 100644 --- a/util/contentutil/buffer.go +++ b/util/contentutil/buffer.go @@ -9,7 +9,7 @@ import ( "time" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/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" @@ -43,7 +43,7 @@ func (b *buffer) Info(ctx context.Context, dgst digest.Digest) (content.Info, er v, ok := b.infos[dgst] b.mu.Unlock() if !ok { - return content.Info{}, errdefs.ErrNotFound + return content.Info{}, cerrdefs.ErrNotFound } return v, nil } @@ -54,7 +54,7 @@ func (b *buffer) Update(ctx context.Context, new content.Info, fieldpaths ...str updated, ok := b.infos[new.Digest] if !ok { - return content.Info{}, errdefs.ErrNotFound + return content.Info{}, cerrdefs.ErrNotFound } if len(fieldpaths) == 0 { @@ -96,7 +96,7 @@ func (b *buffer) Writer(ctx context.Context, opts ...content.WriterOpt) (content } b.mu.Lock() if _, ok := b.refs[wOpts.Ref]; ok { - return nil, errors.Wrapf(errdefs.ErrUnavailable, "ref %s locked", wOpts.Ref) + return nil, errors.Wrapf(cerrdefs.ErrUnavailable, "ref %s locked", wOpts.Ref) } b.mu.Unlock() return &bufferedWriter{ @@ -128,7 +128,7 @@ func (b *buffer) getBytesReader(dgst digest.Digest) (*bytes.Reader, error) { return bytes.NewReader(dt), nil } - return nil, errors.Wrapf(errdefs.ErrNotFound, "content %v", dgst) + return nil, errors.Wrapf(cerrdefs.ErrNotFound, "content %v", dgst) } func (b *buffer) addValue(k digest.Digest, dt []byte) { diff --git a/util/contentutil/buffer_test.go b/util/contentutil/buffer_test.go index 22254b57a..6ea1c1716 100644 --- a/util/contentutil/buffer_test.go +++ b/util/contentutil/buffer_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/remotes/docker" + cerrdefs "github.com/containerd/errdefs" digest "github.com/opencontainers/go-digest" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" @@ -42,7 +42,7 @@ func TestReadWrite(t *testing.T) { _, err = content.ReadBlob(ctx, b, ocispecs.Descriptor{Digest: digest.FromBytes([]byte("foo3"))}) require.Error(t, err) - require.Equal(t, true, errors.Is(err, errdefs.ErrNotFound)) + require.Equal(t, true, errors.Is(err, cerrdefs.ErrNotFound)) } func TestReaderAt(t *testing.T) { diff --git a/util/contentutil/multiprovider.go b/util/contentutil/multiprovider.go index c34d9efc3..bda29e690 100644 --- a/util/contentutil/multiprovider.go +++ b/util/contentutil/multiprovider.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" + cerrdefs "github.com/containerd/errdefs" "github.com/moby/buildkit/session" digest "github.com/opencontainers/go-digest" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" @@ -60,7 +60,7 @@ func (mp *MultiProvider) ReaderAt(ctx context.Context, desc ocispecs.Descriptor) } mp.mu.RUnlock() if mp.base == nil { - return nil, errors.Wrapf(errdefs.ErrNotFound, "content %v", desc.Digest) + return nil, errors.Wrapf(cerrdefs.ErrNotFound, "content %v", desc.Digest) } return mp.base.ReaderAt(ctx, desc) } @@ -74,7 +74,7 @@ func (mp *MultiProvider) Info(ctx context.Context, dgst digest.Digest) (content. } mp.mu.RUnlock() if mp.base == nil { - return content.Info{}, errors.Wrapf(errdefs.ErrNotFound, "content %v", dgst) + return content.Info{}, errors.Wrapf(cerrdefs.ErrNotFound, "content %v", dgst) } return mp.base.Info(ctx, dgst) } diff --git a/util/contentutil/multiprovider_test.go b/util/contentutil/multiprovider_test.go index 45386c761..279c9ed81 100644 --- a/util/contentutil/multiprovider_test.go +++ b/util/contentutil/multiprovider_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/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" @@ -40,5 +40,5 @@ func TestMultiProvider(t *testing.T) { _, err = content.ReadBlob(ctx, mp, ocispecs.Descriptor{Digest: digest.FromBytes([]byte("foo2"))}) require.Error(t, err) - require.Equal(t, true, errors.Is(err, errdefs.ErrNotFound)) + require.Equal(t, true, errors.Is(err, cerrdefs.ErrNotFound)) } diff --git a/util/contentutil/pusher.go b/util/contentutil/pusher.go index 693dcfea9..1ec9c7d25 100644 --- a/util/contentutil/pusher.go +++ b/util/contentutil/pusher.go @@ -7,8 +7,8 @@ import ( "time" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/remotes" + cerrdefs "github.com/containerd/errdefs" digest "github.com/opencontainers/go-digest" "github.com/pkg/errors" ) @@ -41,7 +41,7 @@ func (i *pushingIngester) Writer(ctx context.Context, opts ...content.WriterOpt) } } if wOpts.Ref == "" { - return nil, errors.Wrap(errdefs.ErrInvalidArgument, "ref must not be empty") + return nil, errors.Wrap(cerrdefs.ErrInvalidArgument, "ref must not be empty") } st := time.Now() @@ -50,7 +50,7 @@ func (i *pushingIngester) Writer(ctx context.Context, opts ...content.WriterOpt) for { if time.Since(st) > time.Hour { i.mu.Unlock() - return nil, errors.Wrapf(errdefs.ErrUnavailable, "ref %v locked", wOpts.Desc.Digest) + return nil, errors.Wrapf(cerrdefs.ErrUnavailable, "ref %v locked", wOpts.Desc.Digest) } if _, ok := i.active[wOpts.Desc.Digest]; ok { i.c.Wait() diff --git a/util/contentutil/refs.go b/util/contentutil/refs.go index d7d0b5bbe..eb2bfb9c7 100644 --- a/util/contentutil/refs.go +++ b/util/contentutil/refs.go @@ -6,9 +6,9 @@ import ( "sync" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/remotes" "github.com/containerd/containerd/remotes/docker" + cerrdefs "github.com/containerd/errdefs" "github.com/moby/buildkit/version" "github.com/moby/locker" digest "github.com/opencontainers/go-digest" @@ -70,7 +70,7 @@ func (w *ingester) Writer(ctx context.Context, opts ...content.WriterOpt) (conte } } if wo.Ref == "" { - return nil, errors.Wrap(errdefs.ErrInvalidArgument, "ref must not be empty") + return nil, errors.Wrap(cerrdefs.ErrInvalidArgument, "ref must not be empty") } w.locker.Lock(wo.Ref) var once sync.Once diff --git a/util/converter/converter.go b/util/converter/converter.go index 4b956f02f..21763e94b 100644 --- a/util/converter/converter.go +++ b/util/converter/converter.go @@ -10,9 +10,9 @@ import ( "time" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images/converter" "github.com/containerd/containerd/labels" + cerrdefs "github.com/containerd/errdefs" "github.com/moby/buildkit/identity" "github.com/moby/buildkit/util/bklog" "github.com/moby/buildkit/util/compression" @@ -148,7 +148,7 @@ func (c *conversion) convert(ctx context.Context, cs content.Store, desc ocispec if c.rewriteTimestamp != nil { labelz[labelRewrittenTimestamp] = fmt.Sprintf("%d", c.rewriteTimestamp.UTC().Unix()) } - if err = w.Commit(ctx, 0, "", content.WithLabels(labelz)); err != nil && !errdefs.IsAlreadyExists(err) { + if err = w.Commit(ctx, 0, "", content.WithLabels(labelz)); err != nil && !cerrdefs.IsAlreadyExists(err) { return nil, err } if err := w.Close(); err != nil { diff --git a/util/gitutil/git_ref.go b/util/gitutil/git_ref.go index 5e3862933..59d658264 100644 --- a/util/gitutil/git_ref.go +++ b/util/gitutil/git_ref.go @@ -4,7 +4,7 @@ import ( "net/url" "strings" - "github.com/containerd/containerd/errdefs" + cerrdefs "github.com/containerd/errdefs" "github.com/pkg/errors" ) @@ -58,7 +58,7 @@ func ParseGitRef(ref string) (*GitRef, error) { ) if strings.HasPrefix(ref, "./") || strings.HasPrefix(ref, "../") { - return nil, errdefs.ErrInvalidArgument + return nil, cerrdefs.ErrInvalidArgument } else if strings.HasPrefix(ref, "github.com/") { res.IndistinguishableFromLocal = true // Deprecated remote = fromURL(&url.URL{ @@ -84,7 +84,7 @@ func ParseGitRef(ref string) (*GitRef, error) { // An HTTP(S) URL is considered to be a valid git ref only when it has the ".git[...]" suffix. case HTTPProtocol, HTTPSProtocol: if !strings.HasSuffix(remote.Path, ".git") { - return nil, errdefs.ErrInvalidArgument + return nil, cerrdefs.ErrInvalidArgument } } } diff --git a/util/imageutil/config_test.go b/util/imageutil/config_test.go index 65d4d1d1b..5ce4dc11f 100644 --- a/util/imageutil/config_test.go +++ b/util/imageutil/config_test.go @@ -9,9 +9,9 @@ import ( "testing" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/remotes" + cerrdefs "github.com/containerd/errdefs" digest "github.com/opencontainers/go-digest" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/stretchr/testify/require" @@ -68,7 +68,7 @@ func TestConfigMultiplatform(t *testing.T) { // Make sure it doesn't select a non-matching platform pArmv7 := platforms.MustParse("linux/arm/v7") _, _, err = Config(ctx, ref, r, cc, nil, &pArmv7) - require.ErrorIs(t, err, errdefs.ErrNotFound) + require.ErrorIs(t, err, cerrdefs.ErrNotFound) } check(t) @@ -159,7 +159,7 @@ func (*sectionNopCloser) Close() error { func (c *testCache) ReaderAt(ctx context.Context, desc ocispecs.Descriptor) (content.ReaderAt, error) { ra, ok := c.content[desc.Digest] if !ok { - return nil, errdefs.ErrNotFound + return nil, cerrdefs.ErrNotFound } return ra, nil } diff --git a/util/pull/pullprogress/progress.go b/util/pull/pullprogress/progress.go index 479a65016..a5e359ac7 100644 --- a/util/pull/pullprogress/progress.go +++ b/util/pull/pullprogress/progress.go @@ -6,8 +6,8 @@ import ( "time" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/remotes" + cerrdefs "github.com/containerd/errdefs" "github.com/moby/buildkit/util/bklog" "github.com/moby/buildkit/util/progress" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" @@ -122,7 +122,7 @@ func trackProgress(ctx context.Context, desc ocispecs.Descriptor, manager PullMa Started: &started, }) continue - } else if !errors.Is(err, errdefs.ErrNotFound) { + } else if !errors.Is(err, cerrdefs.ErrNotFound) { bklog.G(ctx).Errorf("unexpected error getting ingest status of %q: %v", ingestRef, err) return } diff --git a/util/push/push.go b/util/push/push.go index fcbc011d2..7b64eb119 100644 --- a/util/push/push.go +++ b/util/push/push.go @@ -8,10 +8,10 @@ import ( "sync" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/remotes" "github.com/containerd/containerd/remotes/docker" + cerrdefs "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/distribution/reference" intoto "github.com/in-toto/in-toto-golang/in_toto" @@ -191,7 +191,7 @@ func annotateDistributionSourceHandler(manager content.Manager, annotations map[ children[i] = child info, err := manager.Info(ctx, child.Digest) - if errors.Is(err, errdefs.ErrNotFound) { + if errors.Is(err, cerrdefs.ErrNotFound) { continue } else if err != nil { return nil, err diff --git a/util/resolver/authorizer.go b/util/resolver/authorizer.go index 5e86c0ee8..255908843 100644 --- a/util/resolver/authorizer.go +++ b/util/resolver/authorizer.go @@ -10,10 +10,10 @@ import ( "sync" "time" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/remotes/docker" "github.com/containerd/containerd/remotes/docker/auth" remoteserrors "github.com/containerd/containerd/remotes/errors" + cerrdefs "github.com/containerd/errdefs" "github.com/moby/buildkit/session" sessionauth "github.com/moby/buildkit/session/auth" log "github.com/moby/buildkit/util/bklog" @@ -219,7 +219,7 @@ func (a *dockerAuthorizer) AddResponses(ctx context.Context, responses []*http.R } } } - return errors.Wrap(errdefs.ErrNotImplemented, "failed to find supported auth scheme") + return errors.Wrap(cerrdefs.ErrNotImplemented, "failed to find supported auth scheme") } // authResult is used to control limit rate. @@ -271,7 +271,7 @@ func (ah *authHandler) authorize(ctx context.Context, sm *session.Manager, g ses case auth.BearerAuth: return ah.doBearerAuth(ctx, sm, g) default: - return "", errors.Wrapf(errdefs.ErrNotImplemented, "failed to find supported auth scheme: %s", string(ah.scheme)) + return "", errors.Wrapf(cerrdefs.ErrNotImplemented, "failed to find supported auth scheme: %s", string(ah.scheme)) } } diff --git a/util/winlayers/applier.go b/util/winlayers/applier.go index 6b8092801..aacfe2c80 100644 --- a/util/winlayers/applier.go +++ b/util/winlayers/applier.go @@ -12,9 +12,9 @@ import ( "github.com/containerd/containerd/archive/compression" "github.com/containerd/containerd/content" "github.com/containerd/containerd/diff" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/mount" + cerrdefs "github.com/containerd/errdefs" digest "github.com/opencontainers/go-digest" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" @@ -49,7 +49,7 @@ func (s *winApplier) Apply(ctx context.Context, desc ocispecs.Descriptor, mounts compressed, err := images.DiffCompression(ctx, desc.MediaType) if err != nil { - return ocispecs.Descriptor{}, errors.Wrapf(errdefs.ErrNotImplemented, "unsupported diff media type: %v", desc.MediaType) + return ocispecs.Descriptor{}, errors.Wrapf(cerrdefs.ErrNotImplemented, "unsupported diff media type: %v", desc.MediaType) } var ocidesc ocispecs.Descriptor diff --git a/util/winlayers/differ.go b/util/winlayers/differ.go index b4c7fdd91..a669cbab8 100644 --- a/util/winlayers/differ.go +++ b/util/winlayers/differ.go @@ -13,9 +13,9 @@ import ( "github.com/containerd/containerd/archive/compression" "github.com/containerd/containerd/content" "github.com/containerd/containerd/diff" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/labels" "github.com/containerd/containerd/mount" + cerrdefs "github.com/containerd/errdefs" log "github.com/moby/buildkit/util/bklog" digest "github.com/opencontainers/go-digest" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" @@ -66,7 +66,7 @@ func (s *winDiffer) Compare(ctx context.Context, lower, upper []mount.Mount, opt case ocispecs.MediaTypeImageLayerGzip: isCompressed = true default: - return emptyDesc, errors.Wrapf(errdefs.ErrNotImplemented, "unsupported diff media type: %v", config.MediaType) + return emptyDesc, errors.Wrapf(cerrdefs.ErrNotImplemented, "unsupported diff media type: %v", config.MediaType) } var ocidesc ocispecs.Descriptor diff --git a/vendor/github.com/containerd/containerd/Vagrantfile b/vendor/github.com/containerd/containerd/Vagrantfile index d001c4982..705153f9d 100644 --- a/vendor/github.com/containerd/containerd/Vagrantfile +++ b/vendor/github.com/containerd/containerd/Vagrantfile @@ -102,7 +102,7 @@ EOF config.vm.provision "install-golang", type: "shell", run: "once" do |sh| sh.upload_path = "/tmp/vagrant-install-golang" sh.env = { - 'GO_VERSION': ENV['GO_VERSION'] || "1.21.10", + 'GO_VERSION': ENV['GO_VERSION'] || "1.21.11", } sh.inline = <<~SHELL #!/usr/bin/env bash diff --git a/vendor/github.com/containerd/containerd/archive/compression/compression.go b/vendor/github.com/containerd/containerd/archive/compression/compression.go index 31bbe4124..23ddfab1a 100644 --- a/vendor/github.com/containerd/containerd/archive/compression/compression.go +++ b/vendor/github.com/containerd/containerd/archive/compression/compression.go @@ -29,7 +29,7 @@ import ( "strconv" "sync" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "github.com/klauspost/compress/zstd" ) diff --git a/vendor/github.com/containerd/containerd/archive/tar.go b/vendor/github.com/containerd/containerd/archive/tar.go index 28b623dcf..cdc7e14bf 100644 --- a/vendor/github.com/containerd/containerd/archive/tar.go +++ b/vendor/github.com/containerd/containerd/archive/tar.go @@ -30,10 +30,10 @@ import ( "time" "github.com/containerd/containerd/archive/tarheader" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/epoch" "github.com/containerd/containerd/pkg/userns" "github.com/containerd/continuity/fs" + "github.com/containerd/log" ) var bufPool = &sync.Pool{ diff --git a/vendor/github.com/containerd/containerd/cio/io_windows.go b/vendor/github.com/containerd/containerd/cio/io_windows.go index f3d736a6d..59b14c42f 100644 --- a/vendor/github.com/containerd/containerd/cio/io_windows.go +++ b/vendor/github.com/containerd/containerd/cio/io_windows.go @@ -22,7 +22,7 @@ import ( "io" winio "github.com/Microsoft/go-winio" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) const pipeRoot = `\\.\pipe` diff --git a/vendor/github.com/containerd/containerd/client.go b/vendor/github.com/containerd/containerd/client.go index a62217b96..94193041e 100644 --- a/vendor/github.com/containerd/containerd/client.go +++ b/vendor/github.com/containerd/containerd/client.go @@ -44,7 +44,6 @@ import ( "github.com/containerd/containerd/content" contentproxy "github.com/containerd/containerd/content/proxy" "github.com/containerd/containerd/defaults" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/events" "github.com/containerd/containerd/images" "github.com/containerd/containerd/leases" @@ -61,6 +60,7 @@ import ( "github.com/containerd/containerd/services/introspection" "github.com/containerd/containerd/snapshots" snproxy "github.com/containerd/containerd/snapshots/proxy" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/opencontainers/runtime-spec/specs-go" diff --git a/vendor/github.com/containerd/containerd/container.go b/vendor/github.com/containerd/containerd/container.go index 7863b742b..cad103738 100644 --- a/vendor/github.com/containerd/containerd/container.go +++ b/vendor/github.com/containerd/containerd/container.go @@ -29,11 +29,11 @@ import ( tasktypes "github.com/containerd/containerd/api/types/task" "github.com/containerd/containerd/cio" "github.com/containerd/containerd/containers" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/oci" "github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/runtime/v2/runc/options" + "github.com/containerd/errdefs" "github.com/containerd/fifo" "github.com/containerd/typeurl/v2" ver "github.com/opencontainers/image-spec/specs-go" diff --git a/vendor/github.com/containerd/containerd/container_opts.go b/vendor/github.com/containerd/containerd/container_opts.go index 4a937032f..0cbf6c20f 100644 --- a/vendor/github.com/containerd/containerd/container_opts.go +++ b/vendor/github.com/containerd/containerd/container_opts.go @@ -24,12 +24,12 @@ import ( "github.com/containerd/containerd/containers" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/oci" "github.com/containerd/containerd/protobuf" "github.com/containerd/containerd/snapshots" + "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/vendor/github.com/containerd/containerd/container_opts_unix.go b/vendor/github.com/containerd/containerd/container_opts_unix.go index 016c1a925..e0e8bad88 100644 --- a/vendor/github.com/containerd/containerd/container_opts_unix.go +++ b/vendor/github.com/containerd/containerd/container_opts_unix.go @@ -26,8 +26,8 @@ import ( "syscall" "github.com/containerd/containerd/containers" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/mount" + "github.com/containerd/errdefs" "github.com/opencontainers/image-spec/identity" ) diff --git a/vendor/github.com/containerd/containerd/containerstore.go b/vendor/github.com/containerd/containerd/containerstore.go index 331a6f41d..c0cca1907 100644 --- a/vendor/github.com/containerd/containerd/containerstore.go +++ b/vendor/github.com/containerd/containerd/containerstore.go @@ -23,9 +23,9 @@ import ( containersapi "github.com/containerd/containerd/api/services/containers/v1" "github.com/containerd/containerd/containers" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/protobuf" ptypes "github.com/containerd/containerd/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/vendor/github.com/containerd/containerd/content/helpers.go b/vendor/github.com/containerd/containerd/content/helpers.go index d3a82cb6f..f4763847d 100644 --- a/vendor/github.com/containerd/containerd/content/helpers.go +++ b/vendor/github.com/containerd/containerd/content/helpers.go @@ -24,9 +24,9 @@ import ( "sync" "time" - "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/randutil" + "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/vendor/github.com/containerd/containerd/content/local/locks.go b/vendor/github.com/containerd/containerd/content/local/locks.go index 1e59f39b3..4caffcc02 100644 --- a/vendor/github.com/containerd/containerd/content/local/locks.go +++ b/vendor/github.com/containerd/containerd/content/local/locks.go @@ -21,7 +21,7 @@ import ( "sync" "time" - "github.com/containerd/containerd/errdefs" + "github.com/containerd/errdefs" ) // Handles locking references diff --git a/vendor/github.com/containerd/containerd/content/local/readerat.go b/vendor/github.com/containerd/containerd/content/local/readerat.go index 899e85c0b..7918844b1 100644 --- a/vendor/github.com/containerd/containerd/content/local/readerat.go +++ b/vendor/github.com/containerd/containerd/content/local/readerat.go @@ -22,7 +22,7 @@ import ( "os" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" + "github.com/containerd/errdefs" ) // readerat implements io.ReaderAt in a completely stateless manner by opening diff --git a/vendor/github.com/containerd/containerd/content/local/store.go b/vendor/github.com/containerd/containerd/content/local/store.go index baae3565b..feecec79f 100644 --- a/vendor/github.com/containerd/containerd/content/local/store.go +++ b/vendor/github.com/containerd/containerd/content/local/store.go @@ -28,10 +28,10 @@ import ( "time" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/filters" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/randutil" + "github.com/containerd/errdefs" + "github.com/containerd/log" "github.com/sirupsen/logrus" "github.com/opencontainers/go-digest" diff --git a/vendor/github.com/containerd/containerd/content/local/writer.go b/vendor/github.com/containerd/containerd/content/local/writer.go index b187e524c..f82b131e1 100644 --- a/vendor/github.com/containerd/containerd/content/local/writer.go +++ b/vendor/github.com/containerd/containerd/content/local/writer.go @@ -27,8 +27,8 @@ import ( "time" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" + "github.com/containerd/errdefs" + "github.com/containerd/log" "github.com/opencontainers/go-digest" ) diff --git a/vendor/github.com/containerd/containerd/content/proxy/content_store.go b/vendor/github.com/containerd/containerd/content/proxy/content_store.go index 8e7fb42cf..d666fa959 100644 --- a/vendor/github.com/containerd/containerd/content/proxy/content_store.go +++ b/vendor/github.com/containerd/containerd/content/proxy/content_store.go @@ -22,9 +22,9 @@ import ( contentapi "github.com/containerd/containerd/api/services/content/v1" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/protobuf" protobuftypes "github.com/containerd/containerd/protobuf/types" + "github.com/containerd/errdefs" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/vendor/github.com/containerd/containerd/content/proxy/content_writer.go b/vendor/github.com/containerd/containerd/content/proxy/content_writer.go index 185115b0a..8d72f8e9d 100644 --- a/vendor/github.com/containerd/containerd/content/proxy/content_writer.go +++ b/vendor/github.com/containerd/containerd/content/proxy/content_writer.go @@ -23,8 +23,8 @@ import ( contentapi "github.com/containerd/containerd/api/services/content/v1" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/protobuf" + "github.com/containerd/errdefs" digest "github.com/opencontainers/go-digest" ) diff --git a/vendor/github.com/containerd/containerd/diff/apply/apply.go b/vendor/github.com/containerd/containerd/diff/apply/apply.go index 02322eaa1..a0d58ead8 100644 --- a/vendor/github.com/containerd/containerd/diff/apply/apply.go +++ b/vendor/github.com/containerd/containerd/diff/apply/apply.go @@ -24,8 +24,8 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/diff" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/vendor/github.com/containerd/containerd/diff/apply/apply_linux.go b/vendor/github.com/containerd/containerd/diff/apply/apply_linux.go index 441fcc3c6..ee30a1d1c 100644 --- a/vendor/github.com/containerd/containerd/diff/apply/apply_linux.go +++ b/vendor/github.com/containerd/containerd/diff/apply/apply_linux.go @@ -24,9 +24,9 @@ import ( "strings" "github.com/containerd/containerd/archive" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/userns" + "github.com/containerd/errdefs" "golang.org/x/sys/unix" ) diff --git a/vendor/github.com/containerd/containerd/diff/proxy/differ.go b/vendor/github.com/containerd/containerd/diff/proxy/differ.go index 1492dc673..1b0056865 100644 --- a/vendor/github.com/containerd/containerd/diff/proxy/differ.go +++ b/vendor/github.com/containerd/containerd/diff/proxy/differ.go @@ -22,11 +22,11 @@ import ( diffapi "github.com/containerd/containerd/api/services/diff/v1" "github.com/containerd/containerd/api/types" "github.com/containerd/containerd/diff" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/epoch" "github.com/containerd/containerd/protobuf" ptypes "github.com/containerd/containerd/protobuf/types" + "github.com/containerd/errdefs" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/vendor/github.com/containerd/containerd/diff/walking/differ.go b/vendor/github.com/containerd/containerd/diff/walking/differ.go index 34a5797e7..35da1533b 100644 --- a/vendor/github.com/containerd/containerd/diff/walking/differ.go +++ b/vendor/github.com/containerd/containerd/diff/walking/differ.go @@ -29,11 +29,11 @@ import ( "github.com/containerd/containerd/archive/compression" "github.com/containerd/containerd/content" "github.com/containerd/containerd/diff" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/epoch" + "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/vendor/github.com/containerd/containerd/errdefs/errdefs_deprecated.go b/vendor/github.com/containerd/containerd/errdefs/errdefs_deprecated.go new file mode 100644 index 000000000..c6a0d843e --- /dev/null +++ b/vendor/github.com/containerd/containerd/errdefs/errdefs_deprecated.go @@ -0,0 +1,116 @@ +/* + 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 ( + "github.com/containerd/errdefs" +) + +// 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 = errdefs.ErrUnknown + ErrInvalidArgument = errdefs.ErrInvalidArgument + ErrNotFound = errdefs.ErrNotFound + ErrAlreadyExists = errdefs.ErrAlreadyExists + ErrFailedPrecondition = errdefs.ErrFailedPrecondition + ErrUnavailable = errdefs.ErrUnavailable + ErrNotImplemented = errdefs.ErrNotImplemented +) + +// IsInvalidArgument returns true if the error is due to an invalid argument +func IsInvalidArgument(err error) bool { + return errdefs.IsInvalidArgument(err) +} + +// IsNotFound returns true if the error is due to a missing object +func IsNotFound(err error) bool { + return errdefs.IsNotFound(err) +} + +// IsAlreadyExists returns true if the error is due to an already existing +// metadata item +func IsAlreadyExists(err error) bool { + return errdefs.IsAlreadyExists(err) +} + +// IsFailedPrecondition returns true if an operation could not proceed to the +// lack of a particular condition +func IsFailedPrecondition(err error) bool { + return errdefs.IsFailedPrecondition(err) +} + +// IsUnavailable returns true if the error is due to a resource being unavailable +func IsUnavailable(err error) bool { + return errdefs.IsUnavailable(err) +} + +// IsNotImplemented returns true if the error is due to not being implemented +func IsNotImplemented(err error) bool { + return errdefs.IsNotImplemented(err) +} + +// IsCanceled returns true if the error is due to `context.Canceled`. +func IsCanceled(err error) bool { + return errdefs.IsCanceled(err) +} + +// IsDeadlineExceeded returns true if the error is due to +// `context.DeadlineExceeded`. +func IsDeadlineExceeded(err error) bool { + return errdefs.IsDeadlineExceeded(err) +} + +// 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 { + return errdefs.ToGRPC(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 errdefs.ToGRPCf(err, format, args...) +} + +// FromGRPC returns the underlying error from a grpc service based on the grpc error code +func FromGRPC(err error) error { + return errdefs.FromGRPC(err) +} diff --git a/vendor/github.com/containerd/containerd/events.go b/vendor/github.com/containerd/containerd/events.go index 32d2dfc31..f31796742 100644 --- a/vendor/github.com/containerd/containerd/events.go +++ b/vendor/github.com/containerd/containerd/events.go @@ -20,9 +20,9 @@ import ( "context" eventsapi "github.com/containerd/containerd/api/services/events/v1" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/events" "github.com/containerd/containerd/protobuf" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" ) diff --git a/vendor/github.com/containerd/containerd/events/exchange/exchange.go b/vendor/github.com/containerd/containerd/events/exchange/exchange.go index ffcba5012..38c41f395 100644 --- a/vendor/github.com/containerd/containerd/events/exchange/exchange.go +++ b/vendor/github.com/containerd/containerd/events/exchange/exchange.go @@ -22,12 +22,12 @@ import ( "strings" "time" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/events" "github.com/containerd/containerd/filters" "github.com/containerd/containerd/identifiers" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" + "github.com/containerd/errdefs" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" goevents "github.com/docker/go-events" ) diff --git a/vendor/github.com/containerd/containerd/filters/filter.go b/vendor/github.com/containerd/containerd/filters/filter.go index e13f2625c..dcc569a4b 100644 --- a/vendor/github.com/containerd/containerd/filters/filter.go +++ b/vendor/github.com/containerd/containerd/filters/filter.go @@ -70,7 +70,7 @@ package filters import ( "regexp" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) // Filter matches specific resources based the provided filter diff --git a/vendor/github.com/containerd/containerd/filters/parser.go b/vendor/github.com/containerd/containerd/filters/parser.go index 32767909b..f07fd33bd 100644 --- a/vendor/github.com/containerd/containerd/filters/parser.go +++ b/vendor/github.com/containerd/containerd/filters/parser.go @@ -20,7 +20,7 @@ import ( "fmt" "io" - "github.com/containerd/containerd/errdefs" + "github.com/containerd/errdefs" ) /* diff --git a/vendor/github.com/containerd/containerd/identifiers/validate.go b/vendor/github.com/containerd/containerd/identifiers/validate.go index cbd3a52ba..0acbf3fc4 100644 --- a/vendor/github.com/containerd/containerd/identifiers/validate.go +++ b/vendor/github.com/containerd/containerd/identifiers/validate.go @@ -28,7 +28,7 @@ import ( "fmt" "regexp" - "github.com/containerd/containerd/errdefs" + "github.com/containerd/errdefs" ) const ( diff --git a/vendor/github.com/containerd/containerd/image.go b/vendor/github.com/containerd/containerd/image.go index 13cb5b241..a8f99c2b5 100644 --- a/vendor/github.com/containerd/containerd/image.go +++ b/vendor/github.com/containerd/containerd/image.go @@ -26,13 +26,13 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/diff" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/labels" "github.com/containerd/containerd/pkg/kmutex" "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/rootfs" "github.com/containerd/containerd/snapshots" + "github.com/containerd/errdefs" "github.com/opencontainers/go-digest" "github.com/opencontainers/image-spec/identity" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/vendor/github.com/containerd/containerd/image_store.go b/vendor/github.com/containerd/containerd/image_store.go index 524a7a672..120d8d54d 100644 --- a/vendor/github.com/containerd/containerd/image_store.go +++ b/vendor/github.com/containerd/containerd/image_store.go @@ -21,11 +21,11 @@ import ( imagesapi "github.com/containerd/containerd/api/services/images/v1" "github.com/containerd/containerd/api/types" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/pkg/epoch" "github.com/containerd/containerd/protobuf" ptypes "github.com/containerd/containerd/protobuf/types" + "github.com/containerd/errdefs" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "google.golang.org/protobuf/types/known/timestamppb" diff --git a/vendor/github.com/containerd/containerd/images/archive/exporter.go b/vendor/github.com/containerd/containerd/images/archive/exporter.go index 8513e9a8b..5d4aba40a 100644 --- a/vendor/github.com/containerd/containerd/images/archive/exporter.go +++ b/vendor/github.com/containerd/containerd/images/archive/exporter.go @@ -27,10 +27,10 @@ import ( "strings" "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" digest "github.com/opencontainers/go-digest" ocispecs "github.com/opencontainers/image-spec/specs-go" diff --git a/vendor/github.com/containerd/containerd/images/archive/importer.go b/vendor/github.com/containerd/containerd/images/archive/importer.go index 3ca88091c..e0c57728e 100644 --- a/vendor/github.com/containerd/containerd/images/archive/importer.go +++ b/vendor/github.com/containerd/containerd/images/archive/importer.go @@ -29,11 +29,11 @@ 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/containerd/log" "github.com/containerd/containerd/platforms" + "github.com/containerd/errdefs" + "github.com/containerd/log" 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/vendor/github.com/containerd/containerd/images/handlers.go b/vendor/github.com/containerd/containerd/images/handlers.go index 077d88e78..162e87a86 100644 --- a/vendor/github.com/containerd/containerd/images/handlers.go +++ b/vendor/github.com/containerd/containerd/images/handlers.go @@ -23,8 +23,8 @@ import ( "sort" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/platforms" + "github.com/containerd/errdefs" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "golang.org/x/sync/errgroup" "golang.org/x/sync/semaphore" diff --git a/vendor/github.com/containerd/containerd/images/image.go b/vendor/github.com/containerd/containerd/images/image.go index 2d2e36a9a..3e2abc75f 100644 --- a/vendor/github.com/containerd/containerd/images/image.go +++ b/vendor/github.com/containerd/containerd/images/image.go @@ -24,9 +24,9 @@ import ( "time" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/platforms" + "github.com/containerd/errdefs" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) @@ -268,6 +268,9 @@ func Platforms(ctx context.Context, provider content.Provider, image ocispec.Des var platformSpecs []ocispec.Platform return platformSpecs, Walk(ctx, Handlers(HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) { if desc.Platform != nil { + if desc.Platform.OS == "unknown" || desc.Platform.Architecture == "unknown" { + return nil, ErrSkipDesc + } platformSpecs = append(platformSpecs, *desc.Platform) return nil, ErrSkipDesc } diff --git a/vendor/github.com/containerd/containerd/images/mediatypes.go b/vendor/github.com/containerd/containerd/images/mediatypes.go index d3b28d42d..cd51aa5eb 100644 --- a/vendor/github.com/containerd/containerd/images/mediatypes.go +++ b/vendor/github.com/containerd/containerd/images/mediatypes.go @@ -22,7 +22,7 @@ import ( "sort" "strings" - "github.com/containerd/containerd/errdefs" + "github.com/containerd/errdefs" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/vendor/github.com/containerd/containerd/import.go b/vendor/github.com/containerd/containerd/import.go index c057d7bd4..a6b918ba3 100644 --- a/vendor/github.com/containerd/containerd/import.go +++ b/vendor/github.com/containerd/containerd/import.go @@ -22,10 +22,10 @@ import ( "io" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/images/archive" "github.com/containerd/containerd/platforms" + "github.com/containerd/errdefs" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/vendor/github.com/containerd/containerd/labels/validate.go b/vendor/github.com/containerd/containerd/labels/validate.go index f83b5dde2..6f23cdd7c 100644 --- a/vendor/github.com/containerd/containerd/labels/validate.go +++ b/vendor/github.com/containerd/containerd/labels/validate.go @@ -19,7 +19,7 @@ package labels import ( "fmt" - "github.com/containerd/containerd/errdefs" + "github.com/containerd/errdefs" ) const ( diff --git a/vendor/github.com/containerd/containerd/leases/proxy/manager.go b/vendor/github.com/containerd/containerd/leases/proxy/manager.go index ae42d8eb1..342db9426 100644 --- a/vendor/github.com/containerd/containerd/leases/proxy/manager.go +++ b/vendor/github.com/containerd/containerd/leases/proxy/manager.go @@ -20,9 +20,9 @@ import ( "context" leasesapi "github.com/containerd/containerd/api/services/leases/v1" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/leases" "github.com/containerd/containerd/protobuf" + "github.com/containerd/errdefs" ) type proxyManager struct { diff --git a/vendor/github.com/containerd/containerd/log/context_deprecated.go b/vendor/github.com/containerd/containerd/log/context_deprecated.go deleted file mode 100644 index 9e9e8b491..000000000 --- a/vendor/github.com/containerd/containerd/log/context_deprecated.go +++ /dev/null @@ -1,149 +0,0 @@ -/* - 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 log - -import ( - "context" - - "github.com/containerd/log" -) - -// G is a shorthand for [GetLogger]. -// -// Deprecated: use [log.G]. -var G = log.G - -// L is an alias for the standard logger. -// -// Deprecated: use [log.L]. -var L = log.L - -// Fields type to pass to "WithFields". -// -// Deprecated: use [log.Fields]. -type Fields = log.Fields - -// Entry is a logging entry. -// -// Deprecated: use [log.Entry]. -type Entry = log.Entry - -// RFC3339NanoFixed is [time.RFC3339Nano] with nanoseconds padded using -// zeros to ensure the formatted time is always the same number of -// characters. -// -// Deprecated: use [log.RFC3339NanoFixed]. -const RFC3339NanoFixed = log.RFC3339NanoFixed - -// Level is a logging level. -// -// Deprecated: use [log.Level]. -type Level = log.Level - -// Supported log levels. -const ( - // TraceLevel level. - // - // Deprecated: use [log.TraceLevel]. - TraceLevel Level = log.TraceLevel - - // DebugLevel level. - // - // Deprecated: use [log.DebugLevel]. - DebugLevel Level = log.DebugLevel - - // InfoLevel level. - // - // Deprecated: use [log.InfoLevel]. - InfoLevel Level = log.InfoLevel - - // WarnLevel level. - // - // Deprecated: use [log.WarnLevel]. - WarnLevel Level = log.WarnLevel - - // ErrorLevel level - // - // Deprecated: use [log.ErrorLevel]. - ErrorLevel Level = log.ErrorLevel - - // FatalLevel level. - // - // Deprecated: use [log.FatalLevel]. - FatalLevel Level = log.FatalLevel - - // PanicLevel level. - // - // Deprecated: use [log.PanicLevel]. - PanicLevel Level = log.PanicLevel -) - -// SetLevel sets log level globally. It returns an error if the given -// level is not supported. -// -// Deprecated: use [log.SetLevel]. -func SetLevel(level string) error { - return log.SetLevel(level) -} - -// GetLevel returns the current log level. -// -// Deprecated: use [log.GetLevel]. -func GetLevel() log.Level { - return log.GetLevel() -} - -// OutputFormat specifies a log output format. -// -// Deprecated: use [log.OutputFormat]. -type OutputFormat = log.OutputFormat - -// Supported log output formats. -const ( - // TextFormat represents the text logging format. - // - // Deprecated: use [log.TextFormat]. - TextFormat log.OutputFormat = "text" - - // JSONFormat represents the JSON logging format. - // - // Deprecated: use [log.JSONFormat]. - JSONFormat log.OutputFormat = "json" -) - -// SetFormat sets the log output format. -// -// Deprecated: use [log.SetFormat]. -func SetFormat(format OutputFormat) error { - return log.SetFormat(format) -} - -// WithLogger returns a new context with the provided logger. Use in -// combination with logger.WithField(s) for great effect. -// -// Deprecated: use [log.WithLogger]. -func WithLogger(ctx context.Context, logger *log.Entry) context.Context { - return log.WithLogger(ctx, logger) -} - -// GetLogger retrieves the current logger from the context. If no logger is -// available, the default logger is returned. -// -// Deprecated: use [log.GetLogger]. -func GetLogger(ctx context.Context) *log.Entry { - return log.GetLogger(ctx) -} diff --git a/vendor/github.com/containerd/containerd/metadata/containers.go b/vendor/github.com/containerd/containerd/metadata/containers.go index d97d9c6cd..8929ebf97 100644 --- a/vendor/github.com/containerd/containerd/metadata/containers.go +++ b/vendor/github.com/containerd/containerd/metadata/containers.go @@ -24,7 +24,6 @@ import ( "time" "github.com/containerd/containerd/containers" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/filters" "github.com/containerd/containerd/identifiers" "github.com/containerd/containerd/labels" @@ -32,6 +31,7 @@ import ( "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/protobuf/proto" "github.com/containerd/containerd/protobuf/types" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" bolt "go.etcd.io/bbolt" ) diff --git a/vendor/github.com/containerd/containerd/metadata/content.go b/vendor/github.com/containerd/containerd/metadata/content.go index 2df665fcf..e3ccf3f85 100644 --- a/vendor/github.com/containerd/containerd/metadata/content.go +++ b/vendor/github.com/containerd/containerd/metadata/content.go @@ -26,12 +26,12 @@ import ( "time" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/filters" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/metadata/boltutil" "github.com/containerd/containerd/namespaces" + "github.com/containerd/errdefs" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" bolt "go.etcd.io/bbolt" diff --git a/vendor/github.com/containerd/containerd/metadata/db.go b/vendor/github.com/containerd/containerd/metadata/db.go index 83b614fd1..7be54f796 100644 --- a/vendor/github.com/containerd/containerd/metadata/db.go +++ b/vendor/github.com/containerd/containerd/metadata/db.go @@ -30,10 +30,10 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/events" "github.com/containerd/containerd/gc" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/cleanup" "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" bolt "go.etcd.io/bbolt" ) diff --git a/vendor/github.com/containerd/containerd/metadata/gc.go b/vendor/github.com/containerd/containerd/metadata/gc.go index 5518a4487..4a810ea3f 100644 --- a/vendor/github.com/containerd/containerd/metadata/gc.go +++ b/vendor/github.com/containerd/containerd/metadata/gc.go @@ -26,7 +26,7 @@ import ( eventstypes "github.com/containerd/containerd/api/events" "github.com/containerd/containerd/gc" - "github.com/containerd/containerd/log" + "github.com/containerd/log" bolt "go.etcd.io/bbolt" ) diff --git a/vendor/github.com/containerd/containerd/metadata/images.go b/vendor/github.com/containerd/containerd/metadata/images.go index ff5b624cc..beba82d07 100644 --- a/vendor/github.com/containerd/containerd/metadata/images.go +++ b/vendor/github.com/containerd/containerd/metadata/images.go @@ -25,13 +25,13 @@ import ( "sync/atomic" "time" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/filters" "github.com/containerd/containerd/images" "github.com/containerd/containerd/labels" "github.com/containerd/containerd/metadata/boltutil" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/pkg/epoch" + "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/vendor/github.com/containerd/containerd/metadata/leases.go b/vendor/github.com/containerd/containerd/metadata/leases.go index 03fa75af3..7c451e746 100644 --- a/vendor/github.com/containerd/containerd/metadata/leases.go +++ b/vendor/github.com/containerd/containerd/metadata/leases.go @@ -24,11 +24,11 @@ import ( "sync/atomic" "time" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/filters" "github.com/containerd/containerd/leases" "github.com/containerd/containerd/metadata/boltutil" "github.com/containerd/containerd/namespaces" + "github.com/containerd/errdefs" digest "github.com/opencontainers/go-digest" bolt "go.etcd.io/bbolt" ) diff --git a/vendor/github.com/containerd/containerd/metadata/namespaces.go b/vendor/github.com/containerd/containerd/metadata/namespaces.go index 84eb83f27..8b6174e35 100644 --- a/vendor/github.com/containerd/containerd/metadata/namespaces.go +++ b/vendor/github.com/containerd/containerd/metadata/namespaces.go @@ -21,10 +21,10 @@ import ( "fmt" "strings" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/identifiers" l "github.com/containerd/containerd/labels" "github.com/containerd/containerd/namespaces" + "github.com/containerd/errdefs" bolt "go.etcd.io/bbolt" ) diff --git a/vendor/github.com/containerd/containerd/metadata/sandbox.go b/vendor/github.com/containerd/containerd/metadata/sandbox.go index 5766647d3..78126b4db 100644 --- a/vendor/github.com/containerd/containerd/metadata/sandbox.go +++ b/vendor/github.com/containerd/containerd/metadata/sandbox.go @@ -23,12 +23,12 @@ import ( "strings" "time" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/filters" "github.com/containerd/containerd/identifiers" "github.com/containerd/containerd/metadata/boltutil" "github.com/containerd/containerd/namespaces" api "github.com/containerd/containerd/sandbox" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" "go.etcd.io/bbolt" ) diff --git a/vendor/github.com/containerd/containerd/metadata/snapshot.go b/vendor/github.com/containerd/containerd/metadata/snapshot.go index fa6ebfeeb..8388e19c4 100644 --- a/vendor/github.com/containerd/containerd/metadata/snapshot.go +++ b/vendor/github.com/containerd/containerd/metadata/snapshot.go @@ -25,14 +25,14 @@ import ( "time" eventstypes "github.com/containerd/containerd/api/events" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/filters" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/metadata/boltutil" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/snapshots" + "github.com/containerd/errdefs" + "github.com/containerd/log" bolt "go.etcd.io/bbolt" ) diff --git a/vendor/github.com/containerd/containerd/mount/mount_windows.go b/vendor/github.com/containerd/containerd/mount/mount_windows.go index 7c24fa600..91ac6968d 100644 --- a/vendor/github.com/containerd/containerd/mount/mount_windows.go +++ b/vendor/github.com/containerd/containerd/mount/mount_windows.go @@ -27,7 +27,7 @@ import ( "github.com/Microsoft/go-winio/pkg/bindfilter" "github.com/Microsoft/hcsshim" - "github.com/containerd/containerd/log" + "github.com/containerd/log" "golang.org/x/sys/windows" ) diff --git a/vendor/github.com/containerd/containerd/mount/temp.go b/vendor/github.com/containerd/containerd/mount/temp.go index 83143521a..7849d0609 100644 --- a/vendor/github.com/containerd/containerd/mount/temp.go +++ b/vendor/github.com/containerd/containerd/mount/temp.go @@ -21,7 +21,7 @@ import ( "fmt" "os" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) var tempMountLocation = getTempDir() diff --git a/vendor/github.com/containerd/containerd/namespaces.go b/vendor/github.com/containerd/containerd/namespaces.go index 83ee828dd..f4cc949d8 100644 --- a/vendor/github.com/containerd/containerd/namespaces.go +++ b/vendor/github.com/containerd/containerd/namespaces.go @@ -21,9 +21,9 @@ import ( "strings" api "github.com/containerd/containerd/api/services/namespaces/v1" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/protobuf/types" + "github.com/containerd/errdefs" ) // NewNamespaceStoreFromClient returns a new namespace store diff --git a/vendor/github.com/containerd/containerd/namespaces/context.go b/vendor/github.com/containerd/containerd/namespaces/context.go index e5e23fe43..94ef9408d 100644 --- a/vendor/github.com/containerd/containerd/namespaces/context.go +++ b/vendor/github.com/containerd/containerd/namespaces/context.go @@ -21,8 +21,8 @@ import ( "fmt" "os" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/identifiers" + "github.com/containerd/errdefs" ) const ( diff --git a/vendor/github.com/containerd/containerd/pkg/snapshotters/annotations.go b/vendor/github.com/containerd/containerd/pkg/snapshotters/annotations.go index c7ad97c15..63476376c 100644 --- a/vendor/github.com/containerd/containerd/pkg/snapshotters/annotations.go +++ b/vendor/github.com/containerd/containerd/pkg/snapshotters/annotations.go @@ -21,7 +21,7 @@ import ( "github.com/containerd/containerd/images" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/vendor/github.com/containerd/containerd/pkg/transfer/proxy/transfer.go b/vendor/github.com/containerd/containerd/pkg/transfer/proxy/transfer.go index 50dba0b37..2ad7a9449 100644 --- a/vendor/github.com/containerd/containerd/pkg/transfer/proxy/transfer.go +++ b/vendor/github.com/containerd/containerd/pkg/transfer/proxy/transfer.go @@ -25,10 +25,10 @@ import ( transferapi "github.com/containerd/containerd/api/services/transfer/v1" transfertypes "github.com/containerd/containerd/api/types/transfer" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/streaming" "github.com/containerd/containerd/pkg/transfer" tstreaming "github.com/containerd/containerd/pkg/transfer/streaming" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" ) diff --git a/vendor/github.com/containerd/containerd/pkg/transfer/streaming/stream.go b/vendor/github.com/containerd/containerd/pkg/transfer/streaming/stream.go index c859cf42b..0028146b9 100644 --- a/vendor/github.com/containerd/containerd/pkg/transfer/streaming/stream.go +++ b/vendor/github.com/containerd/containerd/pkg/transfer/streaming/stream.go @@ -27,8 +27,8 @@ import ( "time" transferapi "github.com/containerd/containerd/api/types/transfer" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/streaming" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" ) diff --git a/vendor/github.com/containerd/containerd/pkg/transfer/streaming/writer.go b/vendor/github.com/containerd/containerd/pkg/transfer/streaming/writer.go index 94db9d6a8..f8f372d2b 100644 --- a/vendor/github.com/containerd/containerd/pkg/transfer/streaming/writer.go +++ b/vendor/github.com/containerd/containerd/pkg/transfer/streaming/writer.go @@ -23,8 +23,8 @@ import ( "sync/atomic" transferapi "github.com/containerd/containerd/api/types/transfer" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/pkg/streaming" + "github.com/containerd/log" "github.com/containerd/typeurl/v2" ) diff --git a/vendor/github.com/containerd/containerd/pkg/unpack/unpacker.go b/vendor/github.com/containerd/containerd/pkg/unpack/unpacker.go index c5c52ab2d..22f6fac4b 100644 --- a/vendor/github.com/containerd/containerd/pkg/unpack/unpacker.go +++ b/vendor/github.com/containerd/containerd/pkg/unpack/unpacker.go @@ -30,16 +30,16 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/diff" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/cleanup" "github.com/containerd/containerd/pkg/kmutex" "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/tracing" + "github.com/containerd/errdefs" + "github.com/containerd/log" "github.com/opencontainers/go-digest" "github.com/opencontainers/image-spec/identity" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/vendor/github.com/containerd/containerd/platforms/cpuinfo.go b/vendor/github.com/containerd/containerd/platforms/cpuinfo.go index 8c600fc96..91f50e8c8 100644 --- a/vendor/github.com/containerd/containerd/platforms/cpuinfo.go +++ b/vendor/github.com/containerd/containerd/platforms/cpuinfo.go @@ -20,7 +20,7 @@ import ( "runtime" "sync" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ) // Present the ARM instruction set architecture, eg: v7, v8 diff --git a/vendor/github.com/containerd/containerd/platforms/cpuinfo_linux.go b/vendor/github.com/containerd/containerd/platforms/cpuinfo_linux.go index 722d86c35..e07aa99cc 100644 --- a/vendor/github.com/containerd/containerd/platforms/cpuinfo_linux.go +++ b/vendor/github.com/containerd/containerd/platforms/cpuinfo_linux.go @@ -24,7 +24,7 @@ import ( "runtime" "strings" - "github.com/containerd/containerd/errdefs" + "github.com/containerd/errdefs" "golang.org/x/sys/unix" ) diff --git a/vendor/github.com/containerd/containerd/platforms/cpuinfo_other.go b/vendor/github.com/containerd/containerd/platforms/cpuinfo_other.go index fa5f19c42..8cbcbb24a 100644 --- a/vendor/github.com/containerd/containerd/platforms/cpuinfo_other.go +++ b/vendor/github.com/containerd/containerd/platforms/cpuinfo_other.go @@ -22,7 +22,7 @@ import ( "fmt" "runtime" - "github.com/containerd/containerd/errdefs" + "github.com/containerd/errdefs" ) func getCPUVariant() (string, error) { diff --git a/vendor/github.com/containerd/containerd/platforms/platforms.go b/vendor/github.com/containerd/containerd/platforms/platforms.go index 56613b076..44bc24a5c 100644 --- a/vendor/github.com/containerd/containerd/platforms/platforms.go +++ b/vendor/github.com/containerd/containerd/platforms/platforms.go @@ -116,7 +116,7 @@ import ( specs "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/containerd/containerd/errdefs" + "github.com/containerd/errdefs" ) var ( diff --git a/vendor/github.com/containerd/containerd/plugin/context.go b/vendor/github.com/containerd/containerd/plugin/context.go index 370508d28..d084564ea 100644 --- a/vendor/github.com/containerd/containerd/plugin/context.go +++ b/vendor/github.com/containerd/containerd/plugin/context.go @@ -23,8 +23,8 @@ import ( ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/events/exchange" + "github.com/containerd/errdefs" ) // InitContext is used for plugin initialization diff --git a/vendor/github.com/containerd/containerd/process.go b/vendor/github.com/containerd/containerd/process.go index 73d8f8662..d17bfb693 100644 --- a/vendor/github.com/containerd/containerd/process.go +++ b/vendor/github.com/containerd/containerd/process.go @@ -25,8 +25,8 @@ import ( "github.com/containerd/containerd/api/services/tasks/v1" "github.com/containerd/containerd/cio" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/protobuf" + "github.com/containerd/errdefs" ) // Process represents a system process diff --git a/vendor/github.com/containerd/containerd/pull.go b/vendor/github.com/containerd/containerd/pull.go index d72702a5f..0e2911d5f 100644 --- a/vendor/github.com/containerd/containerd/pull.go +++ b/vendor/github.com/containerd/containerd/pull.go @@ -24,7 +24,6 @@ import ( ocispec "github.com/opencontainers/image-spec/specs-go/v1" "golang.org/x/sync/semaphore" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/pkg/unpack" "github.com/containerd/containerd/platforms" @@ -32,6 +31,7 @@ import ( "github.com/containerd/containerd/remotes/docker" "github.com/containerd/containerd/remotes/docker/schema1" //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/containerd/containerd/tracing" + "github.com/containerd/errdefs" ) const ( diff --git a/vendor/github.com/containerd/containerd/remotes/docker/auth/fetch.go b/vendor/github.com/containerd/containerd/remotes/docker/auth/fetch.go index 64c6a38f9..244e03509 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/auth/fetch.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/auth/fetch.go @@ -26,9 +26,9 @@ import ( "strings" "time" - "github.com/containerd/containerd/log" remoteserrors "github.com/containerd/containerd/remotes/errors" "github.com/containerd/containerd/version" + "github.com/containerd/log" ) var ( diff --git a/vendor/github.com/containerd/containerd/remotes/docker/authorizer.go b/vendor/github.com/containerd/containerd/remotes/docker/authorizer.go index ebd69c16c..2fd1118bc 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/authorizer.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/authorizer.go @@ -25,10 +25,10 @@ import ( "strings" "sync" - "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes/docker/auth" remoteerrors "github.com/containerd/containerd/remotes/errors" + "github.com/containerd/errdefs" + "github.com/containerd/log" ) type dockerAuthorizer struct { diff --git a/vendor/github.com/containerd/containerd/remotes/docker/converter.go b/vendor/github.com/containerd/containerd/remotes/docker/converter.go index d7dca0d36..95a68d70e 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/converter.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/converter.go @@ -24,8 +24,8 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/vendor/github.com/containerd/containerd/remotes/docker/converter_fuzz.go b/vendor/github.com/containerd/containerd/remotes/docker/converter_fuzz.go index 908205392..aa7cf4666 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/converter_fuzz.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/converter_fuzz.go @@ -24,7 +24,7 @@ import ( fuzz "github.com/AdaLogics/go-fuzz-headers" "github.com/containerd/containerd/content/local" - "github.com/containerd/containerd/log" + "github.com/containerd/log" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" ) diff --git a/vendor/github.com/containerd/containerd/remotes/docker/fetcher.go b/vendor/github.com/containerd/containerd/remotes/docker/fetcher.go index ecf245933..3589db3ef 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/fetcher.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/fetcher.go @@ -26,9 +26,9 @@ import ( "net/url" "strings" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" + "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/vendor/github.com/containerd/containerd/remotes/docker/handler.go b/vendor/github.com/containerd/containerd/remotes/docker/handler.go index 27638ccc0..ccec49013 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/handler.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/handler.go @@ -25,8 +25,8 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/images" "github.com/containerd/containerd/labels" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/reference" + "github.com/containerd/log" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) diff --git a/vendor/github.com/containerd/containerd/remotes/docker/httpreadseeker.go b/vendor/github.com/containerd/containerd/remotes/docker/httpreadseeker.go index 824359339..6739e7904 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/httpreadseeker.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/httpreadseeker.go @@ -21,8 +21,8 @@ import ( "fmt" "io" - "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" + "github.com/containerd/errdefs" + "github.com/containerd/log" ) const maxRetry = 3 diff --git a/vendor/github.com/containerd/containerd/remotes/docker/pusher.go b/vendor/github.com/containerd/containerd/remotes/docker/pusher.go index 218a5dd30..a27cda0b5 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/pusher.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/pusher.go @@ -29,11 +29,11 @@ import ( "time" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes" remoteserrors "github.com/containerd/containerd/remotes/errors" + "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/vendor/github.com/containerd/containerd/remotes/docker/resolver.go b/vendor/github.com/containerd/containerd/remotes/docker/resolver.go index ce1f64625..b2b124214 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/resolver.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/resolver.go @@ -28,15 +28,15 @@ import ( "path" "strings" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/reference" "github.com/containerd/containerd/remotes" "github.com/containerd/containerd/remotes/docker/schema1" //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. remoteerrors "github.com/containerd/containerd/remotes/errors" "github.com/containerd/containerd/tracing" "github.com/containerd/containerd/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/vendor/github.com/containerd/containerd/remotes/docker/schema1/converter.go b/vendor/github.com/containerd/containerd/remotes/docker/schema1/converter.go index 8c9e520cd..75bd9875a 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/schema1/converter.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/schema1/converter.go @@ -34,11 +34,11 @@ 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/containerd/log" "github.com/containerd/containerd/remotes" + "github.com/containerd/errdefs" + "github.com/containerd/log" 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/vendor/github.com/containerd/containerd/remotes/docker/status.go b/vendor/github.com/containerd/containerd/remotes/docker/status.go index 1a9227725..c7764758f 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/status.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/status.go @@ -21,7 +21,7 @@ import ( "sync" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" + "github.com/containerd/errdefs" "github.com/moby/locker" ) diff --git a/vendor/github.com/containerd/containerd/remotes/handlers.go b/vendor/github.com/containerd/containerd/remotes/handlers.go index f24669dc4..912b85bfe 100644 --- a/vendor/github.com/containerd/containerd/remotes/handlers.go +++ b/vendor/github.com/containerd/containerd/remotes/handlers.go @@ -26,11 +26,11 @@ 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/log" "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" ) diff --git a/vendor/github.com/containerd/containerd/rootfs/apply.go b/vendor/github.com/containerd/containerd/rootfs/apply.go index 35eae6d63..61f4d7dfb 100644 --- a/vendor/github.com/containerd/containerd/rootfs/apply.go +++ b/vendor/github.com/containerd/containerd/rootfs/apply.go @@ -24,10 +24,10 @@ import ( "time" "github.com/containerd/containerd/diff" - "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/snapshots" + "github.com/containerd/errdefs" + "github.com/containerd/log" "github.com/opencontainers/go-digest" "github.com/opencontainers/image-spec/identity" ocispec "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/vendor/github.com/containerd/containerd/rootfs/init.go b/vendor/github.com/containerd/containerd/rootfs/init.go index 02d13bfc3..e6866ace2 100644 --- a/vendor/github.com/containerd/containerd/rootfs/init.go +++ b/vendor/github.com/containerd/containerd/rootfs/init.go @@ -22,9 +22,9 @@ import ( "fmt" "os" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" digest "github.com/opencontainers/go-digest" ) diff --git a/vendor/github.com/containerd/containerd/sandbox/controller.go b/vendor/github.com/containerd/containerd/sandbox/controller.go index b74f82c10..4885b4366 100644 --- a/vendor/github.com/containerd/containerd/sandbox/controller.go +++ b/vendor/github.com/containerd/containerd/sandbox/controller.go @@ -22,8 +22,8 @@ import ( "time" "github.com/containerd/containerd/api/types" - "github.com/containerd/containerd/platforms" "github.com/containerd/typeurl/v2" + imagespec "github.com/opencontainers/image-spec/specs-go/v1" ) type CreateOptions struct { @@ -90,7 +90,7 @@ type Controller interface { Start(ctx context.Context, sandboxID string) (ControllerInstance, error) // Platform returns target sandbox OS that will be used by Controller. // containerd will rely on this to generate proper OCI spec. - Platform(_ctx context.Context, _sandboxID string) (platforms.Platform, error) + Platform(_ctx context.Context, _sandboxID string) (imagespec.Platform, error) // Stop will stop sandbox instance Stop(ctx context.Context, sandboxID string, opts ...StopOpt) error // Wait blocks until sandbox process exits. diff --git a/vendor/github.com/containerd/containerd/sandbox/proxy/controller.go b/vendor/github.com/containerd/containerd/sandbox/proxy/controller.go index 6ff9c9413..fe8e95c29 100644 --- a/vendor/github.com/containerd/containerd/sandbox/proxy/controller.go +++ b/vendor/github.com/containerd/containerd/sandbox/proxy/controller.go @@ -20,9 +20,9 @@ import ( "context" api "github.com/containerd/containerd/api/services/sandbox/v1" - "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/sandbox" + "github.com/containerd/errdefs" + imagespec "github.com/opencontainers/image-spec/specs-go/v1" "google.golang.org/protobuf/types/known/anypb" ) @@ -73,14 +73,14 @@ func (s *remoteSandboxController) Start(ctx context.Context, sandboxID string) ( }, nil } -func (s *remoteSandboxController) Platform(ctx context.Context, sandboxID string) (platforms.Platform, error) { +func (s *remoteSandboxController) Platform(ctx context.Context, sandboxID string) (imagespec.Platform, error) { resp, err := s.client.Platform(ctx, &api.ControllerPlatformRequest{SandboxID: sandboxID}) if err != nil { - return platforms.Platform{}, errdefs.FromGRPC(err) + return imagespec.Platform{}, errdefs.FromGRPC(err) } platform := resp.GetPlatform() - return platforms.Platform{ + return imagespec.Platform{ Architecture: platform.GetArchitecture(), OS: platform.GetOS(), Variant: platform.GetVariant(), diff --git a/vendor/github.com/containerd/containerd/sandbox/proxy/store.go b/vendor/github.com/containerd/containerd/sandbox/proxy/store.go index 64e4a2b32..9544df810 100644 --- a/vendor/github.com/containerd/containerd/sandbox/proxy/store.go +++ b/vendor/github.com/containerd/containerd/sandbox/proxy/store.go @@ -20,8 +20,8 @@ import ( "context" api "github.com/containerd/containerd/api/services/sandbox/v1" - "github.com/containerd/containerd/errdefs" sb "github.com/containerd/containerd/sandbox" + "github.com/containerd/errdefs" ) // remoteSandboxStore is a low-level containerd client to manage sandbox environments metadata diff --git a/vendor/github.com/containerd/containerd/sandbox/store.go b/vendor/github.com/containerd/containerd/sandbox/store.go index cda646dde..5d0d42bdb 100644 --- a/vendor/github.com/containerd/containerd/sandbox/store.go +++ b/vendor/github.com/containerd/containerd/sandbox/store.go @@ -21,7 +21,7 @@ import ( "fmt" "time" - "github.com/containerd/containerd/errdefs" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" ) diff --git a/vendor/github.com/containerd/containerd/services/content/contentserver/contentserver.go b/vendor/github.com/containerd/containerd/services/content/contentserver/contentserver.go index 76a9e6eea..4c185aa1e 100644 --- a/vendor/github.com/containerd/containerd/services/content/contentserver/contentserver.go +++ b/vendor/github.com/containerd/containerd/services/content/contentserver/contentserver.go @@ -24,10 +24,10 @@ import ( api "github.com/containerd/containerd/api/services/content/v1" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/protobuf" ptypes "github.com/containerd/containerd/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" "google.golang.org/grpc" diff --git a/vendor/github.com/containerd/containerd/services/introspection/introspection.go b/vendor/github.com/containerd/containerd/services/introspection/introspection.go index 7f88af4f9..18fb914d2 100644 --- a/vendor/github.com/containerd/containerd/services/introspection/introspection.go +++ b/vendor/github.com/containerd/containerd/services/introspection/introspection.go @@ -20,9 +20,9 @@ import ( context "context" api "github.com/containerd/containerd/api/services/introspection/v1" - "github.com/containerd/containerd/errdefs" - "github.com/containerd/containerd/log" ptypes "github.com/containerd/containerd/protobuf/types" + "github.com/containerd/errdefs" + "github.com/containerd/log" ) // Service defines the introspection service interface diff --git a/vendor/github.com/containerd/containerd/services/introspection/local.go b/vendor/github.com/containerd/containerd/services/introspection/local.go index 5f9fc10f4..fb534f77e 100644 --- a/vendor/github.com/containerd/containerd/services/introspection/local.go +++ b/vendor/github.com/containerd/containerd/services/introspection/local.go @@ -32,13 +32,13 @@ import ( api "github.com/containerd/containerd/api/services/introspection/v1" "github.com/containerd/containerd/api/types" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/filters" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/protobuf" ptypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/services" "github.com/containerd/containerd/services/warning" + "github.com/containerd/errdefs" ) func init() { diff --git a/vendor/github.com/containerd/containerd/snapshots/native/native.go b/vendor/github.com/containerd/containerd/snapshots/native/native.go index dba94b93f..5277b8179 100644 --- a/vendor/github.com/containerd/containerd/snapshots/native/native.go +++ b/vendor/github.com/containerd/containerd/snapshots/native/native.go @@ -22,10 +22,10 @@ import ( "os" "path/filepath" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots/storage" + "github.com/containerd/log" "github.com/containerd/continuity/fs" ) diff --git a/vendor/github.com/containerd/containerd/snapshots/overlay/overlay.go b/vendor/github.com/containerd/containerd/snapshots/overlay/overlay.go index ecf6ebd27..369c2404d 100644 --- a/vendor/github.com/containerd/containerd/snapshots/overlay/overlay.go +++ b/vendor/github.com/containerd/containerd/snapshots/overlay/overlay.go @@ -26,12 +26,12 @@ import ( "strings" "syscall" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots/overlay/overlayutils" "github.com/containerd/containerd/snapshots/storage" "github.com/containerd/continuity/fs" + "github.com/containerd/log" "github.com/sirupsen/logrus" ) diff --git a/vendor/github.com/containerd/containerd/snapshots/overlay/overlayutils/check.go b/vendor/github.com/containerd/containerd/snapshots/overlay/overlayutils/check.go index 726c085a9..313947b07 100644 --- a/vendor/github.com/containerd/containerd/snapshots/overlay/overlayutils/check.go +++ b/vendor/github.com/containerd/containerd/snapshots/overlay/overlayutils/check.go @@ -25,10 +25,10 @@ import ( "syscall" kernel "github.com/containerd/containerd/contrib/seccomp/kernelversion" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/pkg/userns" "github.com/containerd/continuity/fs" + "github.com/containerd/log" ) const ( diff --git a/vendor/github.com/containerd/containerd/snapshots/proxy/proxy.go b/vendor/github.com/containerd/containerd/snapshots/proxy/proxy.go index 3ef3b2698..8e3bd1f83 100644 --- a/vendor/github.com/containerd/containerd/snapshots/proxy/proxy.go +++ b/vendor/github.com/containerd/containerd/snapshots/proxy/proxy.go @@ -22,11 +22,11 @@ import ( snapshotsapi "github.com/containerd/containerd/api/services/snapshots/v1" "github.com/containerd/containerd/api/types" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/protobuf" protobuftypes "github.com/containerd/containerd/protobuf/types" "github.com/containerd/containerd/snapshots" + "github.com/containerd/errdefs" ) // NewSnapshotter returns a new Snapshotter which communicates over a GRPC diff --git a/vendor/github.com/containerd/containerd/snapshots/storage/bolt.go b/vendor/github.com/containerd/containerd/snapshots/storage/bolt.go index 894ac2e02..3e8e8e45e 100644 --- a/vendor/github.com/containerd/containerd/snapshots/storage/bolt.go +++ b/vendor/github.com/containerd/containerd/snapshots/storage/bolt.go @@ -24,10 +24,10 @@ import ( "strings" "time" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/filters" "github.com/containerd/containerd/metadata/boltutil" "github.com/containerd/containerd/snapshots" + "github.com/containerd/errdefs" bolt "go.etcd.io/bbolt" ) diff --git a/vendor/github.com/containerd/containerd/snapshots/storage/metastore.go b/vendor/github.com/containerd/containerd/snapshots/storage/metastore.go index fe39fd2ed..786ae34b3 100644 --- a/vendor/github.com/containerd/containerd/snapshots/storage/metastore.go +++ b/vendor/github.com/containerd/containerd/snapshots/storage/metastore.go @@ -26,8 +26,8 @@ import ( "fmt" "sync" - "github.com/containerd/containerd/log" "github.com/containerd/containerd/snapshots" + "github.com/containerd/log" "github.com/hashicorp/go-multierror" bolt "go.etcd.io/bbolt" ) diff --git a/vendor/github.com/containerd/containerd/task.go b/vendor/github.com/containerd/containerd/task.go index 9667a1cf5..099afdcf8 100644 --- a/vendor/github.com/containerd/containerd/task.go +++ b/vendor/github.com/containerd/containerd/task.go @@ -33,7 +33,6 @@ import ( "github.com/containerd/containerd/cio" "github.com/containerd/containerd/content" "github.com/containerd/containerd/diff" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/oci" @@ -43,6 +42,7 @@ import ( "github.com/containerd/containerd/rootfs" "github.com/containerd/containerd/runtime/linux/runctypes" "github.com/containerd/containerd/runtime/v2/runc/options" + "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/vendor/github.com/containerd/containerd/task_opts.go b/vendor/github.com/containerd/containerd/task_opts.go index da269016e..7bcd8a4e6 100644 --- a/vendor/github.com/containerd/containerd/task_opts.go +++ b/vendor/github.com/containerd/containerd/task_opts.go @@ -25,11 +25,11 @@ import ( "github.com/containerd/containerd/api/types" "github.com/containerd/containerd/content" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/mount" "github.com/containerd/containerd/runtime/linux/runctypes" "github.com/containerd/containerd/runtime/v2/runc/options" + "github.com/containerd/errdefs" imagespec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/opencontainers/runtime-spec/specs-go" ) diff --git a/vendor/github.com/containerd/containerd/transfer.go b/vendor/github.com/containerd/containerd/transfer.go index 9979aa75b..412957bb9 100644 --- a/vendor/github.com/containerd/containerd/transfer.go +++ b/vendor/github.com/containerd/containerd/transfer.go @@ -23,11 +23,11 @@ import ( streamingapi "github.com/containerd/containerd/api/services/streaming/v1" transferapi "github.com/containerd/containerd/api/services/transfer/v1" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/pkg/streaming" "github.com/containerd/containerd/pkg/transfer" "github.com/containerd/containerd/pkg/transfer/proxy" "github.com/containerd/containerd/protobuf" + "github.com/containerd/errdefs" "github.com/containerd/typeurl/v2" ) diff --git a/vendor/github.com/containerd/containerd/version/version.go b/vendor/github.com/containerd/containerd/version/version.go index 782771e4d..dfe46c922 100644 --- a/vendor/github.com/containerd/containerd/version/version.go +++ b/vendor/github.com/containerd/containerd/version/version.go @@ -23,7 +23,7 @@ var ( Package = "github.com/containerd/containerd" // Version holds the complete version number. Filled in at linking time. - Version = "1.7.17+unknown" + Version = "1.7.18+unknown" // Revision is filled with the VCS (e.g. git) revision being used to build // the program at linking time. 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/containerd/errdefs/errors.go b/vendor/github.com/containerd/errdefs/errors.go similarity index 100% rename from vendor/github.com/containerd/containerd/errdefs/errors.go rename to vendor/github.com/containerd/errdefs/errors.go diff --git a/vendor/github.com/containerd/containerd/errdefs/grpc.go b/vendor/github.com/containerd/errdefs/grpc.go similarity index 100% rename from vendor/github.com/containerd/containerd/errdefs/grpc.go rename to vendor/github.com/containerd/errdefs/grpc.go diff --git a/vendor/modules.txt b/vendor/modules.txt index cbffb056c..60ffda6ac 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -252,7 +252,7 @@ github.com/containerd/cgroups/stats/v1 # github.com/containerd/console v1.0.4 ## explicit; go 1.13 github.com/containerd/console -# github.com/containerd/containerd v1.7.17 +# github.com/containerd/containerd v1.7.18 ## explicit; go 1.21 github.com/containerd/containerd github.com/containerd/containerd/api/events @@ -300,7 +300,6 @@ github.com/containerd/containerd/images/converter github.com/containerd/containerd/labels github.com/containerd/containerd/leases github.com/containerd/containerd/leases/proxy -github.com/containerd/containerd/log github.com/containerd/containerd/metadata github.com/containerd/containerd/metadata/boltutil github.com/containerd/containerd/mount @@ -364,6 +363,9 @@ github.com/containerd/continuity/fs/fstest github.com/containerd/continuity/pathdriver github.com/containerd/continuity/proto github.com/containerd/continuity/sysx +# 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