summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/containers.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-07-09 13:32:20 +0200
committerValentin Rothberg <rothberg@redhat.com>2020-07-09 15:13:07 +0200
commit09dc77aedfb786505bc526536be18d457fb7c68b (patch)
treed45bf64bf131493553f3444880a1386d9b238f04 /pkg/domain/infra/abi/containers.go
parentedf5fe8b17f39ce98805c279b9795bfd4123abe2 (diff)
downloadpodman-09dc77aedfb786505bc526536be18d457fb7c68b.tar.gz
podman-09dc77aedfb786505bc526536be18d457fb7c68b.tar.bz2
podman-09dc77aedfb786505bc526536be18d457fb7c68b.zip
log API: add context to allow for cancelling
Add a `context.Context` to the log APIs to allow for cancelling streaming (e.g., via `podman logs -f`). This fixes issues for the remote API where some go routines of the server will continue writing and produce nothing but heat and waste CPU cycles. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/domain/infra/abi/containers.go')
-rw-r--r--pkg/domain/infra/abi/containers.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go
index 596fc2cc1..8909f831d 100644
--- a/pkg/domain/infra/abi/containers.go
+++ b/pkg/domain/infra/abi/containers.go
@@ -924,7 +924,7 @@ func (ic *ContainerEngine) ContainerLogs(ctx context.Context, containers []strin
}
logChannel := make(chan *logs.LogLine, chSize)
- if err := ic.Libpod.Log(ctrs, logOpts, logChannel); err != nil {
+ if err := ic.Libpod.Log(ctx, ctrs, logOpts, logChannel); err != nil {
return err
}