summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-08-17 21:46:21 +0000
committerGitHub <noreply@github.com>2022-08-17 21:46:21 +0000
commitf63da351f2be70a8d39dfed9554371f27e1780a1 (patch)
treee110f1ededb39c49f1ead16af4b71148d2448e12 /cmd
parent188d8703070936f9de7a8e499f5af8ad5a41147d (diff)
parent546bb3548ce9af58ebf0a627eb66ea7ad2163c6b (diff)
downloadpodman-f63da351f2be70a8d39dfed9554371f27e1780a1.tar.gz
podman-f63da351f2be70a8d39dfed9554371f27e1780a1.tar.bz2
podman-f63da351f2be70a8d39dfed9554371f27e1780a1.zip
Merge pull request #15364 from rhatdan/stats
Add podman stats --no-trunc option
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/containers/stats.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/podman/containers/stats.go b/cmd/podman/containers/stats.go
index 0dd8ce80a..f29bbf34c 100644
--- a/cmd/podman/containers/stats.go
+++ b/cmd/podman/containers/stats.go
@@ -58,6 +58,7 @@ type statsOptionsCLI struct {
var (
statsOptions statsOptionsCLI
+ notrunc bool
)
func statFlags(cmd *cobra.Command) {
@@ -69,6 +70,7 @@ func statFlags(cmd *cobra.Command) {
flags.StringVar(&statsOptions.Format, formatFlagName, "", "Pretty-print container statistics to JSON or using a Go template")
_ = cmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(&containerStats{}))
+ flags.BoolVar(&notrunc, "no-trunc", false, "Do not truncate output")
flags.BoolVar(&statsOptions.NoReset, "no-reset", false, "Disable resetting the screen between intervals")
flags.BoolVar(&statsOptions.NoStream, "no-stream", false, "Disable streaming stats and only pull the first result, default setting is false")
intervalFlagName := "interval"
@@ -186,6 +188,9 @@ type containerStats struct {
}
func (s *containerStats) ID() string {
+ if notrunc {
+ return s.ContainerID
+ }
return s.ContainerID[0:12]
}