Skip to content

Commit

Permalink
resolved comments
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxuan Wang <[email protected]>
  • Loading branch information
Xiaoxuan Wang committed Sep 5, 2024
1 parent 42c0434 commit 2a6ec49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cmd/oras/root/manifest/index/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/spf13/cobra"
"oras.land/oras-go/v2"
"oras.land/oras-go/v2/content"
"oras.land/oras-go/v2/errdef"
"oras.land/oras/cmd/oras/internal/argument"
"oras.land/oras/cmd/oras/internal/command"
"oras.land/oras/cmd/oras/internal/display"
Expand Down Expand Up @@ -142,7 +143,7 @@ func getPlatform(ctx context.Context, target oras.ReadOnlyTarget, manifestBytes
}
// if config size is larger than 4 MiB, discontinue the fetch
if manifest.Config.Size >= maxConfigSize {
return nil, fmt.Errorf("config is too large")
return nil, fmt.Errorf("config size %v exceeds MaxBytes %v: %w", manifest.Config.Size, maxConfigSize, errdef.ErrSizeExceedsLimit)

Check warning on line 146 in cmd/oras/root/manifest/index/create.go

View check run for this annotation

Codecov / codecov/patch

cmd/oras/root/manifest/index/create.go#L146

Added line #L146 was not covered by tests
}
// fetch config content
contentBytes, err := content.FetchAll(ctx, target, manifest.Config)
Expand Down
2 changes: 1 addition & 1 deletion internal/descriptor/descriptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
)

// IsManifest checks if a descriptor describes a manifest.
// Copied from `oras-go`: https://github.com/oras-project/oras-go/blob/d6c837e439f4c567f8003eab6e423c22900452a8/internal/descriptor/descriptor.go#L67
// Adapted from `oras-go`: https://github.com/oras-project/oras-go/blob/d6c837e439f4c567f8003eab6e423c22900452a8/internal/descriptor/descriptor.go#L67
func IsManifest(desc ocispec.Descriptor) bool {
switch desc.MediaType {
case docker.MediaTypeManifest,
Expand Down

0 comments on commit 2a6ec49

Please sign in to comment.