-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add containerd, runc, and docker-init versions to /version #37974
Conversation
Follow-up to #37968, but I'm still tweaking some things, and need to update the API changelog; just pushing as a WIP, so that we can discuss already |
ping^^ @thaJeztah |
556785b
to
c88553e
Compare
@AkihiroSuda updated |
c88553e
to
d200086
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🐯
Ah, boo; linting error;
@vdemeester @AkihiroSuda wondering; should I truncate the git-commit to a shorter value, or leave it as-is, and leave it to the packaging of containerd/runc to decide if they show a short or long commit-sha? (not sure what length is "safe" to truncate to);
|
d200086
to
7d02782
Compare
daemon/info_unix.go
Outdated
|
||
defaultInitBinary := daemon.configStore.GetInitPath() | ||
if rv, err := exec.Command(defaultInitBinary, "--version").Output(); err == nil { | ||
if ver, err := parseInitVersion(string(rv)); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, let me update the parseInitVersion()
(or write a different function for this), so that we can show the version as well, not just the commit;
./docker-init --version
tini version 0.18.0 - git.fec3683
I think it is safe to keep full comnit |
OK, I'll leave the commits as-is, but working on the tini/docker-init version to show both version and commit (as it's a bit more user friendly to show that) |
7d02782
to
e7ee176
Compare
Codecov Report
@@ Coverage Diff @@
## master #37974 +/- ##
=========================================
Coverage ? 36.6%
=========================================
Files ? 608
Lines ? 45221
Branches ? 0
=========================================
Hits ? 16552
Misses ? 26382
Partials ? 2287 |
Updated; output now shows
|
e7ee176
to
6df6924
Compare
} | ||
} | ||
if version.ID == "" && strings.HasPrefix(parts[0], "tini version ") { | ||
version.ID = "v" + strings.TrimPrefix(parts[0], "tini version ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dropped the v
prefix. Looking at this again, I don't think we should modify versions that are returned by an external binary, and just return it as-is
SGTM |
6df6924
to
56f9283
Compare
rebased to get a fresh CI run |
This patch adds version information about the containerd, runc, and docker-init components to the /version endpoint. With this patch applied, running: ``` curl --unix-socket /var/run/docker.sock http://localhost/version | jq . ``` Will produce this response: ```json { "Platform": { "Name": "" }, "Components": [ { "Name": "Engine", "Version": "dev", "Details": { "ApiVersion": "1.40", "Arch": "amd64", "BuildTime": "2018-11-08T10:23:42.000000000+00:00", "Experimental": "false", "GitCommit": "7d02782d2f", "GoVersion": "go1.11.2", "KernelVersion": "4.9.93-linuxkit-aufs", "MinAPIVersion": "1.12", "Os": "linux" } }, { "Name": "containerd", "Version": "v1.1.4", "Details": { "GitCommit": "9f2e07b1fc1342d1c48fe4d7bbb94cb6d1bf278b" } }, { "Name": "runc", "Version": "1.0.0-rc5+dev", "Details": { "GitCommit": "a00bf0190895aa465a5fbed0268888e2c8ddfe85" } }, { "Name": "docker-init", "Version": "0.18.0", "Details": { "GitCommit": "fec3683" } } ], "Version": "dev", "ApiVersion": "1.40", "MinAPIVersion": "1.12", "GitCommit": "7d02782d2f", "GoVersion": "go1.11.2", "Os": "linux", "Arch": "amd64", "KernelVersion": "4.9.93-linuxkit-aufs", "BuildTime": "2018-11-08T10:23:42.000000000+00:00" } ``` When using a recent version of the CLI, that information is included in the output of `docker version`: ``` Client: Docker Engine - Community Version: 18.09.0 API version: 1.39 Go version: go1.10.4 Git commit: 4d60db4 Built: Wed Nov 7 00:46:51 2018 OS/Arch: linux/amd64 Experimental: false Server: Engine: Version: dev API version: 1.40 (minimum version 1.12) Go version: go1.11.2 Git commit: 7d02782d2f Built: Thu Nov 8 10:23:42 2018 OS/Arch: linux/amd64 Experimental: false containerd: Version: v1.1.4 GitCommit: 9f2e07b1fc1342d1c48fe4d7bbb94cb6d1bf278b runc: Version: 1.0.0-rc5+dev GitCommit: a00bf0190895aa465a5fbed0268888e2c8ddfe85 docker-init: Version: 0.18.0 GitCommit: fec3683 ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
56f9283
to
2137b8c
Compare
This patch adds version information about the containerd,
runc, and docker-init components to the /version endpoint.
With this patch applied, running:
Will produce this response:
When using a recent version of the CLI, that information is included in the
output of
docker version
:- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)