52 Commits
Author SHA1 Message Date
Tonis Tiigi fac7926881 update generated proto
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-08-26 02:06:18 -07:00
Jiří Moravčík e9b8ad2940 lint: enable usetesting linter
Enable the usetesting linter with context-background and context-todo
checks, and update tests to use t.Context() and t.TempDir() instead of
context.Background(), context.TODO(), and os.MkdirTemp().

Signed-off-by: Jiří Moravčík <jiri.moravcik@gmail.com>
2026-08-16 23:09:01 +02:00
Matthieu MOREL 5a96f64d01 Refactor error handling to use errors.New for consistency
- Updated multiple instances across various files to replace errors.Errorf with errors.New for error message creation.
- This change enhances consistency in error handling throughout the codebase.

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2026-08-07 10:13:54 +02:00
Tonis Tiigi cdb7d70861 Update patch dependencies
Bump patch-level dependencies while leaving
packageurl-go unchanged. This updates AWS config/credentials,
smithy-go, klauspost/compress, and sigstore-go, with required
companion bumps from their module constraints.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-07-21 22:24:51 -07:00
CrazyMax e4d0dbaf3f chore: update generated files
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-06-12 09:44:45 +02:00
Sebastiaan van Stijn 94dcaca630 update protoc to v3.14.0
Updating to the lowest release that includes [protobuf@dfab275], which
removed use of the github.com/golang/protobuf/ptypes/timestamp.Timestamp
type alias (deprecated).

[protobuf@dfab275]: https://github.com/protocolbuffers/protobuf/commit/dfab275eca9481b5de31122db6fc91b31db3382a

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-06-05 18:01:59 +02:00
Tonis Tiigi bd3608ddc9 lint: update golangci-lint to v2.12.2
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>
2026-05-14 10:13:15 -07:00
Tonis Tiigi 70b363e54c session: fail stuck session RPCs on health timeout
Bind session RPC contexts to caller lifetime so ongoing RPCs fail when the
session is canceled. Add an integration test that blocks the session tunnel
and verifies the health monitor releases the hung build after timeout.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-04-02 23:29:16 -07:00
CrazyMax 18ad342e57 Merge pull request #6460 from tonistiigi/golint-v2.8.0-update
hack: golangci v2.8.0 and gopls v0.38.0 update
2026-01-14 15:44:19 +01:00
Tonis Tiigi a8b83196f3 ci: update golangci to v2.8.0
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-13 22:09:20 -08:00
Tonis Tiigi ddeb26c5e1 vendor: update outdated patch versions of dependencies
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-13 22:08:15 -08:00
Tonis Tiigi 09426caaae vendor: update containerd to v2.2.0-rc.0
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-11-03 11:11:53 -08:00
Jonathan A. Sternberg f4339fd00b tools: utilize the new tool functionality introduced in go 1.24
Removes the `tools/tools.go` file used as a hack to get `go.mod` to
track tools in favor of the new method introduced in go 1.24 of being
formally supported in the `go.mod` file. This will allow the tools to be
managed with the new `go get tool` and `go install tool` commands.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-09-10 10:08:03 -05:00
Brian Goff c39de5e6fa Remove intermediate type RawConfig
This is not needed since we are not exporting the the underlying raw
provider.
Instead just convert the AgentConfig directly to a dialer.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2025-06-03 09:03:12 -07:00
Brian Goff 96447a83e2 Add support for raw mode in the SSH agent provider.
In fraw mode it just does a raw proxy on the connection.
There's no internal SSH agent or anything.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2025-06-03 09:03:07 -07:00
Brian Goff 125f494a36 sshforward: Add support for forwarding raw connections
This commit implements a new SSH provider in terms of ID and dialer
functions and then implements the existing SSH provider using this.

None of the SSH connection string parsing is updated to specifically
support fraw mode. This will be handled in a follow-up commit.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2025-06-02 09:31:41 -07:00
Tonis Tiigi 9a5dff09b5 vendor: update to containerd v2.1.1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-21 09:09:33 -06:00
Tonis Tiigi 1e512a15c3 lint: add fatcontext
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-02 12:19:22 -07:00
Tonis Tiigi c6a1dcd6b5 lint: correcting errorlint and some err113 cases
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-05-02 12:19:22 -07:00
Tonis Tiigi b5286f8dcb apply x/tools/modernize fixes
Autogenerated with couple of manual patches.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-03-07 08:18:45 -08:00
Sebastiaan van Stijn d709e4bb1c vendor: google.golang.org/protobuf v1.35.2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-14 14:03:31 +01:00
Marat Radchenko 0a5a80cfec Remove pre-Go 1.17 build tags
Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
2024-11-21 10:58:27 +03:00
Tonis Tiigi c9a25c4d8a pb: regenerate protobuf
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-10-28 12:56:03 -07:00
Jonathan A. Sternberg 41a0a0c37d protobuf: add vtproto as a supplemental marshaler
vtproto is an extra protobuf compiler that generates special methods
suffixed with `VT` that create typed and unrolled marshal and unmarshal
functions similar to gogo that can be used for performance sensitive
code. These extensions are optional for code to use but buildkit uses
them.

A codec is also included to utilize vtproto for grpc code. If the
package `github.com/moby/buildkit/util/grpcutil/encoding/proto` is
imported then vtproto will be used if it exists and otherwise it will
use the standard marshaling and unmarshaling methods.

This codec has an important difference from the default codec. The
default codec will always reset messages before unmarshaling. In most
cases, this is unnecessary and is only relevant for `RecvMsg` on
streams. In most cases, if we are passing in an existing message to this
method, we want to reuse the buffers. This codec will always merge the
message when unmarshaling instead of resetting the input message.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-10-04 12:52:15 -05:00
Jonathan A. Sternberg ffd8ff490e protobuf: normalize how protobuf files are generated
The relative paths option for protoc generators doesn't work well when
it comes to dependencies. This simplifies the code generation to avoid
using `go generate` and to use one global command for protoc generation.

