Skip to content

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Sep 24, 2025

backport:

How I did it
Add support to the cli/command package to accept a custom User
Agent to pass to the underlying client.

This is used as the UpstreamClient portion of the User-Agent
when the Moby daemon makes requests.

For example, pushing and pulling images with Compose might result
in the registry seeing a User-Agent value of:

docker/24.0.7 go/go1.20.10 git-commit/311b9ff kernel/6.5.13-linuxkit os/linux arch/arm64 UpstreamClient(docker-cli-plugin-compose/v2.24.0)

See also:

- How to verify it
Build a CLI plugin against latest HEAD, update its SchemaVersion to 0.2.0, and inspect network traffic.

- Description for the changelog

Go SDK: cli/command: add `WithUserAgent` option

- A picture of a cute animal (not mandatory but encouraged)
several baby skunks with bushy tails

@thaJeztah thaJeztah added this to the 28.4.1 milestone Sep 24, 2025
@thaJeztah thaJeztah added impact/changelog kind/enhancement status/2-code-review area/plugins area/go-sdk Changes affecting the Go SDK impact/go-sdk Noteworthy (compatibility changes) in the Go SDK labels Sep 24, 2025
@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2025

Codecov Report

❌ Patch coverage is 69.23077% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cli/command/cli_options.go 57.14% 2 Missing and 1 partial ⚠️
cli/command/cli.go 83.33% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@thaJeztah thaJeztah force-pushed the 28.x_backport_cli_user_agent branch 2 times, most recently from 8c7a931 to 8e94b32 Compare September 24, 2025 15:46
@vvoland vvoland marked this pull request as ready for review September 24, 2025 17:16
Add support to the `cli/command` package to accept a custom User
Agent to pass to the underlying client.

This is used as the `UpstreamClient` portion of the `User-Agent`
when the Moby daemon makes requests.

For example, pushing and pulling images with Compose might result
in the registry seeing a `User-Agent` value of:

```
docker/24.0.7 go/go1.20.10 git-commit/311b9ff kernel/6.5.13-linuxkit os/linux arch/arm64 UpstreamClient(docker-cli-plugin-compose/v2.24.0)
```

Signed-off-by: Milas Bowman <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 048e931)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Paweł Gronowski <[email protected]>
@vvoland vvoland force-pushed the 28.x_backport_cli_user_agent branch from 8e94b32 to 985cee2 Compare September 24, 2025 17:18
@austinvazquez austinvazquez merged commit 843153d into docker:28.x Sep 24, 2025
88 of 93 checks passed
@thaJeztah thaJeztah deleted the 28.x_backport_cli_user_agent branch September 24, 2025 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/go-sdk Changes affecting the Go SDK area/plugins impact/changelog impact/go-sdk Noteworthy (compatibility changes) in the Go SDK kind/enhancement status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants