diff --git a/cmd/oras/cache.go b/cmd/oras/cache.go index ad1fa52bc..b23d89283 100644 --- a/cmd/oras/cache.go +++ b/cmd/oras/cache.go @@ -8,7 +8,7 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/content/local" "github.com/containerd/containerd/errdefs" - artifactspec "github.com/notaryproject/artifacts/specs-go/v2" + artifactspec "github.com/opencontainers/artifacts/specs-go/v2" digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" diff --git a/cmd/oras/discover.go b/cmd/oras/discover.go index f79e68662..55d0f9504 100644 --- a/cmd/oras/discover.go +++ b/cmd/oras/discover.go @@ -81,11 +81,8 @@ func runDiscover(opts discoverOptions) error { fmt.Println("Discovered", len(artifacts), "artifacts referencing", opts.targetRef) fmt.Println("Digest:", desc.Digest) - for _, artifact := range artifacts { - fmt.Println("Reference:", artifact.ArtifactType) - for _, blob := range artifact.Blobs { - fmt.Println("-", blob.Digest) - } + for digest := range artifacts { + fmt.Println("Reference:", digest) } return nil diff --git a/go.mod b/go.mod index a0b11686b..ce283d972 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,10 @@ go 1.16 replace ( // WARNING! Do NOT replace these without also replacing their lines in the `require` stanza below. // These `replace` stanzas are IGNORED when this is imported as a library - github.com/containerd/containerd => github.com/notaryproject/containerd v1.5.0-beta.4.0.20210329094736-a683d692c2d3 + github.com/containerd/containerd => github.com/notaryproject/containerd v1.5.0-beta.4.0.20210331082447-7f3d3544c4a1 github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d github.com/docker/docker => github.com/moby/moby v17.12.0-ce-rc1.0.20200618181300-9dc6525e6118+incompatible + github.com/opencontainers/artifacts => github.com/aviral26/artifacts v0.0.0-20210331072334-fac4f3a4da4e ) require ( @@ -18,7 +19,7 @@ require ( github.com/docker/docker-credential-helpers v0.6.3 // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/morikuni/aec v1.0.0 // indirect - github.com/notaryproject/artifacts v0.0.0-20210325201627-49d06c9f1a07 + github.com/opencontainers/artifacts v0.0.0-20210209205009-a282023000bd github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/image-spec v1.0.1 github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 diff --git a/go.sum b/go.sum index 781e3e93d..232167ab4 100644 --- a/go.sum +++ b/go.sum @@ -59,6 +59,8 @@ github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hC github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/aviral26/artifacts v0.0.0-20210331072334-fac4f3a4da4e h1:PpLNjTpAp5mTxkuUdM2vCPckrXBPszurJQFvdFUaV1A= +github.com/aviral26/artifacts v0.0.0-20210331072334-fac4f3a4da4e/go.mod h1:IBQOjhxIKxb9G4h9NiWAJLGBgKPlIy27tcpPDTAfUQw= github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -370,10 +372,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= -github.com/notaryproject/artifacts v0.0.0-20210325201627-49d06c9f1a07 h1:geJlhRFBwSJXhIv7KMgAXBz1Ie6wsuFeE5vuau3B4AQ= -github.com/notaryproject/artifacts v0.0.0-20210325201627-49d06c9f1a07/go.mod h1:za0DINIIQLPCBn9AhLfPjywgT51o0zll644gbIXiQiQ= -github.com/notaryproject/containerd v1.5.0-beta.4.0.20210329094736-a683d692c2d3 h1:lY6WLYzlPQkGkRCyoG/PPe7NmJNiiMHdrmeErbp64wA= -github.com/notaryproject/containerd v1.5.0-beta.4.0.20210329094736-a683d692c2d3/go.mod h1:uvn4m2BuoisfEj5I7GLoCJguWejxwLUlyM0L4XnVWY8= +github.com/notaryproject/containerd v1.5.0-beta.4.0.20210331082447-7f3d3544c4a1 h1:fclXC65oOW0xdy3Efk4bMAdh0F8r4cFX+KarSLt3zoI= +github.com/notaryproject/containerd v1.5.0-beta.4.0.20210331082447-7f3d3544c4a1/go.mod h1:rkfsydnYZBb6tU7iTyyTvQcoMXezKdDmX7+lEE1SyUg= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= diff --git a/internal/resolver/dummy.go b/internal/resolver/dummy.go index 39267eaea..5e37a27da 100644 --- a/internal/resolver/dummy.go +++ b/internal/resolver/dummy.go @@ -8,7 +8,7 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/remotes" - artifactspec "github.com/notaryproject/artifacts/specs-go/v2" + artifactspec "github.com/opencontainers/artifacts/specs-go/v2" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" @@ -54,7 +54,7 @@ func (r *dummyResolver) Pusher(ctx context.Context, ref string) (remotes.Pusher, // Discoverer returns a new discoverer for the provided reference func (r *dummyResolver) Discoverer(ctx context.Context, ref string) (remotes.Discoverer, error) { - return remotes.DiscovererFunc(func(ctx context.Context, desc ocispec.Descriptor, artifactType string) ([]artifactspec.Artifact, error) { + return remotes.DiscovererFunc(func(ctx context.Context, desc ocispec.Descriptor, artifactType string) (map[digest.Digest]artifactspec.Artifact, error) { return nil, errors.Wrap(errdefs.ErrNotFound, "dummy resolver") }), nil } diff --git a/pkg/oras/discover.go b/pkg/oras/discover.go index 47b626570..65ba56669 100644 --- a/pkg/oras/discover.go +++ b/pkg/oras/discover.go @@ -4,12 +4,13 @@ import ( "context" "github.com/containerd/containerd/remotes" - artifactspec "github.com/notaryproject/artifacts/specs-go/v2" + artifactspec "github.com/opencontainers/artifacts/specs-go/v2" + digest "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) // Discover discovers artifacts referencing the specified artifact -func Discover(ctx context.Context, resolver remotes.Resolver, ref, artifactType string) (ocispec.Descriptor, []artifactspec.Artifact, error) { +func Discover(ctx context.Context, resolver remotes.Resolver, ref, artifactType string) (ocispec.Descriptor, map[digest.Digest]artifactspec.Artifact, error) { _, desc, err := resolver.Resolve(ctx, ref) if err != nil { return ocispec.Descriptor{}, nil, err diff --git a/pkg/oras/pull.go b/pkg/oras/pull.go index eda7fc663..9d31cf425 100644 --- a/pkg/oras/pull.go +++ b/pkg/oras/pull.go @@ -10,7 +10,7 @@ import ( "github.com/containerd/containerd/images" "github.com/containerd/containerd/log" "github.com/containerd/containerd/remotes" - artifactspec "github.com/notaryproject/artifacts/specs-go/v2" + artifactspec "github.com/opencontainers/artifacts/specs-go/v2" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" "golang.org/x/sync/semaphore" diff --git a/pkg/oras/pull_opts.go b/pkg/oras/pull_opts.go index f8e317643..dc3d9fb50 100644 --- a/pkg/oras/pull_opts.go +++ b/pkg/oras/pull_opts.go @@ -9,7 +9,7 @@ import ( orascontent "github.com/deislabs/oras/pkg/content" "github.com/containerd/containerd/images" - artifactspec "github.com/notaryproject/artifacts/specs-go/v2" + artifactspec "github.com/opencontainers/artifacts/specs-go/v2" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "golang.org/x/sync/semaphore" diff --git a/pkg/oras/push.go b/pkg/oras/push.go index 0aa602e62..531ca0041 100644 --- a/pkg/oras/push.go +++ b/pkg/oras/push.go @@ -7,7 +7,7 @@ import ( "github.com/containerd/containerd/images" "github.com/containerd/containerd/remotes" artifact "github.com/deislabs/oras/pkg/artifact" - artifactspec "github.com/notaryproject/artifacts/specs-go/v2" + artifactspec "github.com/opencontainers/artifacts/specs-go/v2" 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/pkg/oras/push_opts.go b/pkg/oras/push_opts.go index 1215120bd..7ce2d101e 100644 --- a/pkg/oras/push_opts.go +++ b/pkg/oras/push_opts.go @@ -11,8 +11,8 @@ import ( orascontent "github.com/deislabs/oras/pkg/content" "github.com/containerd/containerd/images" - artifactspecs "github.com/notaryproject/artifacts/specs-go" - artifactspec "github.com/notaryproject/artifacts/specs-go/v2" + artifactspecs "github.com/opencontainers/artifacts/specs-go" + artifactspec "github.com/opencontainers/artifacts/specs-go/v2" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" )