From 1ff261d38e35bb0e17d61cb1251f20025c7fe452 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 18 Jan 2024 00:44:06 +0100 Subject: [PATCH] vendor: github.com/docker/docker v25.0.1 - pkg/system: return even richer xattr errors full diff: https://github.com/moby/moby/compare/v25.0.0-rc.1...v25.0.1 Signed-off-by: Sebastiaan van Stijn --- go.mod | 2 +- go.sum | 4 ++-- .../builder/remotecontext/urlutil/urlutil.go | 2 +- vendor/github.com/docker/docker/errdefs/is.go | 6 ++++++ .../docker/docker/pkg/system/xattrs.go | 18 ++++++++++++++++++ .../docker/docker/pkg/system/xattrs_linux.go | 12 +++++------- vendor/modules.txt | 2 +- 7 files changed, 34 insertions(+), 12 deletions(-) create mode 100644 vendor/github.com/docker/docker/pkg/system/xattrs.go diff --git a/go.mod b/go.mod index 397fb210..8e342849 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/distribution/reference v0.5.0 github.com/docker/cli v25.0.0-rc.1+incompatible github.com/docker/cli-docs-tool v0.6.0 - github.com/docker/docker v25.0.0-rc.1+incompatible + github.com/docker/docker v25.0.1+incompatible github.com/docker/go-units v0.5.0 github.com/gofrs/flock v0.8.1 github.com/gogo/protobuf v1.3.2 diff --git a/go.sum b/go.sum index 0f8276d4..d4b0ad65 100644 --- a/go.sum +++ b/go.sum @@ -126,8 +126,8 @@ github.com/docker/cli-docs-tool v0.6.0/go.mod h1:zMjqTFCU361PRh8apiXzeAZ1Q/xupbI github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v25.0.0-rc.1+incompatible h1:Bdb06U1Z1P78uxluMZE6MI94tGICXzWnArsiW5hg6pU= -github.com/docker/docker v25.0.0-rc.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v25.0.1+incompatible h1:k5TYd5rIVQRSqcTwCID+cyVA0yRg86+Pcrz1ls0/frA= +github.com/docker/docker v25.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8= github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40= github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0= diff --git a/vendor/github.com/docker/docker/builder/remotecontext/urlutil/urlutil.go b/vendor/github.com/docker/docker/builder/remotecontext/urlutil/urlutil.go index e38988a3..e8459cc8 100644 --- a/vendor/github.com/docker/docker/builder/remotecontext/urlutil/urlutil.go +++ b/vendor/github.com/docker/docker/builder/remotecontext/urlutil/urlutil.go @@ -12,7 +12,7 @@ import ( // urlPathWithFragmentSuffix matches fragments to use as Git reference and build // context from the Git repository. See IsGitURL for details. -var urlPathWithFragmentSuffix = regexp.MustCompile(".git(?:#.+)?$") +var urlPathWithFragmentSuffix = regexp.MustCompile(`\.git(?:#.+)?$`) // IsURL returns true if the provided str is an HTTP(S) URL by checking if it // has a http:// or https:// scheme. No validation is performed to verify if the diff --git a/vendor/github.com/docker/docker/errdefs/is.go b/vendor/github.com/docker/docker/errdefs/is.go index b0d745ca..f94034cb 100644 --- a/vendor/github.com/docker/docker/errdefs/is.go +++ b/vendor/github.com/docker/docker/errdefs/is.go @@ -9,6 +9,10 @@ type causer interface { Cause() error } +type wrapErr interface { + Unwrap() error +} + func getImplementer(err error) error { switch e := err.(type) { case @@ -28,6 +32,8 @@ func getImplementer(err error) error { return err case causer: return getImplementer(e.Cause()) + case wrapErr: + return getImplementer(e.Unwrap()) default: return err } diff --git a/vendor/github.com/docker/docker/pkg/system/xattrs.go b/vendor/github.com/docker/docker/pkg/system/xattrs.go new file mode 100644 index 00000000..b3f4e8a2 --- /dev/null +++ b/vendor/github.com/docker/docker/pkg/system/xattrs.go @@ -0,0 +1,18 @@ +package system // import "github.com/docker/docker/pkg/system" + +type XattrError struct { + Op string + Attr string + Path string + Err error +} + +func (e *XattrError) Error() string { return e.Op + " " + e.Attr + " " + e.Path + ": " + e.Err.Error() } + +func (e *XattrError) Unwrap() error { return e.Err } + +// Timeout reports whether this error represents a timeout. +func (e *XattrError) Timeout() bool { + t, ok := e.Err.(interface{ Timeout() bool }) + return ok && t.Timeout() +} diff --git a/vendor/github.com/docker/docker/pkg/system/xattrs_linux.go b/vendor/github.com/docker/docker/pkg/system/xattrs_linux.go index 4196b281..facfbb31 100644 --- a/vendor/github.com/docker/docker/pkg/system/xattrs_linux.go +++ b/vendor/github.com/docker/docker/pkg/system/xattrs_linux.go @@ -1,8 +1,6 @@ package system // import "github.com/docker/docker/pkg/system" import ( - "io/fs" - "golang.org/x/sys/unix" ) @@ -10,8 +8,8 @@ import ( // and associated with the given path in the file system. // It will returns a nil slice and nil error if the xattr is not set. func Lgetxattr(path string, attr string) ([]byte, error) { - pathErr := func(err error) ([]byte, error) { - return nil, &fs.PathError{Op: "lgetxattr", Path: path, Err: err} + sysErr := func(err error) ([]byte, error) { + return nil, &XattrError{Op: "lgetxattr", Attr: attr, Path: path, Err: err} } // Start with a 128 length byte array @@ -22,7 +20,7 @@ func Lgetxattr(path string, attr string) ([]byte, error) { // Buffer too small, use zero-sized buffer to get the actual size sz, errno = unix.Lgetxattr(path, attr, []byte{}) if errno != nil { - return pathErr(errno) + return sysErr(errno) } dest = make([]byte, sz) sz, errno = unix.Lgetxattr(path, attr, dest) @@ -32,7 +30,7 @@ func Lgetxattr(path string, attr string) ([]byte, error) { case errno == unix.ENODATA: return nil, nil case errno != nil: - return pathErr(errno) + return sysErr(errno) } return dest[:sz], nil @@ -43,7 +41,7 @@ func Lgetxattr(path string, attr string) ([]byte, error) { func Lsetxattr(path string, attr string, data []byte, flags int) error { err := unix.Lsetxattr(path, attr, data, flags) if err != nil { - return &fs.PathError{Op: "lsetxattr", Path: path, Err: err} + return &XattrError{Op: "lsetxattr", Attr: attr, Path: path, Err: err} } return nil } diff --git a/vendor/modules.txt b/vendor/modules.txt index f8117552..1b4271c6 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -251,7 +251,7 @@ github.com/docker/distribution/registry/client/transport github.com/docker/distribution/registry/storage/cache github.com/docker/distribution/registry/storage/cache/memory github.com/docker/distribution/uuid -# github.com/docker/docker v25.0.0-rc.1+incompatible +# github.com/docker/docker v25.0.1+incompatible ## explicit github.com/docker/docker/api github.com/docker/docker/api/types