From 03a4cd8d9a7bb6490420a9a3e22c6087f9209501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Tue, 27 May 2025 14:53:27 +0200 Subject: [PATCH 1/6] vendor: code.cloudfoundry.org/clock v1.37.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit full diff: https://github.com/cloudfoundry/clock/compare/v1.1.0...v1.37.0 Signed-off-by: Paweł Gronowski (cherry picked from commit 03a662b80efdaa4f594cfc94296e2dbd1ac588c2) Signed-off-by: Sebastiaan van Stijn --- vendor.mod | 2 +- vendor.sum | 13 ++++---- vendor/code.cloudfoundry.org/clock/CODEOWNERS | 1 + vendor/code.cloudfoundry.org/clock/README.md | 31 ++++++++++++++----- vendor/code.cloudfoundry.org/clock/clock.go | 2 +- .../clock/fakeclock/fake_clock.go | 2 +- vendor/modules.txt | 4 +-- 7 files changed, 36 insertions(+), 19 deletions(-) create mode 100644 vendor/code.cloudfoundry.org/clock/CODEOWNERS diff --git a/vendor.mod b/vendor.mod index 641f53ecae..a210cd930b 100644 --- a/vendor.mod +++ b/vendor.mod @@ -10,7 +10,7 @@ go 1.23.0 require ( cloud.google.com/go/compute/metadata v0.6.0 cloud.google.com/go/logging v1.9.0 - code.cloudfoundry.org/clock v1.1.0 + code.cloudfoundry.org/clock v1.37.0 dario.cat/mergo v1.0.1 github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c diff --git a/vendor.sum b/vendor.sum index e487c5d731..ca3c152820 100644 --- a/vendor.sum +++ b/vendor.sum @@ -9,8 +9,8 @@ cloud.google.com/go/logging v1.9.0 h1:iEIOXFO9EmSiTjDmfpbRjOxECO7R8C7b8IXUGOj7xZ cloud.google.com/go/logging v1.9.0/go.mod h1:1Io0vnZv4onoUnsVUQY3HZ3Igb1nBchky0A0y7BBBhE= cloud.google.com/go/longrunning v0.5.5 h1:GOE6pZFdSrTb4KAiKnXsJBtlE6mEyaW44oKyMILWnOg= cloud.google.com/go/longrunning v0.5.5/go.mod h1:WV2LAxD8/rg5Z1cNW6FJ/ZpX4E4VnDnoTk0yawPBB7s= -code.cloudfoundry.org/clock v1.1.0 h1:XLzC6W3Ah/Y7ht1rmZ6+QfPdt1iGWEAAtIZXgiaj57c= -code.cloudfoundry.org/clock v1.1.0/go.mod h1:yA3fxddT9RINQL2XHS7PS+OXxKCGhfrZmlNUCIM6AKo= +code.cloudfoundry.org/clock v1.37.0 h1:7e/FmrQ8f3cJW1aR4jhKWaEimBp5Ub39dOeNXQHq8HM= +code.cloudfoundry.org/clock v1.37.0/go.mod h1:9bvV2riUok6o34gOGGVIkX1v37wwsZbuSCBx8Y4laL0= dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk= @@ -219,7 +219,6 @@ github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7 github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -267,8 +266,8 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN 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/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8= -github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= +github.com/google/pprof v0.0.0-20250423184734-337e5dd93bb4 h1:gD0vax+4I+mAj+jEChEf25Ia07Jq7kYOFO5PPhAxFl4= +github.com/google/pprof v0.0.0-20250423184734-337e5dd93bb4/go.mod h1:5hDyRhoBCxViHszMt12TnOpEI4VVi+U8Gm9iphldiMA= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= @@ -555,8 +554,8 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tedsuo/ifrit v0.0.0-20230330192023-5cba443a66c4 h1:MGZzzxBuPuK4J0XQo+0uy0NnXQGKzHXhYp5oG1Wy860= -github.com/tedsuo/ifrit v0.0.0-20230330192023-5cba443a66c4/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0= +github.com/tedsuo/ifrit v0.0.0-20230516164442-7862c310ad26 h1:mWCRvpoEMVlslxEvvptKgIUb35va9yj9Oq5wGw/er5I= +github.com/tedsuo/ifrit v0.0.0-20230516164442-7862c310ad26/go.mod h1:0uD3VMXkZ7Bw0ojGCwDzebBBzPBXtzEZeXai+56BLX4= github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323 h1:r0p7fK56l8WPequOaR3i9LBqfPtEdXIQbUTzT55iqT4= diff --git a/vendor/code.cloudfoundry.org/clock/CODEOWNERS b/vendor/code.cloudfoundry.org/clock/CODEOWNERS new file mode 100644 index 0000000000..6a633c7ec4 --- /dev/null +++ b/vendor/code.cloudfoundry.org/clock/CODEOWNERS @@ -0,0 +1 @@ +* @cloudfoundry/wg-app-runtime-platform-diego-approvers diff --git a/vendor/code.cloudfoundry.org/clock/README.md b/vendor/code.cloudfoundry.org/clock/README.md index f6dc4a4a0b..58c2e24024 100644 --- a/vendor/code.cloudfoundry.org/clock/README.md +++ b/vendor/code.cloudfoundry.org/clock/README.md @@ -1,13 +1,30 @@ -# clock +# Clock -**Note**: This repository should be imported as `code.cloudfoundry.org/clock`. +[![Go Report +Card](https://goreportcard.com/badge/code.cloudfoundry.org/clock)](https://goreportcard.com/report/code.cloudfoundry.org/clock) +[![Go +Reference](https://pkg.go.dev/badge/code.cloudfoundry.org/clock.svg)](https://pkg.go.dev/code.cloudfoundry.org/clock) -Provides a `Clock` interface, useful for injecting time dependencies in tests. +Provides a Clock interface, useful for injecting time dependencies in +tests. -## Reporting issues and requesting features +> \[!NOTE\] +> +> This repository should be imported as `code.cloudfoundry.org/clock`. -Please report all issues and feature requests in [cloudfoundry/diego-release](https://github.com/cloudfoundry/diego-release/issues). +# Contributing -## Contributing +See the [Contributing.md](./.github/CONTRIBUTING.md) for more +information on how to contribute. -For tagging please use the semver compatible version format e.g. `v1.0.0`. +# Working Group Charter + +This repository is maintained by [App Runtime +Platform](https://github.com/cloudfoundry/community/blob/main/toc/working-groups/app-runtime-platform.md) +under `Diego` area. + +> \[!IMPORTANT\] +> +> Content in this file is managed by the [CI task +> `sync-readme`](https://github.com/cloudfoundry/wg-app-platform-runtime-ci/blob/main/shared/tasks/sync-readme/metadata.yml) +> and is generated by CI following a convention. diff --git a/vendor/code.cloudfoundry.org/clock/clock.go b/vendor/code.cloudfoundry.org/clock/clock.go index 6b091d99a4..006bb23ece 100644 --- a/vendor/code.cloudfoundry.org/clock/clock.go +++ b/vendor/code.cloudfoundry.org/clock/clock.go @@ -29,7 +29,7 @@ func (clock *realClock) Now() time.Time { } func (clock *realClock) Since(t time.Time) time.Duration { - return time.Now().Sub(t) + return time.Since(t) } func (clock *realClock) Sleep(d time.Duration) { diff --git a/vendor/code.cloudfoundry.org/clock/fakeclock/fake_clock.go b/vendor/code.cloudfoundry.org/clock/fakeclock/fake_clock.go index abe64a758e..b3e97d3853 100644 --- a/vendor/code.cloudfoundry.org/clock/fakeclock/fake_clock.go +++ b/vendor/code.cloudfoundry.org/clock/fakeclock/fake_clock.go @@ -101,7 +101,7 @@ func (clock *FakeClock) increment(duration time.Duration, waitForWatchers bool, watchers := make([]timeWatcher, 0) newWatchers := map[timeWatcher]struct{}{} - for w, _ := range clock.watchers { + for w := range clock.watchers { fire := w.shouldFire(now) if fire { watchers = append(watchers, w) diff --git a/vendor/modules.txt b/vendor/modules.txt index f1e8c59866..849056a1ce 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -15,8 +15,8 @@ cloud.google.com/go/logging/internal cloud.google.com/go/longrunning cloud.google.com/go/longrunning/autogen cloud.google.com/go/longrunning/autogen/longrunningpb -# code.cloudfoundry.org/clock v1.1.0 -## explicit; go 1.20 +# code.cloudfoundry.org/clock v1.37.0 +## explicit; go 1.23.0 code.cloudfoundry.org/clock code.cloudfoundry.org/clock/fakeclock # dario.cat/mergo v1.0.1 From 6305a44e58f5376544180d95cebc22ea8cf1d09f Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 4 Aug 2025 17:59:18 +0200 Subject: [PATCH 2/6] go.mod: github.com/fernet/fernet-go v0.0.0-20240119011108-303da6aec611 Update to the latest version, which is now a module; full diff: https://github.com/fernet/fernet-go/compare/9f70042a33ee...303da6aec611527ea06 Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 8e63b551464da55b9762b9daed58c4c87d507f91) Signed-off-by: Sebastiaan van Stijn --- vendor.mod | 2 +- vendor.sum | 4 +-- vendor/github.com/fernet/fernet-go/fernet.go | 36 ++++++++------------ vendor/modules.txt | 4 +-- 4 files changed, 19 insertions(+), 27 deletions(-) diff --git a/vendor.mod b/vendor.mod index a210cd930b..f21dabf36e 100644 --- a/vendor.mod +++ b/vendor.mod @@ -163,7 +163,7 @@ require ( github.com/docker/libtrust v0.0.0-20150526203908-9cbd2a1374f4 // indirect github.com/dustin/go-humanize v1.0.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fernet/fernet-go v0.0.0-20211208181803-9f70042a33ee // indirect + github.com/fernet/fernet-go v0.0.0-20240119011108-303da6aec611 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect diff --git a/vendor.sum b/vendor.sum index ca3c152820..22e9b6d267 100644 --- a/vendor.sum +++ b/vendor.sum @@ -200,8 +200,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fernet/fernet-go v0.0.0-20211208181803-9f70042a33ee h1:v6Eju/FhxsACGNipFEPBZZAzGr1F/jlRQr1qiBw2nEE= -github.com/fernet/fernet-go v0.0.0-20211208181803-9f70042a33ee/go.mod h1:2H9hjfbpSMHwY503FclkV/lZTBh2YlOmLLSda12uL8c= +github.com/fernet/fernet-go v0.0.0-20240119011108-303da6aec611 h1:JwYtKJ/DVEoIA5dH45OEU7uoryZY/gjd/BQiwwAOImM= +github.com/fernet/fernet-go v0.0.0-20240119011108-303da6aec611/go.mod h1:zHMNeYgqrTpKyjawjitDg0Osd1P/FmeA0SZLYK3RfLQ= github.com/fluent/fluent-logger-golang v1.9.0 h1:zUdY44CHX2oIUc7VTNZc+4m+ORuO/mldQDA7czhWXEg= github.com/fluent/fluent-logger-golang v1.9.0/go.mod h1:2/HCT/jTy78yGyeNGQLGQsjF3zzzAuy6Xlk6FCMV5eU= github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= diff --git a/vendor/github.com/fernet/fernet-go/fernet.go b/vendor/github.com/fernet/fernet-go/fernet.go index b35fdbbe4f..4d6cf5ab6a 100644 --- a/vendor/github.com/fernet/fernet-go/fernet.go +++ b/vendor/github.com/fernet/fernet-go/fernet.go @@ -80,7 +80,7 @@ func verify(msg, tok []byte, ttl time.Duration, now time.Time, k *Key) []byte { if subtle.ConstantTimeCompare(tok[n:], hmac[:]) != 1 { return nil } - pay := tok[payOffset : len(tok)-sha256.Size] + pay := tok[payOffset:n] if len(pay)%aes.BlockSize != 0 { return nil } @@ -89,7 +89,7 @@ func verify(msg, tok []byte, ttl time.Duration, now time.Time, k *Key) []byte { pay = msg } bc, _ := aes.NewCipher(k.cryptBytes()) - iv := tok[9:][:aes.BlockSize] + iv := tok[ivOffset:][:aes.BlockSize] cipher.NewCBCDecrypter(bc, iv).CryptBlocks(pay, pay) return unpad(pay) } @@ -120,42 +120,34 @@ func unpad(p []byte) []byte { return p[:len(p)-int(c)] } -func b64enc(src []byte) []byte { - dst := make([]byte, encoding.EncodedLen(len(src))) - encoding.Encode(dst, src) - return dst -} - -func b64dec(src []byte) []byte { - dst := make([]byte, encoding.DecodedLen(len(src))) - n, err := encoding.Decode(dst, src) - if err != nil { - return nil - } - return dst[:n] -} - func genhmac(q, p, k []byte) { h := hmac.New(sha256.New, k) h.Write(p) h.Sum(q) } -// EncryptAndSign encrypts and signs msg with key k and returns the resulting -// fernet token. If msg contains text, the text should be encoded -// with UTF-8 to follow fernet convention. -func EncryptAndSign(msg []byte, k *Key) (tok []byte, err error) { +// EncryptAndSignAtTime encrypts and signs msg with key k at timestamp signedAt +// and returns the resulting fernet token. If msg contains text, the text +// should be encoded with UTF-8 to follow fernet convention. +func EncryptAndSignAtTime(msg []byte, k *Key, signedAt time.Time) (tok []byte, err error) { iv := make([]byte, aes.BlockSize) if _, err := io.ReadFull(rand.Reader, iv); err != nil { return nil, err } b := make([]byte, encodedLen(len(msg))) - n := gen(b, msg, iv, time.Now(), k) + n := gen(b, msg, iv, signedAt, k) tok = make([]byte, encoding.EncodedLen(n)) encoding.Encode(tok, b[:n]) return tok, nil } +// EncryptAndSign encrypts and signs msg with key k and returns the resulting +// fernet token. If msg contains text, the text should be encoded +// with UTF-8 to follow fernet convention. +func EncryptAndSign(msg []byte, k *Key) (tok []byte, err error) { + return EncryptAndSignAtTime(msg, k, time.Now()) +} + // VerifyAndDecrypt verifies that tok is a valid fernet token that was signed // with a key in k at most ttl time ago only if ttl is greater than zero. // Returns the message contained in tok if tok is valid, otherwise nil. diff --git a/vendor/modules.txt b/vendor/modules.txt index 849056a1ce..7b2081b606 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -530,8 +530,8 @@ github.com/dustin/go-humanize # github.com/felixge/httpsnoop v1.0.4 ## explicit; go 1.13 github.com/felixge/httpsnoop -# github.com/fernet/fernet-go v0.0.0-20211208181803-9f70042a33ee -## explicit +# github.com/fernet/fernet-go v0.0.0-20240119011108-303da6aec611 +## explicit; go 1.18 github.com/fernet/fernet-go # github.com/fluent/fluent-logger-golang v1.9.0 ## explicit From 2c93d2f909f447cb4d8f440a3eb3f97b7b7a42b9 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 4 Aug 2025 18:00:28 +0200 Subject: [PATCH 3/6] go.mod: github.com/docker/go-events v0.0.0-20250114142523-c867878c5e32 full diff: https://github.com/docker/go-events/compare/e31b211e4f1c...c867878c5e3250e8f70c43955615c547954d3eab Signed-off-by: Sebastiaan van Stijn (cherry picked from commit d8b622b3157be76559c76e1dfebbc526b4cd32dc) Signed-off-by: Sebastiaan van Stijn --- vendor.mod | 2 +- vendor.sum | 4 +-- vendor/github.com/docker/go-events/README.md | 1 - .../github.com/docker/go-events/SECURITY.md | 36 +++++++++++++++++++ vendor/github.com/docker/go-events/vendor.mod | 5 +++ vendor/github.com/docker/go-events/vendor.sum | 16 +++++++++ vendor/modules.txt | 2 +- 7 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 vendor/github.com/docker/go-events/SECURITY.md create mode 100644 vendor/github.com/docker/go-events/vendor.mod create mode 100644 vendor/github.com/docker/go-events/vendor.sum diff --git a/vendor.mod b/vendor.mod index f21dabf36e..4243a882a8 100644 --- a/vendor.mod +++ b/vendor.mod @@ -42,7 +42,7 @@ require ( github.com/distribution/reference v0.6.0 github.com/docker/distribution v2.8.3+incompatible github.com/docker/go-connections v0.5.0 - github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c + github.com/docker/go-events v0.0.0-20250114142523-c867878c5e32 github.com/docker/go-metrics v0.0.1 github.com/docker/go-units v0.5.0 github.com/fluent/fluent-logger-golang v1.9.0 diff --git a/vendor.sum b/vendor.sum index 22e9b6d267..6aa7e155a8 100644 --- a/vendor.sum +++ b/vendor.sum @@ -183,8 +183,8 @@ github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqI github.com/docker/docker-credential-helpers v0.9.3/go.mod h1:x+4Gbw9aGmChi3qTLZj8Dfn0TD20M/fuWy0E5+WDeCo= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= -github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= -github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= +github.com/docker/go-events v0.0.0-20250114142523-c867878c5e32 h1:EHZfspsnLAz8Hzccd67D5abwLiqoqym2jz/jOS39mCk= +github.com/docker/go-events v0.0.0-20250114142523-c867878c5e32/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8= github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= diff --git a/vendor/github.com/docker/go-events/README.md b/vendor/github.com/docker/go-events/README.md index 0acafc279a..662d855fb3 100644 --- a/vendor/github.com/docker/go-events/README.md +++ b/vendor/github.com/docker/go-events/README.md @@ -1,7 +1,6 @@ # Docker Events Package [![GoDoc](https://godoc.org/github.com/docker/go-events?status.svg)](https://godoc.org/github.com/docker/go-events) -[![Circle CI](https://circleci.com/gh/docker/go-events.svg?style=shield)](https://circleci.com/gh/docker/go-events) The Docker `events` package implements a composable event distribution package for Go. diff --git a/vendor/github.com/docker/go-events/SECURITY.md b/vendor/github.com/docker/go-events/SECURITY.md new file mode 100644 index 0000000000..610eef2c9e --- /dev/null +++ b/vendor/github.com/docker/go-events/SECURITY.md @@ -0,0 +1,36 @@ +# Security Policy + +The maintainers of the Docker Events package take security seriously. If you discover +a security issue, please bring it to their attention right away! + +## Reporting a Vulnerability + +Please **DO NOT** file a public issue, instead send your report privately +to [security@docker.com](mailto:security@docker.com). + +Reporter(s) can expect a response within 72 hours, acknowledging the issue was +received. + +## Review Process + +After receiving the report, an initial triage and technical analysis is +performed to confirm the report and determine its scope. We may request +additional information in this stage of the process. + +Once a reviewer has confirmed the relevance of the report, a draft security +advisory will be created on GitHub. The draft advisory will be used to discuss +the issue with maintainers, the reporter(s), and where applicable, other +affected parties under embargo. + +If the vulnerability is accepted, a timeline for developing a patch, public +disclosure, and patch release will be determined. If there is an embargo period +on public disclosure before the patch release, the reporter(s) are expected to +participate in the discussion of the timeline and abide by agreed upon dates +for public disclosure. + +## Accreditation + +Security reports are greatly appreciated and we will publicly thank you, +although we will keep your name confidential if you request it. We also like to +send gifts - if you're into swag, make sure to let us know. We do not currently +offer a paid security bounty program at this time. diff --git a/vendor/github.com/docker/go-events/vendor.mod b/vendor/github.com/docker/go-events/vendor.mod new file mode 100644 index 0000000000..66a2cd9e5c --- /dev/null +++ b/vendor/github.com/docker/go-events/vendor.mod @@ -0,0 +1,5 @@ +module github.com/docker/go-events + +go 1.13 + +require github.com/sirupsen/logrus v1.9.3 diff --git a/vendor/github.com/docker/go-events/vendor.sum b/vendor/github.com/docker/go-events/vendor.sum new file mode 100644 index 0000000000..9243c28735 --- /dev/null +++ b/vendor/github.com/docker/go-events/vendor.sum @@ -0,0 +1,16 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/vendor/modules.txt b/vendor/modules.txt index 7b2081b606..d1b0bb3f70 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -512,7 +512,7 @@ github.com/docker/distribution/registry/storage/cache/memory github.com/docker/go-connections/nat github.com/docker/go-connections/sockets github.com/docker/go-connections/tlsconfig -# github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c +# github.com/docker/go-events v0.0.0-20250114142523-c867878c5e32 ## explicit github.com/docker/go-events # github.com/docker/go-metrics v0.0.1 From 993eae423e84951d40049140bae29b9295b1dd36 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 4 Aug 2025 18:02:53 +0200 Subject: [PATCH 4/6] go.mod: dario.cat/mergo v1.0.2 drops gopkg.in/yaml.v3 as dependency full diff: https://github.com/darccio/mergo/compare/v1.0.1...v1.0.2 Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 259eb259bcde3bdc53a49a745ac8b6ac2c5b0dac) Signed-off-by: Sebastiaan van Stijn --- vendor.mod | 2 +- vendor.sum | 4 ++-- vendor/dario.cat/mergo/FUNDING.json | 7 +++++++ vendor/dario.cat/mergo/README.md | 5 ----- vendor/dario.cat/mergo/SECURITY.md | 4 ++-- vendor/modules.txt | 2 +- 6 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 vendor/dario.cat/mergo/FUNDING.json diff --git a/vendor.mod b/vendor.mod index 4243a882a8..4c18caa70c 100644 --- a/vendor.mod +++ b/vendor.mod @@ -11,7 +11,7 @@ require ( cloud.google.com/go/compute/metadata v0.6.0 cloud.google.com/go/logging v1.9.0 code.cloudfoundry.org/clock v1.37.0 - dario.cat/mergo v1.0.1 + dario.cat/mergo v1.0.2 github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c github.com/Graylog2/go-gelf v0.0.0-20191017102106-1550ee647df0 diff --git a/vendor.sum b/vendor.sum index 6aa7e155a8..e840e60e64 100644 --- a/vendor.sum +++ b/vendor.sum @@ -11,8 +11,8 @@ cloud.google.com/go/longrunning v0.5.5 h1:GOE6pZFdSrTb4KAiKnXsJBtlE6mEyaW44oKyMI cloud.google.com/go/longrunning v0.5.5/go.mod h1:WV2LAxD8/rg5Z1cNW6FJ/ZpX4E4VnDnoTk0yawPBB7s= code.cloudfoundry.org/clock v1.37.0 h1:7e/FmrQ8f3cJW1aR4jhKWaEimBp5Ub39dOeNXQHq8HM= code.cloudfoundry.org/clock v1.37.0/go.mod h1:9bvV2riUok6o34gOGGVIkX1v37wwsZbuSCBx8Y4laL0= -dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= -dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8= +dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 h1:JZg6HRh6W6U4OLl6lk7BZ7BLisIzM9dG1R50zUk9C/M= diff --git a/vendor/dario.cat/mergo/FUNDING.json b/vendor/dario.cat/mergo/FUNDING.json new file mode 100644 index 0000000000..0585e1fe13 --- /dev/null +++ b/vendor/dario.cat/mergo/FUNDING.json @@ -0,0 +1,7 @@ +{ + "drips": { + "ethereum": { + "ownedBy": "0x6160020e7102237aC41bdb156e94401692D76930" + } + } +} diff --git a/vendor/dario.cat/mergo/README.md b/vendor/dario.cat/mergo/README.md index 0b3c488893..0e4a59afd9 100644 --- a/vendor/dario.cat/mergo/README.md +++ b/vendor/dario.cat/mergo/README.md @@ -85,7 +85,6 @@ Mergo is used by [thousands](https://deps.dev/go/dario.cat%2Fmergo/v1.0.0/depend * [goreleaser/goreleaser](https://github.com/goreleaser/goreleaser) * [go-micro/go-micro](https://github.com/go-micro/go-micro) * [grafana/loki](https://github.com/grafana/loki) -* [kubernetes/kubernetes](https://github.com/kubernetes/kubernetes) * [masterminds/sprig](github.com/Masterminds/sprig) * [moby/moby](https://github.com/moby/moby) * [slackhq/nebula](https://github.com/slackhq/nebula) @@ -191,10 +190,6 @@ func main() { } ``` -Note: if test are failing due missing package, please execute: - - go get gopkg.in/yaml.v3 - ### Transformers Transformers allow to merge specific types differently than in the default behavior. In other words, now you can customize how some types are merged. For example, `time.Time` is a struct; it doesn't have zero value but IsZero can return true because it has fields with zero value. How can we merge a non-zero `time.Time`? diff --git a/vendor/dario.cat/mergo/SECURITY.md b/vendor/dario.cat/mergo/SECURITY.md index a5de61f77b..3788fcc1c2 100644 --- a/vendor/dario.cat/mergo/SECURITY.md +++ b/vendor/dario.cat/mergo/SECURITY.md @@ -4,8 +4,8 @@ | Version | Supported | | ------- | ------------------ | -| 0.3.x | :white_check_mark: | -| < 0.3 | :x: | +| 1.x.x | :white_check_mark: | +| < 1.0 | :x: | ## Security contact information diff --git a/vendor/modules.txt b/vendor/modules.txt index d1b0bb3f70..ba9ed44a5d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -19,7 +19,7 @@ cloud.google.com/go/longrunning/autogen/longrunningpb ## explicit; go 1.23.0 code.cloudfoundry.org/clock code.cloudfoundry.org/clock/fakeclock -# dario.cat/mergo v1.0.1 +# dario.cat/mergo v1.0.2 ## explicit; go 1.13 dario.cat/mergo # github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 From 7d7edf46a64befff6525dd7b4349d65302f67157 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 4 Aug 2025 18:10:00 +0200 Subject: [PATCH 5/6] go.mod: github.com/containerd/containerd/v2 v2.1.4 full diff: https://github.com/containerd/containerd/compare/v2.1.3...v2.1.4 Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 3b14c5488fdcece945d5cd888da1880b94f77804) Signed-off-by: Sebastiaan van Stijn --- vendor.mod | 2 +- vendor.sum | 4 +- .../containerd/containerd/v2/client/client.go | 77 ++++++++++++------- .../containerd/containerd/v2/client/task.go | 9 ++- .../v2/core/remotes/docker/fetcher.go | 46 ++++++----- .../containerd/v2/version/version.go | 2 +- vendor/modules.txt | 2 +- 7 files changed, 88 insertions(+), 54 deletions(-) diff --git a/vendor.mod b/vendor.mod index 4c18caa70c..79b02424f2 100644 --- a/vendor.mod +++ b/vendor.mod @@ -27,7 +27,7 @@ require ( github.com/cloudflare/cfssl v1.6.4 github.com/containerd/cgroups/v3 v3.0.5 github.com/containerd/containerd/api v1.9.0 - github.com/containerd/containerd/v2 v2.1.3 + github.com/containerd/containerd/v2 v2.1.4 github.com/containerd/continuity v0.4.5 github.com/containerd/errdefs v1.0.0 github.com/containerd/errdefs/pkg v0.3.0 diff --git a/vendor.sum b/vendor.sum index e840e60e64..9b4f21bde1 100644 --- a/vendor.sum +++ b/vendor.sum @@ -125,8 +125,8 @@ github.com/containerd/console v1.0.5 h1:R0ymNeydRqH2DmakFNdmjR2k0t7UPuiOV/N/27/q github.com/containerd/console v1.0.5/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= github.com/containerd/containerd/api v1.9.0 h1:HZ/licowTRazus+wt9fM6r/9BQO7S0vD5lMcWspGIg0= github.com/containerd/containerd/api v1.9.0/go.mod h1:GhghKFmTR3hNtyznBoQ0EMWr9ju5AqHjcZPsSpTKutI= -github.com/containerd/containerd/v2 v2.1.3 h1:eMD2SLcIQPdMlnlNF6fatlrlRLAeDaiGPGwmRKLZKNs= -github.com/containerd/containerd/v2 v2.1.3/go.mod h1:8C5QV9djwsYDNhxfTCFjWtTBZrqjditQ4/ghHSYjnHM= +github.com/containerd/containerd/v2 v2.1.4 h1:/hXWjiSFd6ftrBOBGfAZ6T30LJcx1dBjdKEeI8xucKQ= +github.com/containerd/containerd/v2 v2.1.4/go.mod h1:8C5QV9djwsYDNhxfTCFjWtTBZrqjditQ4/ghHSYjnHM= github.com/containerd/continuity v0.4.5 h1:ZRoN1sXq9u7V6QoHMcVWGhOwDFqZ4B9i5H6un1Wh0x4= github.com/containerd/continuity v0.4.5/go.mod h1:/lNJvtJKUQStBzpVQ1+rasXO1LAWtUQssk28EZvJ3nE= github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= diff --git a/vendor/github.com/containerd/containerd/v2/client/client.go b/vendor/github.com/containerd/containerd/v2/client/client.go index 7996c4a5bc..6b6b4e6739 100644 --- a/vendor/github.com/containerd/containerd/v2/client/client.go +++ b/vendor/github.com/containerd/containerd/v2/client/client.go @@ -114,9 +114,7 @@ func New(address string, opts ...Opt) (*Client, error) { } if copts.defaultRuntime != "" { - c.runtime = copts.defaultRuntime - } else { - c.runtime = defaults.DefaultRuntime + c.runtime.value = copts.defaultRuntime } if copts.defaultPlatform != nil { @@ -174,15 +172,6 @@ func New(address string, opts ...Opt) (*Client, error) { return nil, fmt.Errorf("no grpc connection or services is available: %w", errdefs.ErrUnavailable) } - // check namespace labels for default runtime - if copts.defaultRuntime == "" && c.defaultns != "" { - if label, err := c.GetLabel(context.Background(), defaults.DefaultRuntimeNSLabel); err != nil { - return nil, err - } else if label != "" { - c.runtime = label - } - } - return c, nil } @@ -198,7 +187,10 @@ func NewWithConn(conn *grpc.ClientConn, opts ...Opt) (*Client, error) { c := &Client{ defaultns: copts.defaultns, conn: conn, - runtime: defaults.DefaultRuntime, + } + + if copts.defaultRuntime != "" { + c.runtime.value = copts.defaultRuntime } if copts.defaultPlatform != nil { @@ -207,15 +199,6 @@ func NewWithConn(conn *grpc.ClientConn, opts ...Opt) (*Client, error) { c.platform = platforms.Default() } - // check namespace labels for default runtime - if copts.defaultRuntime == "" && c.defaultns != "" { - if label, err := c.GetLabel(context.Background(), defaults.DefaultRuntimeNSLabel); err != nil { - return nil, err - } else if label != "" { - c.runtime = label - } - } - if copts.services != nil { c.services = *copts.services } @@ -228,10 +211,15 @@ type Client struct { services connMu sync.Mutex conn *grpc.ClientConn - runtime string defaultns string platform platforms.MatchComparer connector func() (*grpc.ClientConn, error) + + // this should only be accessed via defaultRuntime() + runtime struct { + value string + mut sync.Mutex + } } // Reconnect re-establishes the GRPC connection to the containerd daemon @@ -252,7 +240,31 @@ func (c *Client) Reconnect() error { // Runtime returns the name of the runtime being used func (c *Client) Runtime() string { - return c.runtime + runtime, _ := c.defaultRuntime(context.TODO()) + return runtime +} + +func (c *Client) defaultRuntime(ctx context.Context) (string, error) { + c.runtime.mut.Lock() + defer c.runtime.mut.Unlock() + + if c.runtime.value != "" { + return c.runtime.value, nil + } + + if c.defaultns != "" { + label, err := c.GetLabel(ctx, defaults.DefaultRuntimeNSLabel) + if err != nil { + // Don't set the runtime value if there's an error + return defaults.DefaultRuntime, fmt.Errorf("failed to get default runtime label: %w", err) + } + if label != "" { + c.runtime.value = label + return label, nil + } + } + c.runtime.value = defaults.DefaultRuntime + return c.runtime.value, nil } // IsServing returns true if the client can successfully connect to the @@ -299,10 +311,15 @@ func (c *Client) NewContainer(ctx context.Context, id string, opts ...NewContain } defer done(ctx) + runtime, err := c.defaultRuntime(ctx) + if err != nil { + return nil, err + } + container := containers.Container{ ID: id, Runtime: containers.RuntimeInfo{ - Name: c.runtime, + Name: runtime, }, } for _, o := range opts { @@ -935,14 +952,16 @@ type RuntimeInfo struct { } func (c *Client) RuntimeInfo(ctx context.Context, runtimePath string, runtimeOptions interface{}) (*RuntimeInfo, error) { - rt := c.runtime + runtime, err := c.defaultRuntime(ctx) + if err != nil { + return nil, err + } if runtimePath != "" { - rt = runtimePath + runtime = runtimePath } rr := &apitypes.RuntimeRequest{ - RuntimePath: rt, + RuntimePath: runtime, } - var err error if runtimeOptions != nil { rr.Options, err = typeurl.MarshalAnyToProto(runtimeOptions) if err != nil { diff --git a/vendor/github.com/containerd/containerd/v2/client/task.go b/vendor/github.com/containerd/containerd/v2/client/task.go index bfe8569e58..6f60e75f8b 100644 --- a/vendor/github.com/containerd/containerd/v2/client/task.go +++ b/vendor/github.com/containerd/containerd/v2/client/task.go @@ -373,10 +373,15 @@ func (t *task) Delete(ctx context.Context, opts ...ProcessDeleteOpts) (*ExitStat return nil, err } + runtime, err := t.client.defaultRuntime(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get default runtime: %w", err) + } + switch status.Status { case Stopped, Unknown, "": case Created: - if t.client.runtime == plugins.RuntimePlugin.String()+".windows" { + if runtime == plugins.RuntimePlugin.String()+".windows" { // On windows Created is akin to Stopped break } @@ -393,7 +398,7 @@ func (t *task) Delete(ctx context.Context, opts ...ProcessDeleteOpts) (*ExitStat // io.Wait locks for restored tasks on Windows unless we call // io.Close first (https://github.com/containerd/containerd/issues/5621) // in other cases, preserve the contract and let IO finish before closing - if t.client.runtime == plugins.RuntimePlugin.String()+".windows" { + if runtime == plugins.RuntimePlugin.String()+".windows" { t.io.Close() } // io.Cancel is used to cancel the io goroutine while it is in diff --git a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/fetcher.go b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/fetcher.go index 3e74df8cc1..90542e2e75 100644 --- a/vendor/github.com/containerd/containerd/v2/core/remotes/docker/fetcher.go +++ b/vendor/github.com/containerd/containerd/v2/core/remotes/docker/fetcher.go @@ -474,7 +474,18 @@ func (r dockerFetcher) open(ctx context.Context, req *request, mediatype string, return nil, err } - body := resp.Body + body := &fnOnClose{ + BeforeClose: func() { + r.Release(1) + }, + ReadCloser: resp.Body, + } + defer func() { + if retErr != nil { + body.Close() + } + }() + encoding := strings.FieldsFunc(resp.Header.Get("Content-Encoding"), func(r rune) bool { return r == ' ' || r == '\t' || r == ',' }) @@ -505,29 +516,33 @@ func (r dockerFetcher) open(ctx context.Context, req *request, mediatype string, for i := range numChunks { readers[i], writers[i] = newPipeWriter(bufPool) } + // keep reference of the initial body value to ensure it is closed + ibody := body go func() { for i := range numChunks { select { case queue <- i: case <-done: + if i == 0 { + ibody.Close() + } return // avoid leaking a goroutine if we exit early. } } close(queue) }() - r.Release(1) for range parallelism { go func() { for i := range queue { // first in first out copy := func() error { - if err := r.Acquire(ctx, 1); err != nil { - return err - } - defer r.Release(1) var body io.ReadCloser if i == 0 { - body = resp.Body + body = ibody } else { + if err := r.Acquire(ctx, 1); err != nil { + return err + } + defer r.Release(1) reqClone := req.clone() reqClone.setOffset(offset + i*chunkSize) nresp, err := reqClone.doWithRetries(ctx, lastHost, withErrorCheck) @@ -564,32 +579,27 @@ func (r dockerFetcher) open(ctx context.Context, req *request, mediatype string, }, ReadCloser: io.NopCloser(io.MultiReader(readers...)), } - } else { - body = &fnOnClose{ - BeforeClose: func() { - r.Release(1) - }, - ReadCloser: body, - } } + for i := len(encoding) - 1; i >= 0; i-- { algorithm := strings.ToLower(encoding[i]) switch algorithm { case "zstd": - r, err := zstd.NewReader(body, + r, err := zstd.NewReader(body.ReadCloser, zstd.WithDecoderLowmem(false), ) if err != nil { return nil, err } - body = r.IOReadCloser() + body.ReadCloser = r.IOReadCloser() case "gzip": - body, err = gzip.NewReader(body) + r, err := gzip.NewReader(body.ReadCloser) if err != nil { return nil, err } + body.ReadCloser = r case "deflate": - body = flate.NewReader(body) + body.ReadCloser = flate.NewReader(body.ReadCloser) case "identity", "": // no content-encoding applied, use raw body default: diff --git a/vendor/github.com/containerd/containerd/v2/version/version.go b/vendor/github.com/containerd/containerd/v2/version/version.go index 709cbe9477..d6d0eb04ed 100644 --- a/vendor/github.com/containerd/containerd/v2/version/version.go +++ b/vendor/github.com/containerd/containerd/v2/version/version.go @@ -24,7 +24,7 @@ var ( Package = "github.com/containerd/containerd/v2" // Version holds the complete version number. Filled in at linking time. - Version = "2.1.3+unknown" + Version = "2.1.4+unknown" // Revision is filled with the VCS (e.g. git) revision being used to build // the program at linking time. diff --git a/vendor/modules.txt b/vendor/modules.txt index ba9ed44a5d..67f7c13946 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -323,7 +323,7 @@ github.com/containerd/containerd/api/types/runc/options github.com/containerd/containerd/api/types/runtimeoptions/v1 github.com/containerd/containerd/api/types/task github.com/containerd/containerd/api/types/transfer -# github.com/containerd/containerd/v2 v2.1.3 +# github.com/containerd/containerd/v2 v2.1.4 ## explicit; go 1.23.0 github.com/containerd/containerd/v2/client github.com/containerd/containerd/v2/cmd/containerd/server/config From 553c3b8c9fcdcaf5fb48cffa931fec260dc36b99 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 13 Aug 2025 13:45:05 +0200 Subject: [PATCH 6/6] vendor: go.etcd.io/bbolt v1.4.2 - Fix the compilation issue on aix, android and solaris due to wrong use of maxMapSize - Add protection on meta page when it's being written - Correct the incorrect usage of debug method - Add clarification on the option InitialMmapSize - Fix the crash when writing huge values full diff: https://github.com/etcd-io/bbolt/compare/v1.4.0...v1.4.2 Signed-off-by: Sebastiaan van Stijn (cherry picked from commit a2aa7be7249c60e6924cfa8b4a6c9b33a1dcbfed) Signed-off-by: Sebastiaan van Stijn --- vendor.mod | 2 +- vendor.sum | 4 ++-- vendor/go.etcd.io/bbolt/.go-version | 2 +- vendor/go.etcd.io/bbolt/bolt_386.go | 7 ------- vendor/go.etcd.io/bbolt/bolt_aix.go | 4 +++- vendor/go.etcd.io/bbolt/bolt_amd64.go | 7 ------- vendor/go.etcd.io/bbolt/bolt_android.go | 4 +++- vendor/go.etcd.io/bbolt/bolt_arm.go | 7 ------- vendor/go.etcd.io/bbolt/bolt_arm64.go | 9 --------- vendor/go.etcd.io/bbolt/bolt_loong64.go | 9 --------- vendor/go.etcd.io/bbolt/bolt_mips64x.go | 9 --------- vendor/go.etcd.io/bbolt/bolt_mipsx.go | 9 --------- vendor/go.etcd.io/bbolt/bolt_ppc.go | 9 --------- vendor/go.etcd.io/bbolt/bolt_ppc64.go | 9 --------- vendor/go.etcd.io/bbolt/bolt_ppc64le.go | 9 --------- vendor/go.etcd.io/bbolt/bolt_riscv64.go | 9 --------- vendor/go.etcd.io/bbolt/bolt_s390x.go | 9 --------- vendor/go.etcd.io/bbolt/bolt_solaris.go | 4 +++- vendor/go.etcd.io/bbolt/bolt_unix.go | 3 ++- vendor/go.etcd.io/bbolt/bolt_windows.go | 3 ++- vendor/go.etcd.io/bbolt/db.go | 16 +++++++++++----- .../go.etcd.io/bbolt/internal/common/bolt_386.go | 7 +++++++ .../bbolt/internal/common/bolt_amd64.go | 7 +++++++ .../go.etcd.io/bbolt/internal/common/bolt_arm.go | 7 +++++++ .../bbolt/internal/common/bolt_arm64.go | 9 +++++++++ .../bbolt/internal/common/bolt_loong64.go | 9 +++++++++ .../bbolt/internal/common/bolt_mips64x.go | 9 +++++++++ .../bbolt/internal/common/bolt_mipsx.go | 9 +++++++++ .../go.etcd.io/bbolt/internal/common/bolt_ppc.go | 9 +++++++++ .../bbolt/internal/common/bolt_ppc64.go | 9 +++++++++ .../bbolt/internal/common/bolt_ppc64le.go | 9 +++++++++ .../bbolt/internal/common/bolt_riscv64.go | 9 +++++++++ .../bbolt/internal/common/bolt_s390x.go | 9 +++++++++ vendor/go.etcd.io/bbolt/internal/common/types.go | 3 --- .../go.etcd.io/bbolt/internal/common/unsafe.go | 2 +- vendor/go.etcd.io/bbolt/tx.go | 7 +++++-- vendor/modules.txt | 2 +- 37 files changed, 137 insertions(+), 123 deletions(-) delete mode 100644 vendor/go.etcd.io/bbolt/bolt_386.go delete mode 100644 vendor/go.etcd.io/bbolt/bolt_amd64.go delete mode 100644 vendor/go.etcd.io/bbolt/bolt_arm.go delete mode 100644 vendor/go.etcd.io/bbolt/bolt_arm64.go delete mode 100644 vendor/go.etcd.io/bbolt/bolt_loong64.go delete mode 100644 vendor/go.etcd.io/bbolt/bolt_mips64x.go delete mode 100644 vendor/go.etcd.io/bbolt/bolt_mipsx.go delete mode 100644 vendor/go.etcd.io/bbolt/bolt_ppc.go delete mode 100644 vendor/go.etcd.io/bbolt/bolt_ppc64.go delete mode 100644 vendor/go.etcd.io/bbolt/bolt_ppc64le.go delete mode 100644 vendor/go.etcd.io/bbolt/bolt_riscv64.go delete mode 100644 vendor/go.etcd.io/bbolt/bolt_s390x.go create mode 100644 vendor/go.etcd.io/bbolt/internal/common/bolt_386.go create mode 100644 vendor/go.etcd.io/bbolt/internal/common/bolt_amd64.go create mode 100644 vendor/go.etcd.io/bbolt/internal/common/bolt_arm.go create mode 100644 vendor/go.etcd.io/bbolt/internal/common/bolt_arm64.go create mode 100644 vendor/go.etcd.io/bbolt/internal/common/bolt_loong64.go create mode 100644 vendor/go.etcd.io/bbolt/internal/common/bolt_mips64x.go create mode 100644 vendor/go.etcd.io/bbolt/internal/common/bolt_mipsx.go create mode 100644 vendor/go.etcd.io/bbolt/internal/common/bolt_ppc.go create mode 100644 vendor/go.etcd.io/bbolt/internal/common/bolt_ppc64.go create mode 100644 vendor/go.etcd.io/bbolt/internal/common/bolt_ppc64le.go create mode 100644 vendor/go.etcd.io/bbolt/internal/common/bolt_riscv64.go create mode 100644 vendor/go.etcd.io/bbolt/internal/common/bolt_s390x.go diff --git a/vendor.mod b/vendor.mod index 79b02424f2..659414665e 100644 --- a/vendor.mod +++ b/vendor.mod @@ -99,7 +99,7 @@ require ( github.com/vbatts/tar-split v0.12.1 github.com/vishvananda/netlink v1.3.1 github.com/vishvananda/netns v0.0.5 - go.etcd.io/bbolt v1.4.0 + go.etcd.io/bbolt v1.4.2 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 go.opentelemetry.io/contrib/processors/baggagecopy v0.4.0 diff --git a/vendor.sum b/vendor.sum index 9b4f21bde1..29c88c1ad6 100644 --- a/vendor.sum +++ b/vendor.sum @@ -601,8 +601,8 @@ github.com/zmap/zcrypto v0.0.0-20210511125630-18f1e0152cfc h1:zkGwegkOW709y0oiAr github.com/zmap/zcrypto v0.0.0-20210511125630-18f1e0152cfc/go.mod h1:FM4U1E3NzlNMRnSUTU3P1UdukWhYGifqEsjk9fn7BCk= github.com/zmap/zlint/v3 v3.1.0 h1:WjVytZo79m/L1+/Mlphl09WBob6YTGljN5IGWZFpAv0= github.com/zmap/zlint/v3 v3.1.0/go.mod h1:L7t8s3sEKkb0A2BxGy1IWrxt1ZATa1R4QfJZaQOD3zU= -go.etcd.io/bbolt v1.4.0 h1:TU77id3TnN/zKr7CO/uk+fBCwF2jGcMuw2B/FMAzYIk= -go.etcd.io/bbolt v1.4.0/go.mod h1:AsD+OCi/qPN1giOX1aiLAha3o1U8rAz65bvN4j0sRuk= +go.etcd.io/bbolt v1.4.2 h1:IrUHp260R8c+zYx/Tm8QZr04CX+qWS5PGfPdevhdm1I= +go.etcd.io/bbolt v1.4.2/go.mod h1:Is8rSHO/b4f3XigBC0lL0+4FwAQv3HXEEIgFMuKHceM= go.etcd.io/etcd/client/pkg/v3 v3.5.16 h1:ZgY48uH6UvB+/7R9Yf4x574uCO3jIx0TRDyetSfId3Q= go.etcd.io/etcd/client/pkg/v3 v3.5.16/go.mod h1:V8acl8pcEK0Y2g19YlOV9m9ssUe6MgiDSobSoaBAM0E= go.etcd.io/etcd/pkg/v3 v3.5.16 h1:cnavs5WSPWeK4TYwPYfmcr3Joz9BH+TZ6qoUtz6/+mc= diff --git a/vendor/go.etcd.io/bbolt/.go-version b/vendor/go.etcd.io/bbolt/.go-version index d8c40e539c..b6773170a5 100644 --- a/vendor/go.etcd.io/bbolt/.go-version +++ b/vendor/go.etcd.io/bbolt/.go-version @@ -1 +1 @@ -1.23.6 +1.23.10 diff --git a/vendor/go.etcd.io/bbolt/bolt_386.go b/vendor/go.etcd.io/bbolt/bolt_386.go deleted file mode 100644 index aee25960ff..0000000000 --- a/vendor/go.etcd.io/bbolt/bolt_386.go +++ /dev/null @@ -1,7 +0,0 @@ -package bbolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0x7FFFFFFF // 2GB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0xFFFFFFF diff --git a/vendor/go.etcd.io/bbolt/bolt_aix.go b/vendor/go.etcd.io/bbolt/bolt_aix.go index 4b424ed4c4..596e540602 100644 --- a/vendor/go.etcd.io/bbolt/bolt_aix.go +++ b/vendor/go.etcd.io/bbolt/bolt_aix.go @@ -9,6 +9,8 @@ import ( "unsafe" "golang.org/x/sys/unix" + + "go.etcd.io/bbolt/internal/common" ) // flock acquires an advisory lock on a file descriptor. @@ -69,7 +71,7 @@ func mmap(db *DB, sz int) error { // Save the original byte slice and convert to a byte array pointer. db.dataref = b - db.data = (*[maxMapSize]byte)(unsafe.Pointer(&b[0])) + db.data = (*[common.MaxMapSize]byte)(unsafe.Pointer(&b[0])) db.datasz = sz return nil } diff --git a/vendor/go.etcd.io/bbolt/bolt_amd64.go b/vendor/go.etcd.io/bbolt/bolt_amd64.go deleted file mode 100644 index 5dd8f3f2ae..0000000000 --- a/vendor/go.etcd.io/bbolt/bolt_amd64.go +++ /dev/null @@ -1,7 +0,0 @@ -package bbolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0xFFFFFFFFFFFF // 256TB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0x7FFFFFFF diff --git a/vendor/go.etcd.io/bbolt/bolt_android.go b/vendor/go.etcd.io/bbolt/bolt_android.go index 11890f0d70..ac64fcf5b2 100644 --- a/vendor/go.etcd.io/bbolt/bolt_android.go +++ b/vendor/go.etcd.io/bbolt/bolt_android.go @@ -7,6 +7,8 @@ import ( "unsafe" "golang.org/x/sys/unix" + + "go.etcd.io/bbolt/internal/common" ) // flock acquires an advisory lock on a file descriptor. @@ -69,7 +71,7 @@ func mmap(db *DB, sz int) error { // Save the original byte slice and convert to a byte array pointer. db.dataref = b - db.data = (*[maxMapSize]byte)(unsafe.Pointer(&b[0])) + db.data = (*[common.MaxMapSize]byte)(unsafe.Pointer(&b[0])) db.datasz = sz return nil } diff --git a/vendor/go.etcd.io/bbolt/bolt_arm.go b/vendor/go.etcd.io/bbolt/bolt_arm.go deleted file mode 100644 index aee25960ff..0000000000 --- a/vendor/go.etcd.io/bbolt/bolt_arm.go +++ /dev/null @@ -1,7 +0,0 @@ -package bbolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0x7FFFFFFF // 2GB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0xFFFFFFF diff --git a/vendor/go.etcd.io/bbolt/bolt_arm64.go b/vendor/go.etcd.io/bbolt/bolt_arm64.go deleted file mode 100644 index 2c67ab10cd..0000000000 --- a/vendor/go.etcd.io/bbolt/bolt_arm64.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build arm64 - -package bbolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0xFFFFFFFFFFFF // 256TB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0x7FFFFFFF diff --git a/vendor/go.etcd.io/bbolt/bolt_loong64.go b/vendor/go.etcd.io/bbolt/bolt_loong64.go deleted file mode 100644 index 1ef2145c67..0000000000 --- a/vendor/go.etcd.io/bbolt/bolt_loong64.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build loong64 - -package bbolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0xFFFFFFFFFFFF // 256TB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0x7FFFFFFF diff --git a/vendor/go.etcd.io/bbolt/bolt_mips64x.go b/vendor/go.etcd.io/bbolt/bolt_mips64x.go deleted file mode 100644 index f28a0512a1..0000000000 --- a/vendor/go.etcd.io/bbolt/bolt_mips64x.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build mips64 || mips64le - -package bbolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0x8000000000 // 512GB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0x7FFFFFFF diff --git a/vendor/go.etcd.io/bbolt/bolt_mipsx.go b/vendor/go.etcd.io/bbolt/bolt_mipsx.go deleted file mode 100644 index 708fccdc01..0000000000 --- a/vendor/go.etcd.io/bbolt/bolt_mipsx.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build mips || mipsle - -package bbolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0x40000000 // 1GB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0xFFFFFFF diff --git a/vendor/go.etcd.io/bbolt/bolt_ppc.go b/vendor/go.etcd.io/bbolt/bolt_ppc.go deleted file mode 100644 index 6a21cf33c7..0000000000 --- a/vendor/go.etcd.io/bbolt/bolt_ppc.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build ppc - -package bbolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0x7FFFFFFF // 2GB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0xFFFFFFF diff --git a/vendor/go.etcd.io/bbolt/bolt_ppc64.go b/vendor/go.etcd.io/bbolt/bolt_ppc64.go deleted file mode 100644 index a32f246228..0000000000 --- a/vendor/go.etcd.io/bbolt/bolt_ppc64.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build ppc64 - -package bbolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0xFFFFFFFFFFFF // 256TB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0x7FFFFFFF diff --git a/vendor/go.etcd.io/bbolt/bolt_ppc64le.go b/vendor/go.etcd.io/bbolt/bolt_ppc64le.go deleted file mode 100644 index 8fb60dddcb..0000000000 --- a/vendor/go.etcd.io/bbolt/bolt_ppc64le.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build ppc64le - -package bbolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0xFFFFFFFFFFFF // 256TB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0x7FFFFFFF diff --git a/vendor/go.etcd.io/bbolt/bolt_riscv64.go b/vendor/go.etcd.io/bbolt/bolt_riscv64.go deleted file mode 100644 index a63d26ab21..0000000000 --- a/vendor/go.etcd.io/bbolt/bolt_riscv64.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build riscv64 - -package bbolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0xFFFFFFFFFFFF // 256TB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0x7FFFFFFF diff --git a/vendor/go.etcd.io/bbolt/bolt_s390x.go b/vendor/go.etcd.io/bbolt/bolt_s390x.go deleted file mode 100644 index 749ea97e3a..0000000000 --- a/vendor/go.etcd.io/bbolt/bolt_s390x.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build s390x - -package bbolt - -// maxMapSize represents the largest mmap size supported by Bolt. -const maxMapSize = 0xFFFFFFFFFFFF // 256TB - -// maxAllocSize is the size used when creating array pointers. -const maxAllocSize = 0x7FFFFFFF diff --git a/vendor/go.etcd.io/bbolt/bolt_solaris.go b/vendor/go.etcd.io/bbolt/bolt_solaris.go index babad65786..56b2ccab47 100644 --- a/vendor/go.etcd.io/bbolt/bolt_solaris.go +++ b/vendor/go.etcd.io/bbolt/bolt_solaris.go @@ -7,6 +7,8 @@ import ( "unsafe" "golang.org/x/sys/unix" + + "go.etcd.io/bbolt/internal/common" ) // flock acquires an advisory lock on a file descriptor. @@ -67,7 +69,7 @@ func mmap(db *DB, sz int) error { // Save the original byte slice and convert to a byte array pointer. db.dataref = b - db.data = (*[maxMapSize]byte)(unsafe.Pointer(&b[0])) + db.data = (*[common.MaxMapSize]byte)(unsafe.Pointer(&b[0])) db.datasz = sz return nil } diff --git a/vendor/go.etcd.io/bbolt/bolt_unix.go b/vendor/go.etcd.io/bbolt/bolt_unix.go index d1922c2d99..f68e721f55 100644 --- a/vendor/go.etcd.io/bbolt/bolt_unix.go +++ b/vendor/go.etcd.io/bbolt/bolt_unix.go @@ -11,6 +11,7 @@ import ( "golang.org/x/sys/unix" "go.etcd.io/bbolt/errors" + "go.etcd.io/bbolt/internal/common" ) // flock acquires an advisory lock on a file descriptor. @@ -67,7 +68,7 @@ func mmap(db *DB, sz int) error { // Save the original byte slice and convert to a byte array pointer. db.dataref = b - db.data = (*[maxMapSize]byte)(unsafe.Pointer(&b[0])) + db.data = (*[common.MaxMapSize]byte)(unsafe.Pointer(&b[0])) db.datasz = sz return nil } diff --git a/vendor/go.etcd.io/bbolt/bolt_windows.go b/vendor/go.etcd.io/bbolt/bolt_windows.go index ec21ecb85c..e99a0d6215 100644 --- a/vendor/go.etcd.io/bbolt/bolt_windows.go +++ b/vendor/go.etcd.io/bbolt/bolt_windows.go @@ -10,6 +10,7 @@ import ( "golang.org/x/sys/windows" "go.etcd.io/bbolt/errors" + "go.etcd.io/bbolt/internal/common" ) // fdatasync flushes written data to a file descriptor. @@ -95,7 +96,7 @@ func mmap(db *DB, sz int) error { } // Convert to a byte array. - db.data = (*[maxMapSize]byte)(unsafe.Pointer(addr)) + db.data = (*[common.MaxMapSize]byte)(unsafe.Pointer(addr)) db.datasz = sz return nil diff --git a/vendor/go.etcd.io/bbolt/db.go b/vendor/go.etcd.io/bbolt/db.go index 5c1947e998..622947d9cb 100644 --- a/vendor/go.etcd.io/bbolt/db.go +++ b/vendor/go.etcd.io/bbolt/db.go @@ -125,7 +125,7 @@ type DB struct { // always fails on Windows platform. //nolint dataref []byte // mmap'ed readonly, write throws SEGV - data *[maxMapSize]byte + data *[common.MaxMapSize]byte datasz int meta0 *common.Meta meta1 *common.Meta @@ -563,7 +563,7 @@ func (db *DB) mmapSize(size int) (int, error) { } // Verify the requested size is not above the maximum allowed. - if size > maxMapSize { + if size > common.MaxMapSize { return 0, errors.New("mmap too large") } @@ -581,8 +581,8 @@ func (db *DB) mmapSize(size int) (int, error) { } // If we've exceeded the max size then only grow up to the max size. - if sz > maxMapSize { - sz = maxMapSize + if sz > common.MaxMapSize { + sz = common.MaxMapSize } return int(sz), nil @@ -1080,7 +1080,7 @@ func safelyCall(fn func(*Tx) error, tx *Tx) (err error) { // then it allows you to force the database file to sync against the disk. func (db *DB) Sync() (err error) { if lg := db.Logger(); lg != discardLogger { - lg.Debug("Syncing bbolt db (%s)", db.path) + lg.Debugf("Syncing bbolt db (%s)", db.path) defer func() { if err != nil { lg.Errorf("[GOOS: %s, GOARCH: %s] syncing bbolt db (%s) failed: %v", runtime.GOOS, runtime.GOARCH, db.path, err) @@ -1309,6 +1309,12 @@ type Options struct { // If <=0, the initial map size is 0. // If initialMmapSize is smaller than the previous database size, // it takes no effect. + // + // Note: On Windows, due to platform limitations, the database file size + // will be immediately resized to match `InitialMmapSize` (aligned to page size) + // when the DB is opened. On non-Windows platforms, the file size will grow + // dynamically based on the actual amount of written data, regardless of `InitialMmapSize`. + // Refer to https://github.com/etcd-io/bbolt/issues/378#issuecomment-1378121966. InitialMmapSize int // PageSize overrides the default OS page size. diff --git a/vendor/go.etcd.io/bbolt/internal/common/bolt_386.go b/vendor/go.etcd.io/bbolt/internal/common/bolt_386.go new file mode 100644 index 0000000000..773175de3a --- /dev/null +++ b/vendor/go.etcd.io/bbolt/internal/common/bolt_386.go @@ -0,0 +1,7 @@ +package common + +// MaxMapSize represents the largest mmap size supported by Bolt. +const MaxMapSize = 0x7FFFFFFF // 2GB + +// MaxAllocSize is the size used when creating array pointers. +const MaxAllocSize = 0xFFFFFFF diff --git a/vendor/go.etcd.io/bbolt/internal/common/bolt_amd64.go b/vendor/go.etcd.io/bbolt/internal/common/bolt_amd64.go new file mode 100644 index 0000000000..9f27d91991 --- /dev/null +++ b/vendor/go.etcd.io/bbolt/internal/common/bolt_amd64.go @@ -0,0 +1,7 @@ +package common + +// MaxMapSize represents the largest mmap size supported by Bolt. +const MaxMapSize = 0xFFFFFFFFFFFF // 256TB + +// MaxAllocSize is the size used when creating array pointers. +const MaxAllocSize = 0x7FFFFFFF diff --git a/vendor/go.etcd.io/bbolt/internal/common/bolt_arm.go b/vendor/go.etcd.io/bbolt/internal/common/bolt_arm.go new file mode 100644 index 0000000000..773175de3a --- /dev/null +++ b/vendor/go.etcd.io/bbolt/internal/common/bolt_arm.go @@ -0,0 +1,7 @@ +package common + +// MaxMapSize represents the largest mmap size supported by Bolt. +const MaxMapSize = 0x7FFFFFFF // 2GB + +// MaxAllocSize is the size used when creating array pointers. +const MaxAllocSize = 0xFFFFFFF diff --git a/vendor/go.etcd.io/bbolt/internal/common/bolt_arm64.go b/vendor/go.etcd.io/bbolt/internal/common/bolt_arm64.go new file mode 100644 index 0000000000..9022f6bca0 --- /dev/null +++ b/vendor/go.etcd.io/bbolt/internal/common/bolt_arm64.go @@ -0,0 +1,9 @@ +//go:build arm64 + +package common + +// MaxMapSize represents the largest mmap size supported by Bolt. +const MaxMapSize = 0xFFFFFFFFFFFF // 256TB + +// MaxAllocSize is the size used when creating array pointers. +const MaxAllocSize = 0x7FFFFFFF diff --git a/vendor/go.etcd.io/bbolt/internal/common/bolt_loong64.go b/vendor/go.etcd.io/bbolt/internal/common/bolt_loong64.go new file mode 100644 index 0000000000..31277523c9 --- /dev/null +++ b/vendor/go.etcd.io/bbolt/internal/common/bolt_loong64.go @@ -0,0 +1,9 @@ +//go:build loong64 + +package common + +// MaxMapSize represents the largest mmap size supported by Bolt. +const MaxMapSize = 0xFFFFFFFFFFFF // 256TB + +// MaxAllocSize is the size used when creating array pointers. +const MaxAllocSize = 0x7FFFFFFF diff --git a/vendor/go.etcd.io/bbolt/internal/common/bolt_mips64x.go b/vendor/go.etcd.io/bbolt/internal/common/bolt_mips64x.go new file mode 100644 index 0000000000..d930f4eddb --- /dev/null +++ b/vendor/go.etcd.io/bbolt/internal/common/bolt_mips64x.go @@ -0,0 +1,9 @@ +//go:build mips64 || mips64le + +package common + +// MaxMapSize represents the largest mmap size supported by Bolt. +const MaxMapSize = 0x8000000000 // 512GB + +// MaxAllocSize is the size used when creating array pointers. +const MaxAllocSize = 0x7FFFFFFF diff --git a/vendor/go.etcd.io/bbolt/internal/common/bolt_mipsx.go b/vendor/go.etcd.io/bbolt/internal/common/bolt_mipsx.go new file mode 100644 index 0000000000..8b1934368b --- /dev/null +++ b/vendor/go.etcd.io/bbolt/internal/common/bolt_mipsx.go @@ -0,0 +1,9 @@ +//go:build mips || mipsle + +package common + +// MaxMapSize represents the largest mmap size supported by Bolt. +const MaxMapSize = 0x40000000 // 1GB + +// MaxAllocSize is the size used when creating array pointers. +const MaxAllocSize = 0xFFFFFFF diff --git a/vendor/go.etcd.io/bbolt/internal/common/bolt_ppc.go b/vendor/go.etcd.io/bbolt/internal/common/bolt_ppc.go new file mode 100644 index 0000000000..a374e1406e --- /dev/null +++ b/vendor/go.etcd.io/bbolt/internal/common/bolt_ppc.go @@ -0,0 +1,9 @@ +//go:build ppc + +package common + +// MaxMapSize represents the largest mmap size supported by Bolt. +const MaxMapSize = 0x7FFFFFFF // 2GB + +// MaxAllocSize is the size used when creating array pointers. +const MaxAllocSize = 0xFFFFFFF diff --git a/vendor/go.etcd.io/bbolt/internal/common/bolt_ppc64.go b/vendor/go.etcd.io/bbolt/internal/common/bolt_ppc64.go new file mode 100644 index 0000000000..80288a83a2 --- /dev/null +++ b/vendor/go.etcd.io/bbolt/internal/common/bolt_ppc64.go @@ -0,0 +1,9 @@ +//go:build ppc64 + +package common + +// MaxMapSize represents the largest mmap size supported by Bolt. +const MaxMapSize = 0xFFFFFFFFFFFF // 256TB + +// MaxAllocSize is the size used when creating array pointers. +const MaxAllocSize = 0x7FFFFFFF diff --git a/vendor/go.etcd.io/bbolt/internal/common/bolt_ppc64le.go b/vendor/go.etcd.io/bbolt/internal/common/bolt_ppc64le.go new file mode 100644 index 0000000000..77561d6872 --- /dev/null +++ b/vendor/go.etcd.io/bbolt/internal/common/bolt_ppc64le.go @@ -0,0 +1,9 @@ +//go:build ppc64le + +package common + +// MaxMapSize represents the largest mmap size supported by Bolt. +const MaxMapSize = 0xFFFFFFFFFFFF // 256TB + +// MaxAllocSize is the size used when creating array pointers. +const MaxAllocSize = 0x7FFFFFFF diff --git a/vendor/go.etcd.io/bbolt/internal/common/bolt_riscv64.go b/vendor/go.etcd.io/bbolt/internal/common/bolt_riscv64.go new file mode 100644 index 0000000000..2a876e5f77 --- /dev/null +++ b/vendor/go.etcd.io/bbolt/internal/common/bolt_riscv64.go @@ -0,0 +1,9 @@ +//go:build riscv64 + +package common + +// MaxMapSize represents the largest mmap size supported by Bolt. +const MaxMapSize = 0xFFFFFFFFFFFF // 256TB + +// MaxAllocSize is the size used when creating array pointers. +const MaxAllocSize = 0x7FFFFFFF diff --git a/vendor/go.etcd.io/bbolt/internal/common/bolt_s390x.go b/vendor/go.etcd.io/bbolt/internal/common/bolt_s390x.go new file mode 100644 index 0000000000..982cb7558b --- /dev/null +++ b/vendor/go.etcd.io/bbolt/internal/common/bolt_s390x.go @@ -0,0 +1,9 @@ +//go:build s390x + +package common + +// MaxMapSize represents the largest mmap size supported by Bolt. +const MaxMapSize = 0xFFFFFFFFFFFF // 256TB + +// MaxAllocSize is the size used when creating array pointers. +const MaxAllocSize = 0x7FFFFFFF diff --git a/vendor/go.etcd.io/bbolt/internal/common/types.go b/vendor/go.etcd.io/bbolt/internal/common/types.go index 8ad8279a09..18d6d69c2e 100644 --- a/vendor/go.etcd.io/bbolt/internal/common/types.go +++ b/vendor/go.etcd.io/bbolt/internal/common/types.go @@ -17,9 +17,6 @@ const Magic uint32 = 0xED0CDAED const PgidNoFreelist Pgid = 0xffffffffffffffff -// DO NOT EDIT. Copied from the "bolt" package. -const pageMaxAllocSize = 0xFFFFFFF - // IgnoreNoSync specifies whether the NoSync field of a DB is ignored when // syncing changes to a file. This is required as some operating systems, // such as OpenBSD, do not have a unified buffer cache (UBC) and writes diff --git a/vendor/go.etcd.io/bbolt/internal/common/unsafe.go b/vendor/go.etcd.io/bbolt/internal/common/unsafe.go index 9b77dd7b2b..740ffc7076 100644 --- a/vendor/go.etcd.io/bbolt/internal/common/unsafe.go +++ b/vendor/go.etcd.io/bbolt/internal/common/unsafe.go @@ -23,5 +23,5 @@ func UnsafeByteSlice(base unsafe.Pointer, offset uintptr, i, j int) []byte { // index 0. However, the wiki never says that the address must be to // the beginning of a C allocation (or even that malloc was used at // all), so this is believed to be correct. - return (*[pageMaxAllocSize]byte)(UnsafeAdd(base, offset))[i:j:j] + return (*[MaxAllocSize]byte)(UnsafeAdd(base, offset))[i:j:j] } diff --git a/vendor/go.etcd.io/bbolt/tx.go b/vendor/go.etcd.io/bbolt/tx.go index 7b5db77278..7123ded8fe 100644 --- a/vendor/go.etcd.io/bbolt/tx.go +++ b/vendor/go.etcd.io/bbolt/tx.go @@ -495,8 +495,8 @@ func (tx *Tx) write() error { // Write out page in "max allocation" sized chunks. for { sz := rem - if sz > maxAllocSize-1 { - sz = maxAllocSize - 1 + if sz > common.MaxAllocSize-1 { + sz = common.MaxAllocSize - 1 } buf := common.UnsafeByteSlice(unsafe.Pointer(p), written, 0, int(sz)) @@ -561,10 +561,13 @@ func (tx *Tx) writeMeta() error { tx.meta.Write(p) // Write the meta page to file. + tx.db.metalock.Lock() if _, err := tx.db.ops.writeAt(buf, int64(p.Id())*int64(tx.db.pageSize)); err != nil { + tx.db.metalock.Unlock() lg.Errorf("writeAt failed, pgid: %d, pageSize: %d, error: %v", p.Id(), tx.db.pageSize, err) return err } + tx.db.metalock.Unlock() if !tx.db.NoSync || common.IgnoreNoSync { // gofail: var beforeSyncMetaPage struct{} if err := fdatasync(tx.db); err != nil { diff --git a/vendor/modules.txt b/vendor/modules.txt index 67f7c13946..ba22a4ebe9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1247,7 +1247,7 @@ github.com/zmap/zlint/v3/lints/etsi github.com/zmap/zlint/v3/lints/mozilla github.com/zmap/zlint/v3/lints/rfc github.com/zmap/zlint/v3/util -# go.etcd.io/bbolt v1.4.0 +# go.etcd.io/bbolt v1.4.2 ## explicit; go 1.23 go.etcd.io/bbolt go.etcd.io/bbolt/errors