summaryrefslogtreecommitdiff
path: root/libpod/container_log_unsupported.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-07-09 13:32:20 +0200
committerMatthew Heon <matthew.heon@pm.me>2020-07-22 14:50:47 -0400
commit84076bf95f485bccfd9e03108fb69a1f72b42918 (patch)
treeff7e5ac8be9598f65fa23c7b8df9bceb99dc584b /libpod/container_log_unsupported.go
parentf9526cf02b76f1c006bd344d05e8a40bfe94dbe9 (diff)
downloadpodman-84076bf95f485bccfd9e03108fb69a1f72b42918.tar.gz
podman-84076bf95f485bccfd9e03108fb69a1f72b42918.tar.bz2
podman-84076bf95f485bccfd9e03108fb69a1f72b42918.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 'libpod/container_log_unsupported.go')
-rw-r--r--libpod/container_log_unsupported.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/libpod/container_log_unsupported.go b/libpod/container_log_unsupported.go
index 18882720a..f3b36619e 100644
--- a/libpod/container_log_unsupported.go
+++ b/libpod/container_log_unsupported.go
@@ -3,11 +3,13 @@
package libpod
import (
+ "context"
+
"github.com/containers/libpod/v2/libpod/define"
"github.com/containers/libpod/v2/libpod/logs"
"github.com/pkg/errors"
)
-func (c *Container) readFromJournal(options *logs.LogOptions, logChannel chan *logs.LogLine) error {
+func (c *Container) readFromJournal(_ context.Context, _ *logs.LogOptions, _ chan *logs.LogLine) error {
return errors.Wrapf(define.ErrOSNotSupported, "Journald logging only enabled with systemd on linux")
}