summaryrefslogtreecommitdiff
path: root/libpod/events/logfile.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-06-02 10:37:58 -0400
committerGitHub <noreply@github.com>2021-06-02 10:37:58 -0400
commit52dae693da0df1447b7f5210a4c842d5c5a8a401 (patch)
tree2f0add142c8bf9fbf901cf4538ceafa747a78797 /libpod/events/logfile.go
parent6df37abd502d53a695392723af0d4a4970be3e58 (diff)
parent37f39eefee72ec4fb6c6bd71642e9d384c448387 (diff)
downloadpodman-52dae693da0df1447b7f5210a4c842d5c5a8a401.tar.gz
podman-52dae693da0df1447b7f5210a4c842d5c5a8a401.tar.bz2
podman-52dae693da0df1447b7f5210a4c842d5c5a8a401.zip
Merge pull request #10514 from vrothberg/fix-10507
events: support disjunctive filters
Diffstat (limited to 'libpod/events/logfile.go')
-rw-r--r--libpod/events/logfile.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/libpod/events/logfile.go b/libpod/events/logfile.go
index 0f00525e8..952444f2b 100644
--- a/libpod/events/logfile.go
+++ b/libpod/events/logfile.go
@@ -44,9 +44,9 @@ func (e EventLogFile) Write(ee Event) error {
// Reads from the log file
func (e EventLogFile) Read(ctx context.Context, options ReadOptions) error {
defer close(options.EventChannel)
- eventOptions, err := generateEventOptions(options.Filters, options.Since, options.Until)
+ filterMap, err := generateEventFilters(options.Filters, options.Since, options.Until)
if err != nil {
- return errors.Wrapf(err, "unable to generate event options")
+ return errors.Wrapf(err, "failed to parse event filters")
}
t, err := e.getTail(options)
if err != nil {
@@ -92,11 +92,7 @@ func (e EventLogFile) Read(ctx context.Context, options ReadOptions) error {
default:
return errors.Errorf("event type %s is not valid in %s", event.Type.String(), e.options.LogFilePath)
}
- include := true
- for _, filter := range eventOptions {
- include = include && filter(event)
- }
- if include && copy {
+ if copy && applyFilters(event, filterMap) {
options.EventChannel <- event
}
}