cache/manager.go:238:3: G118: Goroutine uses context.Background/TODO while request-scoped context is available (gosec)
go link.Release(context.TODO())
^
cache/refs.go:1519:2: G118: Goroutine uses context.Background/TODO while request-scoped context is available (gosec)
go func() {
^
session/testutil/testutil.go:22:3: G118: Goroutine uses context.Background/TODO while request-scoped context is available (gosec)
go func() {
^
solver/edge.go:975:4: G118: Goroutine uses context.Background/TODO while request-scoped context is available (gosec)
go results[i].Release(context.TODO())
^
util/leaseutil/manager.go:79:2: G118: Goroutine uses context.Background/TODO while request-scoped context is available (gosec)
go l.Discard()
^
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Update golangci-lint and adjust code for new gosec diagnostics. Use
root-scoped filesystem operations where appropriate, preserve explicit
user path behavior for SSH keys, and avoid background contexts in
request-scoped cleanup paths.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Switch to use github.com/containerd/platforms module, because containerd's
platforms package has moved to a separate module. This allows updating the
platforms parsing independent of the containerd module itself.
The package in containerd is deprecated, but kept as an alias to provide
compatibility between codebases.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Update to containerd 1.7.18, which now migrated to the errdefs module. The
existing errdefs package is now an alias for the module, and should no longer
be used directly.
This patch:
- updates the containerd dependency: https://github.com/containerd/containerd/compare/v1.7.17...v1.7.18
- replaces uses of the old package in favor of the new module
- adds a linter check to prevent accidental re-introduction of the old package
- adds a linter check to enforce using an alias, to prevent accidental use
of the errdefs package in BuildKit or Moby.
- adds a linter check to prevent using the "log" package, which was also
migrated to a separate module.
There are still some uses of the old package in (indirect) dependencies,
which should go away over time.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Dedupe the several "containerd.io/uncompressed" constants and literals
into `github.com/containerd/containerd/labels.LabelUncompressed`
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
There's a context which gets recreated via
ctx = context.TODO()
which races with
go func() {
<-ctx.Done()
ticker.Stop()
}()
To prevent this, the original context reference should be passed in via an arg.
Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
Before this change buildkit was changing the media type for
non-distributable layers to normal layers.
It was also clearing out the urls to get those blobs.
Now the layer mediatype and URL's are preserved.
If a layer blob is seen more than once, if it has extra URL's they will
be appended to the stored value.
On export there is now a new exporter option to preserve the
non-distributable data values.
All URL's seen by buildkit will be added to the exported content.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
The previous implementation had many issues. Eg. on fetch, even if
the data already existed and no remote connections were needed
the request would still be waiting in the queue. Or if two fetches
of same blob happened together they would take up two places in queue
although there was only one remote request.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This is a safer alternative until we figure out why
http.Transport based limiting fails.
Some connections like cache export/import do not have a
domain key atm and these connections use global pool.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>