summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-08-06 11:35:29 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-07 14:16:26 +0000
commit33d6221ae34103d68753156ff2638802817dfa16 (patch)
tree11ed782c99565d37e33a178bf2da627ea1b33a77
parentb1de943eea26bf1f6a6c599116cba3e7d9fe5d36 (diff)
downloadpodman-33d6221ae34103d68753156ff2638802817dfa16.tar.gz
podman-33d6221ae34103d68753156ff2638802817dfa16.tar.bz2
podman-33d6221ae34103d68753156ff2638802817dfa16.zip
Have info print conmon/oci runtime information
We need into to identify the OCI runtime and conmon used by podman. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1224 Approved by: baude
-rw-r--r--docs/podman-info.1.md80
-rw-r--r--libpod/info.go17
-rw-r--r--libpod/oci_linux.go18
-rw-r--r--libpod/oci_unsupported.go8
4 files changed, 89 insertions, 34 deletions
diff --git a/docs/podman-info.1.md b/docs/podman-info.1.md
index ebcedace4..85e0e28bc 100644
--- a/docs/podman-info.1.md
+++ b/docs/podman-info.1.md
@@ -30,57 +30,78 @@ Run podman info with plain text response:
```
$ podman info
host:
- MemFree: 28464242688
- MemTotal: 33147686912
- OCIRuntimeVersion: 'runc version spec: 1.0.0'
- SwapFree: 34359734272
- SwapTotal: 34359734272
+ Conmon:
+ package: conmon-1.10.3-1.gite558bd5.fc28.x86_64
+ path: /usr/libexec/crio/conmon
+ version: 'conmon version 1.10.3, commit: 55022fb3be4382a61599b7024a677f9a642ae0a7'
+ MemFree: 2428579840
+ MemTotal: 16679260160
+ OCIRuntime:
+ package: runc-1.0.0-46.dev.gitb4e2ecb.fc28.x86_64
+ path: /usr/bin/runc
+ version: 'runc version spec: 1.0.0'
+ SwapFree: 0
+ SwapTotal: 0
arch: amd64
- conmonVersion: 'conmon version 1.11.0-dev, commit: 42209340c7abcab66f47e9161fa0f1b16ea8c134'
- cpus: 8
+ cpus: 4
hostname: localhost.localdomain
- kernel: 4.17.9-200.fc28.x86_64
+ kernel: 4.17.11-200.fc28.x86_64
os: linux
- uptime: 47m 34.95s
+ uptime: 23h 16m 57.86s (Approximately 0.96 days)
insecure registries:
registries: []
registries:
registries:
- docker.io
+ - quay.io
- registry.fedoraproject.org
- registry.access.redhat.com
store:
ContainerStore:
- number: 40
+ number: 3
GraphDriverName: overlay
GraphOptions:
- - overlay.override_kernel_check=true
+ - overlay.mountopt=nodev
GraphRoot: /var/lib/containers/storage
GraphStatus:
- Backing Filesystem: extfs
+ Backing Filesystem: xfs
Native Overlay Diff: "true"
Supports d_type: "true"
ImageStore:
- number: 10
+ number: 2
RunRoot: /var/run/containers/storage
```
Run podman info with JSON formatted response:
```
$ podman info --debug --format json
{
+ "debug": {
+ "compiler": "gc",
+ "git commit": "",
+ "go version": "go1.10",
+ "podman version": "0.8.2-dev"
+ },
"host": {
- "MemFree": 28421324800,
- "MemTotal": 33147686912,
- "OCIRuntimeVersion": "runc version spec: 1.0.0",
- "SwapFree": 34359734272,
- "SwapTotal": 34359734272,
+ "Conmon": {
+ "package": "conmon-1.10.3-1.gite558bd5.fc28.x86_64",
+ "path": "/usr/libexec/crio/conmon",
+ "version": "conmon version 1.10.3, commit: 55022fb3be4382a61599b7024a677f9a642ae0a7"
+ },
+ "MemFree": 2484420608,
+ "MemTotal": 16679260160,
+ "OCIRuntime": {
+ "package": "runc-1.0.0-46.dev.gitb4e2ecb.fc28.x86_64",
+ "path": "/usr/bin/runc",
+ "version": "runc version spec: 1.0.0"
+ },
+ "SwapFree": 0,
+ "SwapTotal": 0,
"arch": "amd64",
- "conmonVersion": "conmon version 1.11.0-dev, commit: 42209340c7abcab66f47e9161fa0f1b16ea8c134",
- "cpus": 8,
+ "cpus": 4,
"hostname": "localhost.localdomain",
- "kernel": "4.17.9-200.fc28.x86_64",
+ "kernel": "4.17.11-200.fc28.x86_64",
"os": "linux",
- "uptime": "50m 20.27s"
+ "uptime": "23h 14m 45.48s (Approximately 0.96 days)"
},
"insecure registries": {
"registries": []
@@ -88,35 +109,36 @@ $ podman info --debug --format json
"registries": {
"registries": [
"docker.io",
+ "quay.io",
"registry.fedoraproject.org",
- "registry.access.redhat.com",
+ "registry.access.redhat.com"
]
},
"store": {
"ContainerStore": {
- "number": 40
+ "number": 3
},
"GraphDriverName": "overlay",
"GraphOptions": [
- "overlay.override_kernel_check=true"
+ "overlay.mountopt=nodev"
],
"GraphRoot": "/var/lib/containers/storage",
"GraphStatus": {
- "Backing Filesystem": "extfs",
+ "Backing Filesystem": "xfs",
"Native Overlay Diff": "true",
"Supports d_type": "true"
},
"ImageStore": {
- "number": 10
+ "number": 2
},
"RunRoot": "/var/run/containers/storage"
}
}
-```
+ ```
Run podman info and only get the registries information.
```
$ podman info --format={{".registries"}}
-map[registries:[docker.io registry.fedoraproject.org registry.access.redhat.com]]
+map[registries:[docker.io quay.io registry.fedoraproject.org registry.access.redhat.com]]
```
## SEE ALSO
diff --git a/libpod/info.go b/libpod/info.go
index fe422747c..5bb77f447 100644
--- a/libpod/info.go
+++ b/libpod/info.go
@@ -37,6 +37,18 @@ func (r *Runtime) hostInfo() (map[string]interface{}, error) {
info["MemFree"] = mi.MemFree
info["SwapTotal"] = mi.SwapTotal
info["SwapFree"] = mi.SwapFree
+ conmonVersion, _ := r.GetConmonVersion()
+ ociruntimeVersion, _ := r.GetOCIRuntimeVersion()
+ info["Conmon"] = map[string]interface{}{
+ "path": r.conmonPath,
+ "package": r.ociRuntime.conmonPackage(),
+ "version": conmonVersion,
+ }
+ info["OCIRuntime"] = map[string]interface{}{
+ "path": r.ociRuntime.path,
+ "package": r.ociRuntime.pathPackage(),
+ "version": ociruntimeVersion,
+ }
kv, err := readKernelVersion()
if err != nil {
@@ -86,11 +98,6 @@ func (r *Runtime) hostInfo() (map[string]interface{}, error) {
}
info["hostname"] = host
- // Don't think this should be catastrophic if we cannot get the versions
- conmonVersion, _ := r.GetConmonVersion()
- ociruntimeVersion, _ := r.GetOCIRuntimeVersion()
- info["conmonVersion"] = conmonVersion
- info["OCIRuntimeVersion"] = ociruntimeVersion
return info, nil
}
diff --git a/libpod/oci_linux.go b/libpod/oci_linux.go
index 2be7ee07c..e105680b7 100644
--- a/libpod/oci_linux.go
+++ b/libpod/oci_linux.go
@@ -8,6 +8,7 @@ import (
"os/exec"
"path/filepath"
"runtime"
+ "strings"
"sync"
"github.com/containerd/cgroups"
@@ -102,3 +103,20 @@ func (r *OCIRuntime) createContainer(ctr *Container, cgroupParent string) (err e
return err
}
+
+func rpmVersion(path string) string {
+ output := "Unknown"
+ cmd := exec.Command("/usr/bin/rpm", "-q", "-f", path)
+ if outp, err := cmd.Output(); err == nil {
+ output = string(outp)
+ }
+ return strings.Trim(output, "\n")
+}
+
+func (r *OCIRuntime) pathPackage() string {
+ return rpmVersion(r.path)
+}
+
+func (r *OCIRuntime) conmonPackage() string {
+ return rpmVersion(r.conmonPath)
+}
diff --git a/libpod/oci_unsupported.go b/libpod/oci_unsupported.go
index 409bb117e..8cb4994d3 100644
--- a/libpod/oci_unsupported.go
+++ b/libpod/oci_unsupported.go
@@ -18,3 +18,11 @@ func newPipe() (parent *os.File, child *os.File, err error) {
func (r *OCIRuntime) createContainer(ctr *Container, cgroupParent string) (err error) {
return ErrNotImplemented
}
+
+func (r *OCIRuntime) pathPackage() string {
+ return ""
+}
+
+func (r *OCIRuntime) conmonPackage() string {
+ return ""
+}