Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/sirupsen/logrus v1.10.2
github.com/spf13/cobra v1.10.2
github.com/stretchr/testify v1.12.1
oras.land/oras-go/v2 v2.6.4
oras.land/oras-go/v2 v2.7.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,5 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.2.0 h1:I0DwBVMGAx26dttAj1BtJLAkVGncrkkUXfJLC4Flt/I=
gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A=
oras.land/oras-go/v2 v2.6.4 h1:l4uv+UT7QK4Hju+KOEZ/c8iOjq3iZH7cULoRpUnSDAU=
oras.land/oras-go/v2 v2.6.4/go.mod h1:imXEFiYkTZUVVYkfv/r5GVmWeiLkGtNQA8FU4F/sjKs=
oras.land/oras-go/v2 v2.7.0 h1:0bXRBBSqYgPSjZRrhJbT71Rb465c+rdlft2xdQPxLtQ=
oras.land/oras-go/v2 v2.7.0/go.mod h1:imXEFiYkTZUVVYkfv/r5GVmWeiLkGtNQA8FU4F/sjKs=
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ golang.org/x/sys/unix
golang.org/x/sys/windows
# gotest.tools/v3 v3.2.0
## explicit; go 1.13
# oras.land/oras-go/v2 v2.6.4
# oras.land/oras-go/v2 v2.7.0
## explicit; go 1.26.0
oras.land/oras-go/v2
oras.land/oras-go/v2/content
Expand Down
5 changes: 4 additions & 1 deletion vendor/oras.land/oras-go/v2/content/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,11 @@ func ReadAll(r io.Reader, desc ocispec.Descriptor) ([]byte, error) {
func ensureEOF(r io.Reader) error {
var peek [1]byte
_, err := io.ReadFull(r, peek[:])
if err != io.EOF {
if err == nil {
return ErrTrailingData
}
if err != io.EOF {
return fmt.Errorf("read failed: %w", err)
}
return nil
}
4 changes: 4 additions & 0 deletions vendor/oras.land/oras-go/v2/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,10 @@ func mountOrCopyNode(ctx context.Context, src content.ReadOnlyStorage, dst conte

// Mount or copy
if err := mounter.Mount(ctx, desc, sourceRepository, getContent); err != nil && !errors.Is(err, skipSource) {
if errors.Is(err, SkipNode) {
// PreCopy made the blob available in the target
return nil
}
return newCopyError("Mount", CopyErrorOriginDestination, err)
}

Expand Down
11 changes: 10 additions & 1 deletion vendor/oras.land/oras-go/v2/extendedcopy.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ func (opts *ExtendedCopyGraphOptions) FilterArtifactType(regex *regexp.Regexp) {
// if the artifact type is not present in the descriptors,
// fetch it from the manifest content.
switch p.MediaType {
case spec.MediaTypeArtifactManifest, ocispec.MediaTypeImageManifest:
case spec.MediaTypeArtifactManifest, ocispec.MediaTypeImageManifest, ocispec.MediaTypeImageIndex:
artifactType, err := fetchArtifactType(ctx, src, p)
if err != nil {
return nil, err
Expand Down Expand Up @@ -397,7 +397,16 @@ func fetchArtifactType(ctx context.Context, src content.ReadOnlyGraphStorage, de
if err := json.NewDecoder(rc).Decode(&manifest); err != nil {
return "", err
}
if manifest.ArtifactType != "" {
return manifest.ArtifactType, nil
}
return manifest.Config.MediaType, nil
case ocispec.MediaTypeImageIndex:
var index ocispec.Index
if err := json.NewDecoder(rc).Decode(&index); err != nil {
return "", err
}
return index.ArtifactType, nil
default:
return "", nil
}
Expand Down
Loading
Loading