summaryrefslogtreecommitdiff
path: root/pkg/varlinkapi
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-10-31 22:05:17 +0100
committerGitHub <noreply@github.com>2019-10-31 22:05:17 +0100
commit2dae2577ccbeef502a8783c892a6c9e346153532 (patch)
tree34bc708c058597eb0e9c82f4cdbc6e308d6b4497 /pkg/varlinkapi
parent0bfdeae6ddfab22990eaa472317d65e79a222db3 (diff)
parent11750df51015a675c1145982847e08397c7606ea (diff)
downloadpodman-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/varlinkapi')
-rw-r--r--pkg/varlinkapi/containers.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/varlinkapi/containers.go b/pkg/varlinkapi/containers.go
index b471ee2cf..94726bbbd 100644
--- a/pkg/varlinkapi/containers.go
+++ b/pkg/varlinkapi/containers.go
@@ -739,7 +739,7 @@ func (i *LibpodAPI) GetContainersLogs(call iopodman.VarlinkCall, names []string,
options := logs.LogOptions{
Follow: follow,
Since: sinceTime,
- Tail: uint64(tail),
+ Tail: tail,
Timestamps: timestamps,
}
@@ -747,7 +747,11 @@ func (i *LibpodAPI) GetContainersLogs(call iopodman.VarlinkCall, names []string,
if len(names) > 1 {
options.Multi = true
}
- logChannel := make(chan *logs.LogLine, int(tail)*len(names)+1)
+ tailLen := int(tail)
+ if tailLen < 0 {
+ tailLen = 0
+ }
+ logChannel := make(chan *logs.LogLine, tailLen*len(names)+1)
containers, err := shortcuts.GetContainersByContext(false, latest, names, i.Runtime)
if err != nil {
return call.ReplyErrorOccurred(err.Error())