diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-10-31 22:05:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-31 22:05:17 +0100 |
commit | 2dae2577ccbeef502a8783c892a6c9e346153532 (patch) | |
tree | 34bc708c058597eb0e9c82f4cdbc6e308d6b4497 /pkg/adapter/containers.go | |
parent | 0bfdeae6ddfab22990eaa472317d65e79a222db3 (diff) | |
parent | 11750df51015a675c1145982847e08397c7606ea (diff) | |
download | podman-2dae2577ccbeef502a8783c892a6c9e346153532.tar.gz podman-2dae2577ccbeef502a8783c892a6c9e346153532.tar.bz2 podman-2dae2577ccbeef502a8783c892a6c9e346153532.zip |
Merge pull request #4399 from giuseppe/tail-0
logs: support --tail 0
Diffstat (limited to 'pkg/adapter/containers.go')
-rw-r--r-- | pkg/adapter/containers.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/adapter/containers.go b/pkg/adapter/containers.go index 207cf5c64..ea5c54814 100644 --- a/pkg/adapter/containers.go +++ b/pkg/adapter/containers.go @@ -307,7 +307,11 @@ func (r *LocalRuntime) Log(c *cliconfig.LogsValues, options *logs.LogOptions) er if len(c.InputArgs) > 1 { options.Multi = true } - logChannel := make(chan *logs.LogLine, int(c.Tail)*len(c.InputArgs)+1) + tailLen := int(c.Tail) + if tailLen < 0 { + tailLen = 0 + } + logChannel := make(chan *logs.LogLine, tailLen*len(c.InputArgs)+1) containers, err := shortcuts.GetContainersByContext(false, c.Latest, c.InputArgs, r.Runtime) if err != nil { return err |