This is similar to https://github.com/docker/buildx/pull/2713 since the
same problems with code generation occur here too.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-10-03 17:40:53 -05:00
Jonathan A. Sternberg 1a3fc0aa15 protobuf: remove gogoproto
Remove gogoproto in favor of the standard protobuf compiler. This
removes any nonstandard extensions that were part of gogoproto such as
the custom types.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2024-09-26 12:57:45 -05:00
guoguangwu b94bdb0bbc fix: close files in the toAgentSource func
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
2024-04-26 09:50:24 +08:00
Tonis Tiigi 1f9988911f lint: unusedparams fixes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-04-09 07:23:16 -07:00
Tonis Tiigi 8a2a3e83ec replace context.WithCancel with WithCancelCause
Keep stack traces for cancellation errors where possible.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2023-12-06 22:15:06 -08:00
Erik Sipsma 30ea41976d ssh: add fallback to ensure conn is closed in all cases.
Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2023-05-07 15:09:06 -07:00
Aaron Lehmann 8c978cf909 Propagate sshforward send side connection close
PR #3431 caused connections closed on the remote side of a sshforward
session to not always result in the local side reading an EOF from the
connection. This change restores that behavior by closing the write side
of the forwarded connection after reading an EOF from the stream. Since
only the write side is being closed, it doesn't prevent the remote side
from continuing to read from the connection.

Signed-off-by: Aaron Lehmann <alehmann@netflix.com>
2023-01-13 21:39:15 -08:00
Erik Sipsma eb9e2c974c sshforward: skip conn close on stream CloseSend.
The GRPC docs on RecvMsg say:
> RecvMsg blocks until it receives a message into m or the stream is
> done. It returns io.EOF when the client has performed a CloseSend.
> On any non-EOF error, the stream is aborted and the error contains
> the RPC status.

So if EOF is received that just means the client won't be sending
anymore data. But it may still be expecting to read data, so we
shouldn't close the conn yet.

This was encountered in real life when forwarding a docker socket to a
container, where it appears that the docker CLI closes its write side of
the connection when requesting the stdout/stderr but then expects to
read data after that.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2022-12-21 11:30:11 -08:00
Sebastiaan van Stijn d7cdc0af92 session/sshforward: remove use of obsolete golang.org/x/net/context pkg
This package is an alias for "context", which has been part of
stdlib since go1.7, so should no longer be needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-08 03:05:13 +01:00
Sebastiaan van Stijn 21e9e9641e Remove uses of deprecated io/ioutil
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-10 00:57:07 +01:00
CrazyMax 54b8ff2fc8 go fmt: add //go:build
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-10-28 13:26:43 +02:00
Siebe Schaap c9a5f8893f Fix regular expression to test for Windows named pipe in SSH agent path; allowed backslashes in host.
Signed-off-by: Siebe Schaap <siebe@digibites.nl>
2021-05-27 20:40:43 +02:00
Siebe Schaap f3bdb4a784 Rename SSH agent forwarding helper parsePlatformSocketPath() to getWindowsPipeDialer().
Signed-off-by: Siebe Schaap <siebe@digibites.nl>
2021-05-27 20:40:43 +02:00
Siebe Schaap 146ea468c9 Update Windows named pipe handling for SSH forwarding to use x/sys/windows rather than syscall.
Signed-off-by: Siebe Schaap <siebe@digibites.nl>
2021-05-27 20:40:43 +02:00
Siebe Schaap dbbe65baec Update SSH agent socket handling to support Windows OpenSSH using named pipes.
Signed-off-by: Siebe Schaap <siebe@digibites.nl>
2021-05-27 20:40:43 +02:00
Akihiro Suda 13ea18ad08 vendor containerd (requred for rootless overlayfs on kernel 5.11)
Required for rootless overlayfs on kernel 5.11
https://github.com/containerd/containerd/pull/5076

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-03-10 13:51:27 +09:00
Nick Santos 399dacf410 sshprovider: on Windows, ModeSocket might not be set on the ssh socket
Fixes https://github.com/moby/buildkit/issues/914

Signed-off-by: Nick Santos <nicholas.j.santos@gmail.com>
2020-09-22 19:42:38 -04:00
Tonis Tiigi bd3354fea3 session: avoid deprecated grpc.Stream type
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2020-07-19 09:28:36 -07:00
Akihiro Suda 7b579cdb98 vendor: update containerd (and various packages)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-02-28 10:24:10 +09:00
Troels Liebe Bentsen 9c70fb9927 Disallow Extensions for now
Signed-off-by: Troels Liebe Bentsen <tlb@nversion.dk>
2019-11-21 21:57:04 +01:00
Troels Liebe Bentsen 4e7904f37e Inherit extended agent so we get modern sign hashes
Signed-off-by: Troels Liebe Bentsen <tlb@nversion.dk>
2019-11-20 00:15:51 +01:00
Tonis Tiigi 307bdc3c3d exec: fix mount options on userns remapping
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-10-29 14:20:40 -07:00
Tonis Tiigi bc3a1eefdd session: release forwarded ssh socket connection per connection
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-08-26 15:34:55 -07:00
Tonis Tiigi d3597181e0 session: wrap errors with debug info
Make sure to cover the grpc errors origins.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-06-06 21:15:21 -07:00
Tonis Tiigi 632797cef0 vendor: udpate fsutil to b4281fa
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2019-03-05 17:34:01 -08:00
Tonis Tiigi 0940cdc6fe update golint comments
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-09-18 22:06:47 -07:00