diff options
author | umohnani8 <umohnani@redhat.com> | 2018-01-23 16:50:20 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-01-25 03:23:10 +0000 |
commit | 12e3d9d8a26d2c33d587dba9b7ea5b0dcfd92eea (patch) | |
tree | 6e596e575eba2c990db4f920baf41ab1bd1210c7 /cmd/podman/common.go | |
parent | 4c7bab9812b95fed8e6f8255b51b843b3e762782 (diff) | |
download | podman-12e3d9d8a26d2c33d587dba9b7ea5b0dcfd92eea.tar.gz podman-12e3d9d8a26d2c33d587dba9b7ea5b0dcfd92eea.tar.bz2 podman-12e3d9d8a26d2c33d587dba9b7ea5b0dcfd92eea.zip |
Fix podman stats based on QE feedback
QE found issues with formatting the go template and
the man page was lacking information.
Changed the format of the output to match latest docker.
Add shortID function that returns the truncated ID
Signed-off-by: umohnani8 <umohnani@redhat.com>
Closes: #258
Approved by: rhatdan
Diffstat (limited to 'cmd/podman/common.go')
-rw-r--r-- | cmd/podman/common.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/cmd/podman/common.go b/cmd/podman/common.go index ae4bbd65d..921f30b84 100644 --- a/cmd/podman/common.go +++ b/cmd/podman/common.go @@ -22,7 +22,10 @@ var ( } ) -const crioConfigPath = "/etc/crio/crio.conf" +const ( + crioConfigPath = "/etc/crio/crio.conf" + idTruncLength = 12 +) func getRuntime(c *cli.Context) (*libpod.Runtime, error) { @@ -88,6 +91,13 @@ func splitCamelCase(src string) string { return strings.Join(entries, " ") } +func shortID(id string) string { + if len(id) > idTruncLength { + return id[:idTruncLength] + } + return id +} + // validateFlags searches for StringFlags or StringSlice flags that never had // a value set. This commonly occurs when the CLI mistakenly takes the next // option and uses it as a value. |