summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-04-25 12:20:39 -0700
committerGitHub <noreply@github.com>2019-04-25 12:20:39 -0700
commit01e79477ca75df54836944a94eb4840c9e9f49e1 (patch)
tree8b76672f2a4e83b0c8334132dca92e3b1279ba14 /pkg
parente900e95f9aa6a22eeef9f78573dfb88df2f10d49 (diff)
parent7bf7c177ab3f67d5de1689842204c258fca083e4 (diff)
downloadpodman-01e79477ca75df54836944a94eb4840c9e9f49e1.tar.gz
podman-01e79477ca75df54836944a94eb4840c9e9f49e1.tar.bz2
podman-01e79477ca75df54836944a94eb4840c9e9f49e1.zip
Merge pull request #2850 from baude/eventsjournald
journald event logging
Diffstat (limited to 'pkg')
-rw-r--r--pkg/adapter/runtime.go9
-rw-r--r--pkg/varlinkapi/events.go10
2 files changed, 6 insertions, 13 deletions
diff --git a/pkg/adapter/runtime.go b/pkg/adapter/runtime.go
index ca9678265..790ed5c89 100644
--- a/pkg/adapter/runtime.go
+++ b/pkg/adapter/runtime.go
@@ -5,6 +5,7 @@ package adapter
import (
"bufio"
"context"
+ "github.com/containers/libpod/cmd/podman/shared"
"io"
"io/ioutil"
"os"
@@ -17,7 +18,6 @@ import (
"github.com/containers/image/types"
"github.com/containers/libpod/cmd/podman/cliconfig"
"github.com/containers/libpod/cmd/podman/libpodruntime"
- "github.com/containers/libpod/cmd/podman/shared"
"github.com/containers/libpod/libpod"
"github.com/containers/libpod/libpod/events"
"github.com/containers/libpod/libpod/image"
@@ -322,10 +322,6 @@ func (r *LocalRuntime) Events(c *cliconfig.EventValues) error {
fromStart bool
eventsError error
)
- options, err := shared.GenerateEventOptions(c.Filter, c.Since, c.Until)
- if err != nil {
- return errors.Wrapf(err, "unable to generate event options")
- }
tmpl, err := template.New("events").Parse(c.Format)
if err != nil {
return err
@@ -335,7 +331,8 @@ func (r *LocalRuntime) Events(c *cliconfig.EventValues) error {
}
eventChannel := make(chan *events.Event)
go func() {
- eventsError = r.Runtime.Events(fromStart, c.Stream, options, eventChannel)
+ readOpts := events.ReadOptions{FromStart: fromStart, Stream: c.Stream, Filters: c.Filter, EventChannel: eventChannel, Since: c.Since, Until: c.Until}
+ eventsError = r.Runtime.Events(readOpts)
}()
if eventsError != nil {
diff --git a/pkg/varlinkapi/events.go b/pkg/varlinkapi/events.go
index 1e5696fbe..f9a9d9321 100644
--- a/pkg/varlinkapi/events.go
+++ b/pkg/varlinkapi/events.go
@@ -6,7 +6,6 @@ import (
"fmt"
"time"
- "github.com/containers/libpod/cmd/podman/shared"
"github.com/containers/libpod/cmd/podman/varlink"
"github.com/containers/libpod/libpod/events"
)
@@ -23,19 +22,16 @@ func (i *LibpodAPI) GetEvents(call iopodman.VarlinkCall, filter []string, since
stream = true
call.Continues = true
}
- filters, err := shared.GenerateEventOptions(filter, since, until)
- if err != nil {
- return call.ReplyErrorOccurred(err.Error())
- }
if len(since) > 0 || len(until) > 0 {
fromStart = true
}
eventChannel := make(chan *events.Event)
go func() {
- eventsError = i.Runtime.Events(fromStart, stream, filters, eventChannel)
+ readOpts := events.ReadOptions{FromStart: fromStart, Stream: stream, Filters: filter, EventChannel: eventChannel}
+ eventsError = i.Runtime.Events(readOpts)
}()
if eventsError != nil {
- return call.ReplyErrorOccurred(err.Error())
+ return call.ReplyErrorOccurred(eventsError.Error())
}
for {
event = <-eventChannel