Add UUID and server info to introspection

Closes #1862

This adds a new rpc to the introspection service to provide server
information with a generated UUID that is done on demand and the os and
arch of the server.

ctr output:

```bash
> sudo ctr version

Client:
  Version:  v1.2.0-802-g57821695.m
  Revision: 578216950de9c1c188708369e2a31ac6c494dfee.m

Server:
  Version:  v1.2.0-802-g57821695.m
  Revision: 578216950de9c1c188708369e2a31ac6c494dfee.m
  UUID: 92e982a9-f13e-4a2c-9032-e69b27fed454
  OS: linux
  ARCH: amd64
```

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2019-07-31 15:28:06 +00:00
parent dce8541387
commit 9f0bc2b53f
6 changed files with 364 additions and 35 deletions

View File

@@ -46,6 +46,11 @@ var Command = cli.Command{
fmt.Println("Server:")
fmt.Println(" Version: ", v.Version)
fmt.Println(" Revision:", v.Revision)
di, err := client.Server(ctx)
if err != nil {
return err
}
fmt.Println(" UUID:", di.UUID)
if v.Version != version.Version {
fmt.Fprintln(os.Stderr, "WARNING: version mismatch")
}