Merge pull request #4838 from thaJeztah/24.0_vendor_runc_v1.1.11

[24.0] vendor: github.com/docker/docker v24.0.8
This commit is contained in:
Brian Goff 2024-01-31 12:07:26 -08:00 committed by GitHub
commit 07d335afb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 52 additions and 27 deletions

View File

@ -10,7 +10,7 @@ require (
github.com/containerd/containerd v1.6.21 github.com/containerd/containerd v1.6.21
github.com/creack/pty v1.1.18 github.com/creack/pty v1.1.18
github.com/docker/distribution v2.8.2+incompatible github.com/docker/distribution v2.8.2+incompatible
github.com/docker/docker v24.0.7+incompatible github.com/docker/docker v24.0.8+incompatible
github.com/docker/docker-credential-helpers v0.7.0 github.com/docker/docker-credential-helpers v0.7.0
github.com/docker/go-connections v0.4.0 github.com/docker/go-connections v0.4.0
github.com/docker/go-units v0.5.0 github.com/docker/go-units v0.5.0
@ -61,7 +61,7 @@ require (
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/miekg/pkcs11 v1.1.1 // indirect github.com/miekg/pkcs11 v1.1.1 // indirect
github.com/moby/sys/symlink v0.2.0 // indirect github.com/moby/sys/symlink v0.2.0 // indirect
github.com/opencontainers/runc v1.1.7 // indirect github.com/opencontainers/runc v1.1.11 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect github.com/prometheus/common v0.37.0 // indirect

View File

@ -96,8 +96,8 @@ github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xb
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= 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 h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= github.com/docker/docker v24.0.8+incompatible h1:lbGlhLzolo0tpp+paD0JzOYId072MQmQxZLPevQCFPU=
github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v24.0.8+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A=
github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0=
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0= github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
@ -303,8 +303,8 @@ github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3I
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/image-spec v1.1.0-rc3 h1:fzg1mXZFj8YdPeNkRXMg+zb88BFV0Ys52cJydRwBkb8= github.com/opencontainers/image-spec v1.1.0-rc3 h1:fzg1mXZFj8YdPeNkRXMg+zb88BFV0Ys52cJydRwBkb8=
github.com/opencontainers/image-spec v1.1.0-rc3/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= github.com/opencontainers/image-spec v1.1.0-rc3/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8=
github.com/opencontainers/runc v1.1.7 h1:y2EZDS8sNng4Ksf0GUYNhKbTShZJPJg1FiXJNH/uoCk= github.com/opencontainers/runc v1.1.11 h1:9LjxyVlE0BPMRP2wuQDRlHV4941Jp9rc3F0+YKimopA=
github.com/opencontainers/runc v1.1.7/go.mod h1:CbUumNnWCuTGFukNXahoo/RFBZvDAgRh/smNYNOhA50= github.com/opencontainers/runc v1.1.11/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8=
github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=

View File

@ -3011,8 +3011,6 @@ definitions:
Name: "journald" Name: "journald"
- Type: "Log" - Type: "Log"
Name: "json-file" Name: "json-file"
- Type: "Log"
Name: "logentries"
- Type: "Log" - Type: "Log"
Name: "splunk" Name: "splunk"
- Type: "Log" - Type: "Log"
@ -5334,7 +5332,7 @@ definitions:
type: "array" type: "array"
items: items:
type: "string" type: "string"
example: ["awslogs", "fluentd", "gcplogs", "gelf", "journald", "json-file", "logentries", "splunk", "syslog"] example: ["awslogs", "fluentd", "gcplogs", "gelf", "journald", "json-file", "splunk", "syslog"]
RegistryServiceConfig: RegistryServiceConfig:

View File

@ -66,8 +66,12 @@ func (cli *Client) ContainerWait(ctx context.Context, containerID string, condit
// //
// If there's a JSON parsing error, read the real error message // If there's a JSON parsing error, read the real error message
// off the body and send it to the client. // off the body and send it to the client.
_, _ = io.ReadAll(io.LimitReader(stream, containerWaitErrorMsgLimit)) if errors.As(err, new(*json.SyntaxError)) {
errC <- errors.New(responseText.String()) _, _ = io.ReadAll(io.LimitReader(stream, containerWaitErrorMsgLimit))
errC <- errors.New(responseText.String())
} else {
errC <- err
}
return return
} }

View File

@ -11,17 +11,11 @@ import (
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"strconv" "strconv"
"sync"
"syscall" "syscall"
"github.com/opencontainers/runc/libcontainer/user" "github.com/opencontainers/runc/libcontainer/user"
) )
var (
entOnce sync.Once
getentCmd string
)
func mkdirAs(path string, mode os.FileMode, owner Identity, mkAll, chownExisting bool) error { func mkdirAs(path string, mode os.FileMode, owner Identity, mkAll, chownExisting bool) error {
path, err := filepath.Abs(path) path, err := filepath.Abs(path)
if err != nil { if err != nil {
@ -162,10 +156,10 @@ func getentGroup(name string) (user.Group, error) {
} }
func callGetent(database, key string) (io.Reader, error) { func callGetent(database, key string) (io.Reader, error) {
entOnce.Do(func() { getentCmd, _ = resolveBinary("getent") }) getentCmd, err := resolveBinary("getent")
// if no `getent` command on host, can't do anything else // if no `getent` command within the execution environment, can't do anything else
if getentCmd == "" { if err != nil {
return nil, fmt.Errorf("unable to find getent command") return nil, fmt.Errorf("unable to find getent command: %w", err)
} }
command := exec.Command(getentCmd, database, key) command := exec.Command(getentCmd, database, key)
// we run getent within container filesystem, but without /dev so /dev/null is not available for exec to mock stdin // we run getent within container filesystem, but without /dev so /dev/null is not available for exec to mock stdin

View File

@ -3,11 +3,15 @@ package ioutils // import "github.com/docker/docker/pkg/ioutils"
import ( import (
"context" "context"
"io" "io"
"runtime/debug"
"sync/atomic"
// make sure crypto.SHA256, crypto.sha512 and crypto.SHA384 are registered // make sure crypto.SHA256, crypto.sha512 and crypto.SHA384 are registered
// TODO remove once https://github.com/opencontainers/go-digest/pull/64 is merged. // TODO remove once https://github.com/opencontainers/go-digest/pull/64 is merged.
_ "crypto/sha256" _ "crypto/sha256"
_ "crypto/sha512" _ "crypto/sha512"
"github.com/sirupsen/logrus"
) )
// ReadCloserWrapper wraps an io.Reader, and implements an io.ReadCloser // ReadCloserWrapper wraps an io.Reader, and implements an io.ReadCloser
@ -16,10 +20,15 @@ import (
type ReadCloserWrapper struct { type ReadCloserWrapper struct {
io.Reader io.Reader
closer func() error closer func() error
closed atomic.Bool
} }
// Close calls back the passed closer function // Close calls back the passed closer function
func (r *ReadCloserWrapper) Close() error { func (r *ReadCloserWrapper) Close() error {
if !r.closed.CompareAndSwap(false, true) {
subsequentCloseWarn("ReadCloserWrapper")
return nil
}
return r.closer() return r.closer()
} }
@ -87,6 +96,7 @@ type cancelReadCloser struct {
cancel func() cancel func()
pR *io.PipeReader // Stream to read from pR *io.PipeReader // Stream to read from
pW *io.PipeWriter pW *io.PipeWriter
closed atomic.Bool
} }
// NewCancelReadCloser creates a wrapper that closes the ReadCloser when the // NewCancelReadCloser creates a wrapper that closes the ReadCloser when the
@ -146,6 +156,17 @@ func (p *cancelReadCloser) closeWithError(err error) {
// Close closes the wrapper its underlying reader. It will cause // Close closes the wrapper its underlying reader. It will cause
// future calls to Read to return io.EOF. // future calls to Read to return io.EOF.
func (p *cancelReadCloser) Close() error { func (p *cancelReadCloser) Close() error {
if !p.closed.CompareAndSwap(false, true) {
subsequentCloseWarn("cancelReadCloser")
return nil
}
p.closeWithError(io.EOF) p.closeWithError(io.EOF)
return nil return nil
} }
func subsequentCloseWarn(name string) {
logrus.Error("subsequent attempt to close " + name)
if logrus.GetLevel() >= logrus.DebugLevel {
logrus.Errorf("stack trace: %s", string(debug.Stack()))
}
}

View File

@ -1,6 +1,9 @@
package ioutils // import "github.com/docker/docker/pkg/ioutils" package ioutils // import "github.com/docker/docker/pkg/ioutils"
import "io" import (
"io"
"sync/atomic"
)
// NopWriter represents a type which write operation is nop. // NopWriter represents a type which write operation is nop.
type NopWriter struct{} type NopWriter struct{}
@ -29,9 +32,14 @@ func (f *NopFlusher) Flush() {}
type writeCloserWrapper struct { type writeCloserWrapper struct {
io.Writer io.Writer
closer func() error closer func() error
closed atomic.Bool
} }
func (r *writeCloserWrapper) Close() error { func (r *writeCloserWrapper) Close() error {
if !r.closed.CompareAndSwap(false, true) {
subsequentCloseWarn("WriteCloserWrapper")
return nil
}
return r.closer() return r.closer()
} }

View File

@ -328,8 +328,8 @@ func ValidateMirror(val string) (string, error) {
if uri.Scheme != "http" && uri.Scheme != "https" { if uri.Scheme != "http" && uri.Scheme != "https" {
return "", invalidParamf("invalid mirror: unsupported scheme %q in %q", uri.Scheme, uri) return "", invalidParamf("invalid mirror: unsupported scheme %q in %q", uri.Scheme, uri)
} }
if (uri.Path != "" && uri.Path != "/") || uri.RawQuery != "" || uri.Fragment != "" { if uri.RawQuery != "" || uri.Fragment != "" {
return "", invalidParamf("invalid mirror: path, query, or fragment at end of the URI %q", uri) return "", invalidParamf("invalid mirror: query or fragment at end of the URI %q", uri)
} }
if uri.User != nil { if uri.User != nil {
// strip password from output // strip password from output

View File

@ -201,7 +201,7 @@ func ParseGroupFilter(r io.Reader, filter func(Group) bool) ([]Group, error) {
if err != nil { if err != nil {
// We should return no error if EOF is reached // We should return no error if EOF is reached
// without a match. // without a match.
if err == io.EOF { //nolint:errorlint // comparison with io.EOF is legit, https://github.com/polyfloyd/go-errorlint/pull/12 if err == io.EOF {
err = nil err = nil
} }
return out, err return out, err

4
vendor/modules.txt vendored
View File

@ -40,7 +40,7 @@ github.com/docker/distribution/registry/client/transport
github.com/docker/distribution/registry/storage/cache github.com/docker/distribution/registry/storage/cache
github.com/docker/distribution/registry/storage/cache/memory github.com/docker/distribution/registry/storage/cache/memory
github.com/docker/distribution/uuid github.com/docker/distribution/uuid
# github.com/docker/docker v24.0.7+incompatible # github.com/docker/docker v24.0.8+incompatible
## explicit ## explicit
github.com/docker/docker/api github.com/docker/docker/api
github.com/docker/docker/api/types github.com/docker/docker/api/types
@ -197,7 +197,7 @@ github.com/opencontainers/go-digest
## explicit; go 1.18 ## explicit; go 1.18
github.com/opencontainers/image-spec/specs-go github.com/opencontainers/image-spec/specs-go
github.com/opencontainers/image-spec/specs-go/v1 github.com/opencontainers/image-spec/specs-go/v1
# github.com/opencontainers/runc v1.1.7 # github.com/opencontainers/runc v1.1.11
## explicit; go 1.17 ## explicit; go 1.17
github.com/opencontainers/runc/libcontainer/user github.com/opencontainers/runc/libcontainer/user
# github.com/pkg/errors v0.9.1 # github.com/pkg/errors v0.9.1