moby/dockerversion
Sebastiaan van Stijn 66dfc0169f
dockerversion: DockerUserAgent(): use sync.Once to construct User-Agent
The User-Agent includes the kernel version, which involves making a syscall
(and parsing the results) on Linux, and reading (plus parsing) the registry
on Windows. These operations are relatively costly, and we should not perform
those on every request that uses the User-Agent.

This patch adds a sync.Once so that we only perform these actions once for
the lifetime of the daemon's process.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-03-22 15:35:59 +01:00
..
useragent.go dockerversion: DockerUserAgent(): use sync.Once to construct User-Agent 2023-03-22 15:35:59 +01:00
version_lib.go IAmStatic not used anymore 2023-01-01 18:03:02 +01:00