mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
client/utils: use containerd errdefs checks
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
committed by
Sebastiaan van Stijn
parent
144363fea2
commit
6bde39b729
@@ -6,8 +6,8 @@ import (
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
cerrdefs "github.com/containerd/errdefs"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/docker/docker/internal/lazyregexp"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
)
|
||||
@@ -90,7 +90,7 @@ func encodePlatforms(platform ...ocispec.Platform) ([]string, error) {
|
||||
func encodePlatform(platform *ocispec.Platform) (string, error) {
|
||||
p, err := json.Marshal(platform)
|
||||
if err != nil {
|
||||
return "", errdefs.InvalidParameter(fmt.Errorf("invalid platform: %v", err))
|
||||
return "", fmt.Errorf("%w: invalid platform: %v", cerrdefs.ErrInvalidArgument, err)
|
||||
}
|
||||
return string(p), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user