diff --git a/go.mod b/go.mod index 6541c95a7..39c19f0b1 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/moby/buildkit v0.28.1 github.com/moby/docker-image-spec v1.3.1 github.com/moby/moby/api v1.54.2 - github.com/moby/moby/client v0.3.0 + github.com/moby/moby/client v0.4.0 github.com/opencontainers/image-spec v1.1.1 github.com/spf13/cobra v1.10.2 github.com/spf13/pflag v1.0.10 @@ -40,13 +40,13 @@ require ( github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/google/go-containerregistry v0.21.2 // indirect + github.com/google/go-containerregistry v0.21.5 // indirect github.com/google/go-intervals v0.0.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.18.4 // indirect + github.com/klauspost/compress v1.18.5 // indirect github.com/klauspost/pgzip v1.2.6 // indirect github.com/mistifyio/go-zfs/v4 v4.0.0 // indirect github.com/moby/sys/capability v0.4.0 // indirect @@ -72,9 +72,9 @@ require ( go.opentelemetry.io/otel/metric v1.42.0 // indirect go.opentelemetry.io/otel/trace v1.42.0 // indirect go.podman.io/storage v1.62.1-0.20260310180906-9819c3739308 // indirect - golang.org/x/mod v0.33.0 // indirect + golang.org/x/mod v0.35.0 // indirect golang.org/x/sync v0.20.0 // indirect - golang.org/x/sys v0.42.0 // indirect + golang.org/x/sys v0.43.0 // indirect google.golang.org/protobuf v1.36.11 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 9e55c8b59..d8872002c 100644 --- a/go.sum +++ b/go.sum @@ -33,8 +33,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/cli v29.3.0+incompatible h1:z3iWveU7h19Pqx7alZES8j+IeFQZ1lhTwb2F+V9SVvk= -github.com/docker/cli v29.3.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v29.4.0+incompatible h1:+IjXULMetlvWJiuSI0Nbor36lcJ5BTcVpUmB21KBoVM= +github.com/docker/cli v29.4.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v28.5.2+incompatible h1:DBX0Y0zAjZbSrm1uzOkdr1onVghKaftjlSWt4AFexzM= @@ -58,8 +58,8 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/go-containerregistry v0.21.2 h1:vYaMU4nU55JJGFC9JR/s8NZcTjbE9DBBbvusTW9NeS0= -github.com/google/go-containerregistry v0.21.2/go.mod h1:ctO5aCaewH4AK1AumSF5DPW+0+R+d2FmylMJdp5G7p0= +github.com/google/go-containerregistry v0.21.5 h1:KTJG9Pn/jC0VdZR6ctV3/jcN+q6/Iqlx0sTVz3ywZlM= +github.com/google/go-containerregistry v0.21.5/go.mod h1:ySvMuiWg+dOsRW0Hw8GYwfMwBlNRTmpYBFJPlkco5zU= github.com/google/go-intervals v0.0.2 h1:FGrVEiUnTRKR8yE04qzXYaJMtnIYqobR5QbblK3ixcM= github.com/google/go-intervals v0.0.2/go.mod h1:MkaR3LNRfeKLPmqgJYs4E66z5InYjmCjbbr4TQlcT6Y= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -74,8 +74,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.18.4 h1:RPhnKRAQ4Fh8zU2FY/6ZFDwTVTxgJ/EMydqSTzE9a2c= -github.com/klauspost/compress v1.18.4/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= +github.com/klauspost/compress v1.18.5 h1:/h1gH5Ce+VWNLSWqPzOVn6XBO+vJbCNGvjoaGBFW2IE= +github.com/klauspost/compress v1.18.5/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -90,8 +90,8 @@ github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3N github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/moby/api v1.54.2 h1:wiat9QAhnDQjA7wk1kh/TqHz2I1uUA7M7t9SAl/JNXg= github.com/moby/moby/api v1.54.2/go.mod h1:+RQ6wluLwtYaTd1WnPLykIDPekkuyD/ROWQClE83pzs= -github.com/moby/moby/client v0.3.0 h1:UUGL5okry+Aomj3WhGt9Aigl3ZOxZGqR7XPo+RLPlKs= -github.com/moby/moby/client v0.3.0/go.mod h1:HJgFbJRvogDQjbM8fqc1MCEm4mIAGMLjXbgwoZp6jCQ= +github.com/moby/moby/client v0.4.0 h1:S+2XegzHQrrvTCvF6s5HFzcrywWQmuVnhOXe2kiWjIw= +github.com/moby/moby/client v0.4.0/go.mod h1:QWPbvWchQbxBNdaLSpoKpCdf5E+WxFAgNHogCWDoa7g= github.com/moby/sys/capability v0.4.0 h1:4D4mI6KlNtWMCM1Z/K0i7RV1FkX+DBDHKVJpCndZoHk= github.com/moby/sys/capability v0.4.0/go.mod h1:4g9IK291rVkms3LKCDOoYlnV8xKwoDTpIrNEE35Wq0I= github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg= @@ -175,8 +175,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8= -golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w= +golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= +golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -192,8 +192,8 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= -golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= +golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/vendor/github.com/klauspost/compress/.goreleaser.yml b/vendor/github.com/klauspost/compress/.goreleaser.yml index 4528059ca..804a20181 100644 --- a/vendor/github.com/klauspost/compress/.goreleaser.yml +++ b/vendor/github.com/klauspost/compress/.goreleaser.yml @@ -31,6 +31,9 @@ builds: - mips64le goarm: - 7 + ignore: + - goos: windows + goarch: arm - id: "s2d" binary: s2d @@ -57,6 +60,9 @@ builds: - mips64le goarm: - 7 + ignore: + - goos: windows + goarch: arm - id: "s2sx" binary: s2sx @@ -84,6 +90,9 @@ builds: - mips64le goarm: - 7 + ignore: + - goos: windows + goarch: arm archives: - @@ -91,7 +100,7 @@ archives: name_template: "s2-{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" format_overrides: - goos: windows - format: zip + formats: ['zip'] files: - unpack/* - s2/LICENSE diff --git a/vendor/github.com/klauspost/compress/README.md b/vendor/github.com/klauspost/compress/README.md index 5125c1f26..e839fe9c6 100644 --- a/vendor/github.com/klauspost/compress/README.md +++ b/vendor/github.com/klauspost/compress/README.md @@ -26,6 +26,12 @@ This package will support the current Go version and 2 versions back. Use the links above for more information on each. # changelog + +* Feb 9th, 2026 [1.18.4](https://github.com/klauspost/compress/releases/tag/v1.18.4) + * gzhttp: Add zstandard to server handler wrapper https://github.com/klauspost/compress/pull/1121 + * zstd: Add ResetWithOptions to encoder/decoder https://github.com/klauspost/compress/pull/1122 + * gzhttp: preserve qvalue when extra parameters follow in Accept-Encoding by @analytically in https://github.com/klauspost/compress/pull/1116 + * Jan 16th, 2026 [1.18.3](https://github.com/klauspost/compress/releases/tag/v1.18.3) * Downstream CVE-2025-61728. See [golang/go#77102](https://github.com/golang/go/issues/77102). @@ -691,3 +697,4 @@ This code is licensed under the same conditions as the original Go code. See LIC + diff --git a/vendor/github.com/klauspost/compress/flate/huffman_code.go b/vendor/github.com/klauspost/compress/flate/huffman_code.go index 5f901bd0f..4b312dea3 100644 --- a/vendor/github.com/klauspost/compress/flate/huffman_code.go +++ b/vendor/github.com/klauspost/compress/flate/huffman_code.go @@ -407,8 +407,8 @@ func histogramSplit(b []byte, h []uint16) { for i, t := range x { v0 := &h[t] v1 := &h[y[i]] - v3 := &h[w[i]] v2 := &h[z[i]] + v3 := &h[w[i]] *v0++ *v1++ *v2++ diff --git a/vendor/github.com/klauspost/compress/flate/regmask_other.go b/vendor/github.com/klauspost/compress/flate/regmask_other.go index 1b7a2cbd7..e62caf711 100644 --- a/vendor/github.com/klauspost/compress/flate/regmask_other.go +++ b/vendor/github.com/klauspost/compress/flate/regmask_other.go @@ -1,5 +1,4 @@ //go:build !amd64 -// +build !amd64 package flate diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go index 99ddd4af9..2d6ef64be 100644 --- a/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go +++ b/vendor/github.com/klauspost/compress/huff0/decompress_amd64.go @@ -1,5 +1,4 @@ //go:build amd64 && !appengine && !noasm && gc -// +build amd64,!appengine,!noasm,gc // This file contains the specialisation of Decoder.Decompress4X // and Decoder.Decompress1X that use an asm implementation of thir main loops. diff --git a/vendor/github.com/klauspost/compress/huff0/decompress_generic.go b/vendor/github.com/klauspost/compress/huff0/decompress_generic.go index 908c17de6..610392322 100644 --- a/vendor/github.com/klauspost/compress/huff0/decompress_generic.go +++ b/vendor/github.com/klauspost/compress/huff0/decompress_generic.go @@ -1,5 +1,4 @@ //go:build !amd64 || appengine || !gc || noasm -// +build !amd64 appengine !gc noasm // This file contains a generic implementation of Decoder.Decompress4X. package huff0 diff --git a/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go index e802579c4..b97f9056f 100644 --- a/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go +++ b/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go @@ -1,5 +1,4 @@ //go:build amd64 && !appengine && !noasm && gc -// +build amd64,!appengine,!noasm,gc package cpuinfo diff --git a/vendor/github.com/klauspost/compress/zstd/blockenc.go b/vendor/github.com/klauspost/compress/zstd/blockenc.go index fd35ea148..0e33aea44 100644 --- a/vendor/github.com/klauspost/compress/zstd/blockenc.go +++ b/vendor/github.com/klauspost/compress/zstd/blockenc.go @@ -78,6 +78,7 @@ func (b *blockEnc) initNewEncode() { b.recentOffsets = [3]uint32{1, 4, 8} b.litEnc.Reuse = huff0.ReusePolicyNone b.coders.setPrev(nil, nil, nil) + b.dictLitEnc = nil } // reset will reset the block for a new encode, but in the same stream, diff --git a/vendor/github.com/klauspost/compress/zstd/enc_base.go b/vendor/github.com/klauspost/compress/zstd/enc_base.go index c1192ec38..c4de134a7 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_base.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_base.go @@ -21,7 +21,7 @@ type fastBase struct { crc *xxhash.Digest tmp [8]byte blk *blockEnc - lastDictID uint32 + lastDict *dict lowMem bool } diff --git a/vendor/github.com/klauspost/compress/zstd/enc_best.go b/vendor/github.com/klauspost/compress/zstd/enc_best.go index c1581cfcb..851799322 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_best.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_best.go @@ -479,10 +479,13 @@ func (e *bestFastEncoder) Reset(d *dict, singleBlock bool) { if d == nil { return } + dictChanged := d != e.lastDict // Init or copy dict table - if len(e.dictTable) != len(e.table) || d.id != e.lastDictID { + if len(e.dictTable) != len(e.table) || dictChanged { if len(e.dictTable) != len(e.table) { e.dictTable = make([]prevEntry, len(e.table)) + } else { + clear(e.dictTable) } end := int32(len(d.content)) - 8 + e.maxMatchOff for i := e.maxMatchOff; i < end; i += 4 { @@ -510,13 +513,14 @@ func (e *bestFastEncoder) Reset(d *dict, singleBlock bool) { offset: i + 3, } } - e.lastDictID = d.id } - // Init or copy dict table - if len(e.dictLongTable) != len(e.longTable) || d.id != e.lastDictID { + // Init or copy dict long table + if len(e.dictLongTable) != len(e.longTable) || dictChanged { if len(e.dictLongTable) != len(e.longTable) { e.dictLongTable = make([]prevEntry, len(e.longTable)) + } else { + clear(e.dictLongTable) } if len(d.content) >= 8 { cv := load6432(d.content, 0) @@ -538,8 +542,8 @@ func (e *bestFastEncoder) Reset(d *dict, singleBlock bool) { off++ } } - e.lastDictID = d.id } + e.lastDict = d // Reset table to initial state copy(e.longTable[:], e.dictLongTable) diff --git a/vendor/github.com/klauspost/compress/zstd/enc_better.go b/vendor/github.com/klauspost/compress/zstd/enc_better.go index 85dcd28c3..3305f0924 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_better.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_better.go @@ -1102,10 +1102,13 @@ func (e *betterFastEncoderDict) Reset(d *dict, singleBlock bool) { if d == nil { return } + dictChanged := d != e.lastDict // Init or copy dict table - if len(e.dictTable) != len(e.table) || d.id != e.lastDictID { + if len(e.dictTable) != len(e.table) || dictChanged { if len(e.dictTable) != len(e.table) { e.dictTable = make([]tableEntry, len(e.table)) + } else { + clear(e.dictTable) } end := int32(len(d.content)) - 8 + e.maxMatchOff for i := e.maxMatchOff; i < end; i += 4 { @@ -1133,14 +1136,15 @@ func (e *betterFastEncoderDict) Reset(d *dict, singleBlock bool) { offset: i + 3, } } - e.lastDictID = d.id e.allDirty = true } - // Init or copy dict table - if len(e.dictLongTable) != len(e.longTable) || d.id != e.lastDictID { + // Init or copy dict long table + if len(e.dictLongTable) != len(e.longTable) || dictChanged { if len(e.dictLongTable) != len(e.longTable) { e.dictLongTable = make([]prevEntry, len(e.longTable)) + } else { + clear(e.dictLongTable) } if len(d.content) >= 8 { cv := load6432(d.content, 0) @@ -1162,9 +1166,9 @@ func (e *betterFastEncoderDict) Reset(d *dict, singleBlock bool) { off++ } } - e.lastDictID = d.id e.allDirty = true } + e.lastDict = d // Reset table to initial state { diff --git a/vendor/github.com/klauspost/compress/zstd/enc_dfast.go b/vendor/github.com/klauspost/compress/zstd/enc_dfast.go index cf8cad00d..2fb6da112 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_dfast.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_dfast.go @@ -1040,15 +1040,18 @@ func (e *doubleFastEncoder) Reset(d *dict, singleBlock bool) { // ResetDict will reset and set a dictionary if not nil func (e *doubleFastEncoderDict) Reset(d *dict, singleBlock bool) { allDirty := e.allDirty + dictChanged := d != e.lastDict e.fastEncoderDict.Reset(d, singleBlock) if d == nil { return } // Init or copy dict table - if len(e.dictLongTable) != len(e.longTable) || d.id != e.lastDictID { + if len(e.dictLongTable) != len(e.longTable) || dictChanged { if len(e.dictLongTable) != len(e.longTable) { e.dictLongTable = make([]tableEntry, len(e.longTable)) + } else { + clear(e.dictLongTable) } if len(d.content) >= 8 { cv := load6432(d.content, 0) @@ -1065,7 +1068,6 @@ func (e *doubleFastEncoderDict) Reset(d *dict, singleBlock bool) { } } } - e.lastDictID = d.id allDirty = true } // Reset table to initial state diff --git a/vendor/github.com/klauspost/compress/zstd/enc_fast.go b/vendor/github.com/klauspost/compress/zstd/enc_fast.go index 9180a3a58..5e104f1a4 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_fast.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_fast.go @@ -805,9 +805,11 @@ func (e *fastEncoderDict) Reset(d *dict, singleBlock bool) { } // Init or copy dict table - if len(e.dictTable) != len(e.table) || d.id != e.lastDictID { + if len(e.dictTable) != len(e.table) || d != e.lastDict { if len(e.dictTable) != len(e.table) { e.dictTable = make([]tableEntry, len(e.table)) + } else { + clear(e.dictTable) } if true { end := e.maxMatchOff + int32(len(d.content)) - 8 @@ -827,7 +829,7 @@ func (e *fastEncoderDict) Reset(d *dict, singleBlock bool) { } } } - e.lastDictID = d.id + e.lastDict = d e.allDirty = true } diff --git a/vendor/github.com/klauspost/compress/zstd/encoder.go b/vendor/github.com/klauspost/compress/zstd/encoder.go index 19e730acc..0f2a00a00 100644 --- a/vendor/github.com/klauspost/compress/zstd/encoder.go +++ b/vendor/github.com/klauspost/compress/zstd/encoder.go @@ -138,11 +138,18 @@ func (e *Encoder) Reset(w io.Writer) { func (e *Encoder) ResetWithOptions(w io.Writer, opts ...EOption) error { e.o.resetOpt = true defer func() { e.o.resetOpt = false }() + hadDict := e.o.dict != nil for _, o := range opts { if err := o(&e.o); err != nil { return err } } + hasDict := e.o.dict != nil + if hadDict != hasDict { + // Dict presence changed — encoder type must be recreated. + e.state.encoder = nil + e.init = sync.Once{} + } e.Reset(w) return nil } @@ -448,6 +455,12 @@ func (e *Encoder) Close() error { if s.encoder == nil { return nil } + if s.w == nil { + if len(s.filling) == 0 && !s.headerWritten && !s.eofWritten && s.nInput == 0 { + return nil + } + return errors.New("zstd: encoder has no writer") + } err := e.nextBlock(true) if err != nil { if errors.Is(s.err, ErrEncoderClosed) { diff --git a/vendor/github.com/klauspost/compress/zstd/encoder_options.go b/vendor/github.com/klauspost/compress/zstd/encoder_options.go index 8e0f5cac7..e217be0a1 100644 --- a/vendor/github.com/klauspost/compress/zstd/encoder_options.go +++ b/vendor/github.com/klauspost/compress/zstd/encoder_options.go @@ -42,6 +42,7 @@ func (o *encoderOptions) setDefault() { level: SpeedDefault, allLitEntropy: false, lowMem: false, + fullZero: true, } } diff --git a/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.go b/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.go index d04a829b0..b8c8607b5 100644 --- a/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.go +++ b/vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.go @@ -1,5 +1,4 @@ //go:build amd64 && !appengine && !noasm && gc -// +build amd64,!appengine,!noasm,gc package zstd diff --git a/vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go b/vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go index 8adfebb02..2138f8091 100644 --- a/vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go +++ b/vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go @@ -1,5 +1,4 @@ //go:build !amd64 || appengine || !gc || noasm -// +build !amd64 appengine !gc noasm package zstd diff --git a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go index 0be16cefc..9576426e6 100644 --- a/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go +++ b/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go @@ -1,5 +1,4 @@ //go:build (!amd64 && !arm64) || appengine || !gc || purego || noasm -// +build !amd64,!arm64 appengine !gc purego noasm package xxhash diff --git a/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go index f41932b7a..1ed18927f 100644 --- a/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go +++ b/vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go @@ -1,5 +1,4 @@ //go:build amd64 && !appengine && !noasm && gc -// +build amd64,!appengine,!noasm,gc // Copyright 2019+ Klaus Post. All rights reserved. // License information can be found in the LICENSE file. diff --git a/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go b/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go index bea1779e9..379746c96 100644 --- a/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go +++ b/vendor/github.com/klauspost/compress/zstd/matchlen_generic.go @@ -1,5 +1,4 @@ //go:build !amd64 || appengine || !gc || noasm -// +build !amd64 appengine !gc noasm // Copyright 2019+ Klaus Post. All rights reserved. // License information can be found in the LICENSE file. diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go index 1f8c3cec2..18c3703dd 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go @@ -1,5 +1,4 @@ //go:build amd64 && !appengine && !noasm && gc -// +build amd64,!appengine,!noasm,gc package zstd diff --git a/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go b/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go index 7cec2197c..516cd9b07 100644 --- a/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go +++ b/vendor/github.com/klauspost/compress/zstd/seqdec_generic.go @@ -1,5 +1,4 @@ //go:build !amd64 || appengine || !gc || noasm -// +build !amd64 appengine !gc noasm package zstd diff --git a/vendor/github.com/moby/moby/client/README.md b/vendor/github.com/moby/moby/client/README.md index 115e604db..aed3e641d 100644 --- a/vendor/github.com/moby/moby/client/README.md +++ b/vendor/github.com/moby/moby/client/README.md @@ -23,11 +23,16 @@ import ( ) func main() { - // Create a new client that handles common environment variables - // for configuration (DOCKER_HOST, DOCKER_API_VERSION), and does - // API-version negotiation to allow downgrading the API version - // when connecting with an older daemon version. - apiClient, err := client.New(client.FromEnv) + // Create a new client with "client.FromEnv" (configuring the client + // from commonly used environment variables such as DOCKER_HOST and + // DOCKER_API_VERSION) and set a custom User-Agent. + // + // API-version negotiation is enabled by default to allow downgrading + // the API version when connecting with an older daemon version. + apiClient, err := client.New( + client.FromEnv, + client.WithUserAgent("my-application/1.0.0"), + ) if err != nil { panic(err) } @@ -49,4 +54,4 @@ func main() { } ``` -[Full documentation is available on pkg.go.dev.](https://pkg.go.dev/github.com/moby/moby/client) +Full documentation is available on [pkg.go.dev](https://pkg.go.dev/github.com/moby/moby/client). diff --git a/vendor/github.com/moby/moby/client/build_cancel.go b/vendor/github.com/moby/moby/client/build_cancel.go index f6cfc6bc9..a31dced97 100644 --- a/vendor/github.com/moby/moby/client/build_cancel.go +++ b/vendor/github.com/moby/moby/client/build_cancel.go @@ -5,8 +5,10 @@ import ( "net/url" ) +// BuildCancelOptions holds options for [Client.BuildCancel]. type BuildCancelOptions struct{} +// BuildCancelResult holds the result of [Client.BuildCancel]. type BuildCancelResult struct{} // BuildCancel requests the daemon to cancel the ongoing build request diff --git a/vendor/github.com/moby/moby/client/client.go b/vendor/github.com/moby/moby/client/client.go index 2d1e0db79..89ba88ee5 100644 --- a/vendor/github.com/moby/moby/client/client.go +++ b/vendor/github.com/moby/moby/client/client.go @@ -59,6 +59,7 @@ import ( "net/http" "net/url" "path" + "runtime" "slices" "strings" "sync" @@ -67,6 +68,7 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/docker/go-connections/sockets" + "github.com/moby/moby/client/internal/mod" "github.com/moby/moby/client/pkg/versions" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" ) @@ -113,6 +115,10 @@ const MaxAPIVersion = "1.54" // below this version are not considered when performing API-version negotiation. const MinAPIVersion = "1.40" +// defaultUserAgent returns the default User-Agent to use if none is set. +// It defaults to "moby-client/ os/arch" +var defaultUserAgent = sync.OnceValue(userAgent) + // Ensure that Client always implements APIClient. var _ APIClient = &Client{} @@ -159,7 +165,9 @@ func CheckRedirect(_ *http.Request, via []*http.Request) error { // NewClientWithOpts initializes a new API client. // -// Deprecated: use New. This function will be removed in the next release. +// Deprecated: use [New]. This function will be removed in the next release. +// +//go:fix inline func NewClientWithOpts(ops ...Opt) (*Client, error) { return New(ops...) } @@ -207,6 +215,9 @@ func New(ops ...Opt) (*Client, error) { cfg := &c.clientConfig for _, op := range ops { + if op == nil { + continue + } if err := op(cfg); err != nil { return nil, err } @@ -431,3 +442,14 @@ func (cli *Client) dialer() func(context.Context) (net.Conn, error) { } } } + +func userAgent() string { + const defaultVersion = "v0.0.0+unknown" + const moduleName = "github.com/moby/moby/client" + + version := defaultVersion + if v := mod.Version(moduleName); v != "" { + version = v + } + return "moby-client/" + version + " " + runtime.GOOS + "/" + runtime.GOARCH +} diff --git a/vendor/github.com/moby/moby/client/client_options.go b/vendor/github.com/moby/moby/client/client_options.go index d92a16a45..399255723 100644 --- a/vendor/github.com/moby/moby/client/client_options.go +++ b/vendor/github.com/moby/moby/client/client_options.go @@ -2,6 +2,7 @@ package client import ( "context" + "crypto/tls" "errors" "fmt" "net" @@ -11,6 +12,7 @@ import ( "strings" "time" + cerrdefs "github.com/containerd/errdefs" "github.com/docker/go-connections/sockets" "github.com/docker/go-connections/tlsconfig" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" @@ -193,11 +195,23 @@ func WithUserAgent(ua string) Opt { } // WithHTTPHeaders appends custom HTTP headers to the client's default headers. -// It does not allow for built-in headers (such as "User-Agent", if set) to -// be overridden. Also see [WithUserAgent]. +// It does not allow overriding built-in headers (such as "User-Agent"). +// Also see [WithUserAgent]. +// +// It replaces any existing custom headers. Keys are case-insensitive and +// canonicalized using [http.CanonicalHeaderKey]. If multiple entries map +// to the same canonical key, a [cerrdefs.ErrInvalidArgument] is returned. func WithHTTPHeaders(headers map[string]string) Opt { return func(c *clientConfig) error { - c.customHTTPHeaders = headers + c.customHTTPHeaders = make(map[string]string) + for k, v := range headers { + k = http.CanonicalHeaderKey(k) + _, ok := c.customHTTPHeaders[k] + if ok { + return cerrdefs.ErrInvalidArgument.WithMessage(fmt.Sprintf("duplicate custom HTTP header (%s)", k)) + } + c.customHTTPHeaders[k] = v + } return nil } } @@ -210,56 +224,84 @@ func WithScheme(scheme string) Opt { } } -// WithTLSClientConfig applies a TLS config to the client transport. -func WithTLSClientConfig(cacertPath, certPath, keyPath string) Opt { +// WithTLSClientConfig configures the client's existing HTTP transport to use TLS. +// The minimum TLS version is TLS 1.2. +// +// If caFile is non-empty, it specifies the CA certificate file to use for +// server verification, and replaces the system root pool for that verification. +// If certFile is empty, the system root pool is used. +// +// If either certFile or keyFile is set, both must point to readable files +// containing a valid client certificate and unencrypted private key, or this +// option returns an error. +// +// If both certPath and keyPath are empty, no client certificate is configured. +// The connection will use TLS without client authentication (i.e., not mTLS). +func WithTLSClientConfig(caFile, certFile, keyFile string) Opt { return func(c *clientConfig) error { transport, ok := c.client.Transport.(*http.Transport) if !ok { - return fmt.Errorf("cannot apply tls config to transport: %T", c.client.Transport) + return fmt.Errorf("cannot configure TLS: unsupported HTTP transport %T", c.client.Transport) } config, err := tlsconfig.Client(tlsconfig.Options{ - CAFile: cacertPath, - CertFile: certPath, - KeyFile: keyPath, + CAFile: caFile, + CertFile: certFile, + KeyFile: keyFile, ExclusiveRootPools: true, + MinVersion: tls.VersionTLS12, }) if err != nil { - return fmt.Errorf("failed to create tls config: %w", err) + return fmt.Errorf("configure TLS: %w", err) } transport.TLSClientConfig = config return nil } } -// WithTLSClientConfigFromEnv configures the client's TLS settings with the -// settings in the DOCKER_CERT_PATH ([EnvOverrideCertPath]) and DOCKER_TLS_VERIFY -// ([EnvTLSVerify]) environment variables. If DOCKER_CERT_PATH is not set or empty, -// TLS configuration is not modified. +// WithTLSClientConfigFromEnv configures the client for TLS using the +// DOCKER_CERT_PATH ([EnvOverrideCertPath]) and DOCKER_TLS_VERIFY +// ([EnvTLSVerify]) environment variables. The minimum TLS version is TLS 1.2. // -// WithTLSClientConfigFromEnv uses the following environment variables: +// If DOCKER_CERT_PATH is unset or empty, this option leaves the client +// unchanged. // -// - DOCKER_CERT_PATH ([EnvOverrideCertPath]) to specify the directory from -// which to load the TLS certificates ("ca.pem", "cert.pem", "key.pem"). -// - DOCKER_TLS_VERIFY ([EnvTLSVerify]) to enable or disable TLS verification -// (off by default). +// When DOCKER_CERT_PATH is set, the following files are loaded from that +// directory: +// +// - "ca.pem" as the CA certificate +// - "cert.pem" as the client certificate +// - "key.pem" as the client private key +// +// These files must exist, be readable, and contain valid TLS material, or this +// option returns an error. A client certificate is always loaded from "cert.pem" +// and "key.pem" (mTLS is expected). +// +// If DOCKER_TLS_VERIFY is set to a non-empty value, server certificate +// verification is enabled. In that case, "ca.pem" is added to the system root +// pool used for verification. +// +// If DOCKER_TLS_VERIFY is unset or empty, server certificate verification is +// disabled. func WithTLSClientConfigFromEnv() Opt { return func(c *clientConfig) error { dockerCertPath := os.Getenv(EnvOverrideCertPath) if dockerCertPath == "" { return nil } - tlsc, err := tlsconfig.Client(tlsconfig.Options{ + tlsConfig, err := tlsconfig.Client(tlsconfig.Options{ CAFile: filepath.Join(dockerCertPath, "ca.pem"), CertFile: filepath.Join(dockerCertPath, "cert.pem"), KeyFile: filepath.Join(dockerCertPath, "key.pem"), InsecureSkipVerify: os.Getenv(EnvTLSVerify) == "", + MinVersion: tls.VersionTLS12, }) if err != nil { - return err + return fmt.Errorf("configure TLS from %q: %w", EnvOverrideCertPath+"="+dockerCertPath, err) } + // FIXME(thaJeztah): unlike WithTLSClientConfig, this option replaces the client's http.Client and transport; consider updating just the transport. c.client = &http.Client{ - Transport: &http.Transport{TLSClientConfig: tlsc}, + Transport: &http.Transport{TLSClientConfig: tlsConfig}, CheckRedirect: CheckRedirect, } return nil @@ -295,6 +337,8 @@ func WithAPIVersion(version string) Opt { // WithVersion overrides the client version with the specified one. // // Deprecated: use [WithAPIVersion] instead. +// +//go:fix inline func WithVersion(version string) Opt { return WithAPIVersion(version) } @@ -328,6 +372,8 @@ func WithAPIVersionFromEnv() Opt { // the DOCKER_API_VERSION ([EnvOverrideAPIVersion]) environment variable. // // Deprecated: use [WithAPIVersionFromEnv] instead. +// +//go:fix inline func WithVersionFromEnv() Opt { return WithAPIVersionFromEnv() } @@ -337,8 +383,11 @@ func WithVersionFromEnv() Opt { // to use when making requests. API version negotiation is performed on the first // request; subsequent requests do not re-negotiate. // -// Deprecated: API-version negotiation is now enabled by default. Use [WithAPIVersion] -// or [WithAPIVersionFromEnv] to disable API version negotiation. +// Deprecated: API-version negotiation is now enabled by default and this options +// is now a no-op. +// +// Use [WithAPIVersion] or [WithAPIVersionFromEnv] to set a fixed API version +// instead of using automatic negotiation. func WithAPIVersionNegotiation() Opt { return func(c *clientConfig) error { return nil @@ -348,7 +397,10 @@ func WithAPIVersionNegotiation() Opt { // WithTraceProvider sets the trace provider for the client. // If this is not set then the global trace provider is used. func WithTraceProvider(provider trace.TracerProvider) Opt { - return WithTraceOptions(otelhttp.WithTracerProvider(provider)) + return func(c *clientConfig) error { + c.traceOpts = append(c.traceOpts, otelhttp.WithTracerProvider(provider)) + return nil + } } // WithTraceOptions sets tracing span options for the client. diff --git a/vendor/github.com/moby/moby/client/config_remove.go b/vendor/github.com/moby/moby/client/config_remove.go index c77a4c378..5cde5e143 100644 --- a/vendor/github.com/moby/moby/client/config_remove.go +++ b/vendor/github.com/moby/moby/client/config_remove.go @@ -2,10 +2,12 @@ package client import "context" +// ConfigRemoveOptions holds options for [Client.ConfigRemove]. type ConfigRemoveOptions struct { // Add future optional parameters here } +// ConfigRemoveResult holds the result of [Client.ConfigRemove]. type ConfigRemoveResult struct { // Add future fields here } diff --git a/vendor/github.com/moby/moby/client/config_update.go b/vendor/github.com/moby/moby/client/config_update.go index 2651f4b2f..31bdd7956 100644 --- a/vendor/github.com/moby/moby/client/config_update.go +++ b/vendor/github.com/moby/moby/client/config_update.go @@ -13,6 +13,7 @@ type ConfigUpdateOptions struct { Spec swarm.ConfigSpec } +// ConfigUpdateResult holds the result of [Client.ConfigUpdate]. type ConfigUpdateResult struct{} // ConfigUpdate attempts to update a config diff --git a/vendor/github.com/moby/moby/client/container_copy.go b/vendor/github.com/moby/moby/client/container_copy.go index f76511246..b37d1765f 100644 --- a/vendor/github.com/moby/moby/client/container_copy.go +++ b/vendor/github.com/moby/moby/client/container_copy.go @@ -14,10 +14,12 @@ import ( "github.com/moby/moby/api/types/container" ) +// ContainerStatPathOptions holds options for [Client.ContainerStatPath]. type ContainerStatPathOptions struct { Path string } +// ContainerStatPathResult holds the result of [Client.ContainerStatPath]. type ContainerStatPathResult struct { Stat container.PathStat } @@ -53,6 +55,7 @@ type CopyToContainerOptions struct { CopyUIDGID bool } +// CopyToContainerResult holds the result of [Client.CopyToContainer]. type CopyToContainerResult struct{} // CopyToContainer copies content into the container filesystem. @@ -83,10 +86,12 @@ func (cli *Client) CopyToContainer(ctx context.Context, containerID string, opti return CopyToContainerResult{}, nil } +// CopyFromContainerOptions holds options for [Client.CopyFromContainer]. type CopyFromContainerOptions struct { SourcePath string } +// CopyFromContainerResult holds the result of [Client.CopyFromContainer]. type CopyFromContainerResult struct { Content io.ReadCloser Stat container.PathStat diff --git a/vendor/github.com/moby/moby/client/filters.go b/vendor/github.com/moby/moby/client/filters.go index 347ad5c68..3669ae0d4 100644 --- a/vendor/github.com/moby/moby/client/filters.go +++ b/vendor/github.com/moby/moby/client/filters.go @@ -2,6 +2,7 @@ package client import ( "encoding/json" + "maps" "net/url" ) @@ -35,9 +36,7 @@ func (f Filters) Clone() Filters { out := make(Filters, len(f)) for term, values := range f { inner := make(map[string]bool, len(values)) - for v, ok := range values { - inner[v] = ok - } + maps.Copy(inner, values) out[term] = inner } return out diff --git a/vendor/github.com/moby/moby/client/image_build.go b/vendor/github.com/moby/moby/client/image_build.go index 5062ec5de..67ac204aa 100644 --- a/vendor/github.com/moby/moby/client/image_build.go +++ b/vendor/github.com/moby/moby/client/image_build.go @@ -23,7 +23,7 @@ func (cli *Client) ImageBuild(ctx context.Context, buildContext io.Reader, optio return ImageBuildResult{}, err } - buf, err := json.Marshal(options.AuthConfigs) + buf, err := json.Marshal(options.AuthConfigs) // #nosec G117 -- ignore "Marshaled struct field "Password" (JSON key "password") matches secret pattern" if err != nil { return ImageBuildResult{}, err } diff --git a/vendor/github.com/moby/moby/client/image_import.go b/vendor/github.com/moby/moby/client/image_import.go index f383f76d4..6c9f22866 100644 --- a/vendor/github.com/moby/moby/client/image_import.go +++ b/vendor/github.com/moby/moby/client/image_import.go @@ -39,7 +39,7 @@ func (cli *Client) ImageImport(ctx context.Context, source ImageImportSource, re query.Set("message", options.Message) } if p := formatPlatform(options.Platform); p != "unknown" { - // TODO(thaJeztah): would we ever support mutiple platforms here? (would require multiple rootfs tars as well?) + // TODO(thaJeztah): would we ever support multiple platforms here? (would require multiple rootfs tars as well?) query.Set("platform", p) } for _, change := range options.Changes { diff --git a/vendor/github.com/moby/moby/client/image_tag.go b/vendor/github.com/moby/moby/client/image_tag.go index 5566f4624..37272914f 100644 --- a/vendor/github.com/moby/moby/client/image_tag.go +++ b/vendor/github.com/moby/moby/client/image_tag.go @@ -9,11 +9,13 @@ import ( "github.com/distribution/reference" ) +// ImageTagOptions holds options for [Client.ImageTag]. type ImageTagOptions struct { Source string Target string } +// ImageTagResult holds the result of [Client.ImageTag]. type ImageTagResult struct{} // ImageTag tags an image in the docker host diff --git a/vendor/github.com/moby/moby/client/internal/mod/mod.go b/vendor/github.com/moby/moby/client/internal/mod/mod.go new file mode 100644 index 000000000..355eb9532 --- /dev/null +++ b/vendor/github.com/moby/moby/client/internal/mod/mod.go @@ -0,0 +1,226 @@ +// Package mod provides a small helper to extract a module's version +// from [debug.BuildInfo] without depending on [golang.org/x/mod]. +// +// [golang.org/x/mod]: https://pkg.go.dev/golang.org/x/mod +package mod + +import ( + "fmt" + "runtime/debug" + "strconv" + "strings" + "sync" +) + +var readBuildInfo = sync.OnceValues(debug.ReadBuildInfo) + +// Version returns a best-effort version string for the given module path, +// similar to [mod.Version] in the daemon. +// +// If the module is present in [debug.BuildInfo] dependencies, its version +// is returned. Tagged versions are returned as-is (with "+incompatible" +// stripped). [Pseudo-versions] are normalized to: +// +// +[+meta...][+dirty] +// +// Where "" matches the behavior of [module.PseudoVersionBase] (i.e., +// downgrade to the previous tag for non-prerelease Pseudo-versions). +// +// If the module is replaced (for example via go.work or replace directives), +// or no usable version information is available, Version returns an empty string. +// +// The returned value is intended for display purposes (e.g., in a default +// User-Agent), not for version comparison. +// +// [mod.Version]: https://pkg.go.dev/github.com/moby/moby/v2@v2.0.0-beta.7/daemon/internal/builder-next/worker/mod#Version +// [module.PseudoVersionBase]: https://pkg.go.dev/golang.org/x/mod@v0.34.0/module#PseudoVersionBase +// [Pseudo-versions]: https://cs.opensource.google/go/x/mod/+/refs/tags/v0.34.0:module/pseudo.go;l=5-33 +func Version(name string) string { + bi, ok := readBuildInfo() + if !ok || bi == nil { + return "" + } + return moduleVersion(name, bi) +} + +func moduleVersion(name string, bi *debug.BuildInfo) (modVersion string) { + if bi == nil { + return "" + } + + // Check if we're the main module. + if v, ok := getVersion(name, &bi.Main); ok { + return v + } + + // iterate over all dependencies and find name + for _, dep := range bi.Deps { + if v, ok := getVersion(name, dep); ok { + return v + } + } + + return "" +} + +func getVersion(name string, dep *debug.Module) (string, bool) { + if dep == nil || dep.Path != name { + return "", false + } + + v := dep.Version + if dep.Replace != nil && dep.Replace.Version != "" { + v = dep.Replace.Version + } + if v == "" || v == "(devel)" { + return "", true + } + + return normalize(v), true +} + +// normalize converts a Go module version into a display-friendly form: +// +// - strips "+incompatible" unconditionally +// - if pseudo: vX.Y.Z[-pre][+rev][+meta...][+dirty] +// - if tagged: vX.Y.Z[-pre][+meta...][+dirty] +func normalize(v string) string { + base, metas, dirty := splitMetadata(v) + + out := base + if base2, rev, undoPatch, ok := splitPseudo(base); ok { + if undoPatch { + // Downgrade the patch version that was raised by pseudo-versions: + // + // (2) vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdef123456 + if major, minor, patch, ok := parseSemVer(base2); ok && patch > 0 { + patch-- + base2 = fmt.Sprintf("v%d.%d.%d", major, minor, patch) + } + } + // Go pseudo rev is typically 12, but be defensive. + if len(rev) > 12 { + rev = rev[:12] + } + out = base2 + "+" + rev + } + + // Preserve other metadata (except for "+incompatible"). + for _, m := range metas { + out += m + } + if dirty { + // +dirty goes last + out += "+dirty" + } + return out +} + +func splitMetadata(v string) (base string, metas []string, dirty bool) { + base, meta, ok := strings.Cut(v, "+") + if !ok || meta == "" { + return base, nil, false + } + for m := range strings.SplitSeq(meta, "+") { + // drop incompatible, extract dirty, preserve everything else. + switch m { + case "incompatible", "": + // drop "+incompatible" and empty strings + case "dirty": + dirty = true + default: + metas = append(metas, "+"+m) + } + } + + return base, metas, dirty +} + +// splitPseudo splits a pseudo-version into base + revision, and reports whether +// it is a (Z+1) pseudo that needs patch undo. +// +// Supported (after stripping +incompatible/+dirty metadata): +// +// (1) vX.0.0-yyyymmddhhmmss-abcdef123456 +// (2) vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdef123456 +// (4) vX.Y.Z-pre.0.yyyymmddhhmmss-abcdef123456 +func splitPseudo(v string) (base, rev string, undoPatch bool, ok bool) { + // Split off revision at the last '-'. + last := strings.LastIndexByte(v, '-') + if last < 0 || last+1 >= len(v) { + return "", "", false, false + } + rev = v[last+1:] + left := v[:last] + + // First try the dot-joined timestamp forms: + // ...-0. (release pseudo; undoPatch) + // ....0. (prerelease pseudo; preserve prerelease) + if dot := strings.LastIndexByte(left, '.'); dot > 0 && dot+1 < len(left) { + ts := left[dot+1:] + if isTimestamp(ts) { + prefix := left[:dot] // ends with "-0" or ".0" for forms (2)/(4) + switch { + case strings.HasSuffix(prefix, "-0"): + // (2) vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdef123456 + return prefix[:len(prefix)-2], rev, true, true + case strings.HasSuffix(prefix, ".0"): + // (4) vX.Y.Z-pre.0.yyyymmddhhmmss-abcdef123456 + return prefix[:len(prefix)-2], rev, false, true + } + } + } + + // Fall back to form (1): ...-- + // + // (1) vX.0.0-yyyymmddhhmmss-abcdef123456 + if dash := strings.LastIndexByte(left, '-'); dash > 0 && dash+1 < len(left) { + ts := left[dash+1:] + if isTimestamp(ts) { + return left[:dash], rev, false, true + } + } + + return "", "", false, false +} + +// isTimestamp checks whether s is a timestamp ("yyyymmddhhmmss") +// component in a module version (vX.0.0-yyyymmddhhmmss-abcdef123456). +func isTimestamp(s string) bool { + if len(s) != 14 { + return false + } + for i := range len(s) { + c := s[i] + if c < '0' || c > '9' { + return false + } + } + return true +} + +// parseSemVer parses "vX.Y.Z" into numeric components. +// It intentionally handles only the strict three-segment core form. +func parseSemVer(v string) (major, minor, patch int, ok bool) { + if len(v) < 2 || v[0] != 'v' { + return 0, 0, 0, false + } + parts := strings.Split(v[1:], ".") + if len(parts) != 3 { + return 0, 0, 0, false + } + var err error + major, err = strconv.Atoi(parts[0]) + if err != nil { + return 0, 0, 0, false + } + minor, err = strconv.Atoi(parts[1]) + if err != nil { + return 0, 0, 0, false + } + patch, err = strconv.Atoi(parts[2]) + if err != nil { + return 0, 0, 0, false + } + return major, minor, patch, true +} diff --git a/vendor/github.com/moby/moby/client/node_inspect.go b/vendor/github.com/moby/moby/client/node_inspect.go index cd4ce0119..ed482152c 100644 --- a/vendor/github.com/moby/moby/client/node_inspect.go +++ b/vendor/github.com/moby/moby/client/node_inspect.go @@ -12,6 +12,7 @@ import ( // NodeInspectOptions holds parameters to inspect nodes with. type NodeInspectOptions struct{} +// NodeInspectResult holds the result of [Client.NodeInspect]. type NodeInspectResult struct { Node swarm.Node Raw json.RawMessage diff --git a/vendor/github.com/moby/moby/client/node_list.go b/vendor/github.com/moby/moby/client/node_list.go index 1a1b57922..aec3355e4 100644 --- a/vendor/github.com/moby/moby/client/node_list.go +++ b/vendor/github.com/moby/moby/client/node_list.go @@ -13,6 +13,7 @@ type NodeListOptions struct { Filters Filters } +// NodeListResult holds the result of [Client.NodeList]. type NodeListResult struct { Items []swarm.Node } diff --git a/vendor/github.com/moby/moby/client/node_remove.go b/vendor/github.com/moby/moby/client/node_remove.go index 56c39d67a..2a88cf80e 100644 --- a/vendor/github.com/moby/moby/client/node_remove.go +++ b/vendor/github.com/moby/moby/client/node_remove.go @@ -9,6 +9,8 @@ import ( type NodeRemoveOptions struct { Force bool } + +// NodeRemoveResult holds the result of [Client.NodeRemove]. type NodeRemoveResult struct{} // NodeRemove removes a Node. diff --git a/vendor/github.com/moby/moby/client/node_update.go b/vendor/github.com/moby/moby/client/node_update.go index 4bc7c3b69..24f87a4df 100644 --- a/vendor/github.com/moby/moby/client/node_update.go +++ b/vendor/github.com/moby/moby/client/node_update.go @@ -13,6 +13,7 @@ type NodeUpdateOptions struct { Spec swarm.NodeSpec } +// NodeUpdateResult holds the result of [Client.NodeUpdate]. type NodeUpdateResult struct{} // NodeUpdate updates a Node. diff --git a/vendor/github.com/moby/moby/client/pkg/versions/compare.go b/vendor/github.com/moby/moby/client/pkg/versions/compare.go index 1a0325c7e..fa0ad9b5a 100644 --- a/vendor/github.com/moby/moby/client/pkg/versions/compare.go +++ b/vendor/github.com/moby/moby/client/pkg/versions/compare.go @@ -16,11 +16,8 @@ func compare(v1, v2 string) int { otherTab = strings.Split(v2, ".") ) - maxVer := len(currTab) - if len(otherTab) > maxVer { - maxVer = len(otherTab) - } - for i := 0; i < maxVer; i++ { + maxVer := max(len(otherTab), len(currTab)) + for i := range maxVer { var currInt, otherInt int if len(currTab) > i { diff --git a/vendor/github.com/moby/moby/client/request.go b/vendor/github.com/moby/moby/client/request.go index 7b1ff743d..10ed36dc6 100644 --- a/vendor/github.com/moby/moby/client/request.go +++ b/vendor/github.com/moby/moby/client/request.go @@ -128,7 +128,7 @@ func (cli *Client) sendRequest(ctx context.Context, method, path string, query u // when failing to make a connection, On error, any Response can be ignored. // A non-2xx status code doesn't cause an error. func (cli *Client) doRequest(req *http.Request) (*http.Response, error) { - resp, err := cli.client.Do(req) + resp, err := cli.client.Do(req) // #nosec G704 -- ignore "SSRF via taint analysis"; API client intentionally sends caller-provided requests/URLs. if err == nil { return resp, nil } @@ -317,12 +317,17 @@ func (cli *Client) addHeaders(req *http.Request, headers http.Header) *http.Requ req.Header[http.CanonicalHeaderKey(k)] = v } - if cli.userAgent != nil { - if *cli.userAgent == "" { - req.Header.Del("User-Agent") - } else { - req.Header.Set("User-Agent", *cli.userAgent) + if cli.userAgent == nil { + // No custom User-Agent set: use the default. + if req.Header.Get("User-Agent") == "" { + req.Header.Set("User-Agent", defaultUserAgent()) } + } else if *cli.userAgent == "" { + // User-Agent set to empty value; remove User-Agent. + req.Header.Del("User-Agent") + } else { + // Custom User-Agent set. + req.Header.Set("User-Agent", *cli.userAgent) } return req } @@ -344,7 +349,7 @@ func jsonEncode(data any) (io.Reader, error) { // encoding/json encodes a nil pointer as the JSON document `null`, // irrespective of whether the type implements json.Marshaler or encoding.TextMarshaler. // That is almost certainly not what the caller intended as the request body. - if v := reflect.ValueOf(data); v.Kind() == reflect.Ptr && v.IsNil() { + if v := reflect.ValueOf(data); v.Kind() == reflect.Pointer && v.IsNil() { return http.NoBody, nil } diff --git a/vendor/github.com/moby/moby/client/secret_remove.go b/vendor/github.com/moby/moby/client/secret_remove.go index 8554f3f21..42cbfec9e 100644 --- a/vendor/github.com/moby/moby/client/secret_remove.go +++ b/vendor/github.com/moby/moby/client/secret_remove.go @@ -2,10 +2,12 @@ package client import "context" +// SecretRemoveOptions holds options for [Client.SecretRemove]. type SecretRemoveOptions struct { // Add future optional parameters here } +// SecretRemoveResult holds the result of [Client.SecretRemove]. type SecretRemoveResult struct { // Add future fields here } diff --git a/vendor/github.com/moby/moby/client/secret_update.go b/vendor/github.com/moby/moby/client/secret_update.go index c88ad1106..d50fba4d4 100644 --- a/vendor/github.com/moby/moby/client/secret_update.go +++ b/vendor/github.com/moby/moby/client/secret_update.go @@ -13,6 +13,7 @@ type SecretUpdateOptions struct { Spec swarm.SecretSpec } +// SecretUpdateResult holds the result of [Client.SecretUpdate]. type SecretUpdateResult struct{} // SecretUpdate attempts to update a secret. diff --git a/vendor/github.com/moby/moby/client/service_logs.go b/vendor/github.com/moby/moby/client/service_logs.go index 57099ffe4..911b63cb7 100644 --- a/vendor/github.com/moby/moby/client/service_logs.go +++ b/vendor/github.com/moby/moby/client/service_logs.go @@ -34,7 +34,7 @@ type ServiceLogsResult interface { // // The underlying [io.ReadCloser] is automatically closed if the context is canceled, func (cli *Client) ServiceLogs(ctx context.Context, serviceID string, options ServiceLogsOptions) (ServiceLogsResult, error) { - // TODO(thaJeztah): this function needs documentation about the format of ths stream (similar to for container logs) + // TODO(thaJeztah): this function needs documentation about the format of the stream (similar to for container logs) // TODO(thaJeztah): migrate CLI utilities to the client where suitable; https://github.com/docker/cli/blob/v29.0.0-rc.1/cli/command/service/logs.go#L73-L348 serviceID, err := trimID("service", serviceID) diff --git a/vendor/github.com/moby/moby/client/system_disk_usage.go b/vendor/github.com/moby/moby/client/system_disk_usage.go index 1bb2d0d7e..c5df1e1b1 100644 --- a/vendor/github.com/moby/moby/client/system_disk_usage.go +++ b/vendor/github.com/moby/moby/client/system_disk_usage.go @@ -244,22 +244,15 @@ func imageDiskUsageFromLegacyAPI(du *legacyDiskUsage) ImagesDiskUsage { Items: du.Images, } - var used int64 for _, i := range idu.Items { if i.Containers > 0 { idu.ActiveCount++ - - if i.Size == -1 || i.SharedSize == -1 { - continue - } - used += (i.Size - i.SharedSize) + } else if i.Size != -1 && i.SharedSize != -1 { + // Only count reclaimable size if we have size information + idu.Reclaimable += (i.Size - i.SharedSize) } } - if idu.TotalCount > 0 { - idu.Reclaimable = idu.TotalSize - used - } - return idu } diff --git a/vendor/github.com/moby/moby/client/system_info.go b/vendor/github.com/moby/moby/client/system_info.go index 4c0a2238e..b4241742d 100644 --- a/vendor/github.com/moby/moby/client/system_info.go +++ b/vendor/github.com/moby/moby/client/system_info.go @@ -9,10 +9,12 @@ import ( "github.com/moby/moby/api/types/system" ) +// InfoOptions holds options for [Client.Info]. type InfoOptions struct { // No options currently; placeholder for future use } +// SystemInfoResult holds the result of [Client.Info]. type SystemInfoResult struct { Info system.Info } diff --git a/vendor/github.com/moby/moby/client/task_logs.go b/vendor/github.com/moby/moby/client/task_logs.go index e4de019f3..0174ad465 100644 --- a/vendor/github.com/moby/moby/client/task_logs.go +++ b/vendor/github.com/moby/moby/client/task_logs.go @@ -32,7 +32,7 @@ type TaskLogsResult interface { // // The underlying [io.ReadCloser] is automatically closed if the context is canceled, func (cli *Client) TaskLogs(ctx context.Context, taskID string, options TaskLogsOptions) (TaskLogsResult, error) { - // TODO(thaJeztah): this function needs documentation about the format of ths stream (similar to for container logs) + // TODO(thaJeztah): this function needs documentation about the format of the stream (similar to for container logs) // TODO(thaJeztah): migrate CLI utilities to the client where suitable; https://github.com/docker/cli/blob/v29.0.0-rc.1/cli/command/service/logs.go#L73-L348 query := url.Values{} diff --git a/vendor/github.com/moby/moby/client/utils.go b/vendor/github.com/moby/moby/client/utils.go index 4415e0dc5..1c0d09dfa 100644 --- a/vendor/github.com/moby/moby/client/utils.go +++ b/vendor/github.com/moby/moby/client/utils.go @@ -136,7 +136,7 @@ func newCancelReadCloser(ctx context.Context, rc io.ReadCloser) io.ReadCloser { rc: rc, close: sync.OnceValue(rc.Close), } - crc.stop = context.AfterFunc(ctx, func() { _ = crc.Close() }) + crc.stop = context.AfterFunc(ctx, func() { _ = crc.close() }) return crc } diff --git a/vendor/golang.org/x/sys/windows/dll_windows.go b/vendor/golang.org/x/sys/windows/dll_windows.go index 3ca814f54..1157b06d8 100644 --- a/vendor/golang.org/x/sys/windows/dll_windows.go +++ b/vendor/golang.org/x/sys/windows/dll_windows.go @@ -163,42 +163,7 @@ func (p *Proc) Addr() uintptr { // (according to the semantics of the specific function being called) before consulting // the error. The error will be guaranteed to contain windows.Errno. func (p *Proc) Call(a ...uintptr) (r1, r2 uintptr, lastErr error) { - switch len(a) { - case 0: - return syscall.Syscall(p.Addr(), uintptr(len(a)), 0, 0, 0) - case 1: - return syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], 0, 0) - case 2: - return syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], a[1], 0) - case 3: - return syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], a[1], a[2]) - case 4: - return syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], 0, 0) - case 5: - return syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], 0) - case 6: - return syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5]) - case 7: - return syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], 0, 0) - case 8: - return syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], 0) - case 9: - return syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]) - case 10: - return syscall.Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], 0, 0) - case 11: - return syscall.Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], 0) - case 12: - return syscall.Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11]) - case 13: - return syscall.Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], 0, 0) - case 14: - return syscall.Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], 0) - case 15: - return syscall.Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14]) - default: - panic("Call " + p.Name + " with too many arguments " + itoa(len(a)) + ".") - } + return syscall.SyscallN(p.Addr(), a...) } // A LazyDLL implements access to a single DLL. diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go index a8b0364c7..6c955cea1 100644 --- a/vendor/golang.org/x/sys/windows/security_windows.go +++ b/vendor/golang.org/x/sys/windows/security_windows.go @@ -1438,13 +1438,17 @@ func GetSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformati } // GetNamedSecurityInfo queries the security information for a given named object and returns the self-relative security -// descriptor result on the Go heap. +// descriptor result on the Go heap. The security descriptor might be nil, even when err is nil, if the object exists +// but has no security descriptor. func GetNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION) (sd *SECURITY_DESCRIPTOR, err error) { var winHeapSD *SECURITY_DESCRIPTOR err = getNamedSecurityInfo(objectName, objectType, securityInformation, nil, nil, nil, nil, &winHeapSD) if err != nil { return } + if winHeapSD == nil { + return nil, nil + } defer LocalFree(Handle(unsafe.Pointer(winHeapSD))) return winHeapSD.copySelfRelativeSecurityDescriptor(), nil } diff --git a/vendor/modules.txt b/vendor/modules.txt index 079650e69..09a3e7c09 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -109,8 +109,8 @@ github.com/go-logr/stdr # github.com/gogo/protobuf v1.3.2 ## explicit; go 1.15 github.com/gogo/protobuf/proto -# github.com/google/go-containerregistry v0.21.2 -## explicit; go 1.25.6 +# github.com/google/go-containerregistry v0.21.5 +## explicit; go 1.25.0 github.com/google/go-containerregistry/pkg/v1 github.com/google/go-containerregistry/pkg/v1/types # github.com/google/go-intervals v0.0.2 @@ -128,8 +128,8 @@ github.com/inconshreveable/mousetrap # github.com/json-iterator/go v1.1.12 ## explicit; go 1.12 github.com/json-iterator/go -# github.com/klauspost/compress v1.18.4 -## explicit; go 1.23 +# github.com/klauspost/compress v1.18.5 +## explicit; go 1.24 github.com/klauspost/compress github.com/klauspost/compress/flate github.com/klauspost/compress/fse @@ -173,10 +173,11 @@ github.com/moby/moby/api/types/storage github.com/moby/moby/api/types/swarm github.com/moby/moby/api/types/system github.com/moby/moby/api/types/volume -# github.com/moby/moby/client v0.3.0 -## explicit; go 1.24.0 +# github.com/moby/moby/client v0.4.0 +## explicit; go 1.24 github.com/moby/moby/client github.com/moby/moby/client/internal +github.com/moby/moby/client/internal/mod github.com/moby/moby/client/internal/timestamp github.com/moby/moby/client/pkg/versions # github.com/moby/sys/capability v0.4.0 @@ -383,8 +384,8 @@ go.podman.io/storage/pkg/tarlog go.podman.io/storage/pkg/truncindex go.podman.io/storage/pkg/unshare go.podman.io/storage/types -# golang.org/x/mod v0.33.0 -## explicit; go 1.24.0 +# golang.org/x/mod v0.35.0 +## explicit; go 1.25.0 golang.org/x/mod/internal/lazyregexp golang.org/x/mod/modfile golang.org/x/mod/module @@ -396,7 +397,7 @@ golang.org/x/net/context ## explicit; go 1.25.0 golang.org/x/sync/errgroup golang.org/x/sync/semaphore -# golang.org/x/sys v0.42.0 +# golang.org/x/sys v0.43.0 ## explicit; go 1.25.0 golang.org/x/sys/unix golang.org/x/sys/windows