-
Notifications
You must be signed in to change notification settings - Fork 18.9k
containerd-integration: set correct user-agent #44828
Description
Description
The containerd-integration currently uses containerd's user-agent (containerd/$VERSION) as user-agent. We should change the user-agent to match the pre-containerd integration user-agent;
- include "upstream" user-agents
- include information about the engine
- TBD: is the containerd version relevant? It's the containerd client version that's currently included, not the containerd daemon version. Perhaps the client version should be considered an implementation detail (it's a build-time dependency / module used by the engine).
- We should have something indicating that it's an engine with the containerd-integration enabled (to distinguish from "non-snapshotter" / "non-containerd-integration"
From a slack thread;
user-agent can be customised when using the containerd client code; https://github.com/containerd/containerd/blob/cf13b64bcb833ab5b5bbaa8b4ce75c6fd9556eed/remotes/docker/resolver.go#L144-L146
PRs and code related to "upstream" client (used for non-containerd integration);
- Pass upstream client's user agent through to registry on image pulls #21306
- Pass upstream client's user agent through to registry on operations beyond pulls #21373
moby/dockerversion/useragent.go
Lines 74 to 78 in 62296f9
func insertUpstreamUserAgent(upstreamUA string, dockerUA string) string { charsToEscape := `();\` upstreamUAEscaped := escapeStr(upstreamUA, charsToEscape) return fmt.Sprintf("%s UpstreamClient(%s)", dockerUA, upstreamUAEscaped) }
For the non-containerd daemon, the user-agent looks like;
docker/23.0.0-rc.2 go/go1.19.4 git-commit/9fd3a43 kernel/5.15.0-50-generic os/linux arch/amd64 UpstreamClient(Docker-Client/23.0.0-rc.2 \x5C(linux\x5C))
Which includes;
- version of the daemon,
- go version
- kernel version
- platform
Version of the CLI (Client) is included in that as UpstreamClient;
UpstreamClient(Docker-Client/23.0.0-rc.2 \x5C(linux\x5C))
We can continue using the same approach, either;
- include the docker daemon as an “UpstreamClient”, and containerd as client
- although as containerd in this case is effectively the containerd client compiled into the docker engine, we could consider using just the docker engine version (but perhaps with an addition to the string to indicate “with containerd integration”)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status