Closed lebauce closed 8 years ago
A less intrusive fix could be :
diff --git a/dockerclient.go b/dockerclient.go
index fb1fdd9..e83a761 100644
--- a/dockerclient.go
+++ b/dockerclient.go
@@ -442,13 +442,13 @@ func (client *DockerClient) MonitorEvents(options *MonitorEventsOptions, stopCha
if options.Filters != nil {
filterMap := make(map[string][]string)
if len(options.Filters.Event) > 0 {
- filterMap["event"] = []string{options.Filters.Event}
+ filterMap["event"] = strings.Split(options.Filters.Event, ",")
}
if len(options.Filters.Image) > 0 {
- filterMap["image"] = []string{options.Filters.Image}
+ filterMap["image"] = strings.Split(options.Filters.Image, ",")
}
if len(options.Filters.Container) > 0 {
- filterMap["container"] = []string{options.Filters.Container}
+ filterMap["container"] = strings.Split(options.Filters.Container, ",")
}
if len(filterMap) > 0 {
filterJSONBytes, err := json.Marshal(filterMap)
but it may be a bit awkward to use the Event
property for specifying multiple events.
ping @samalba
ping @vieux @donhcd :-/
LGTM. fwiw I don't think anybody is really actively maintaining this repo anymore, and docker's supported go client is https://github.com/docker/engine-api and it seems like it does have the filters working the way you want https://github.com/docker/engine-api/blob/master/client/events.go#L36 though the return types are atrocious :(
@donhcd Thank you.
That may be a good idea to change the "Well maintained docker client library." baseline then :-)
Signed-off-by: Sylvain Baubeau sbaubeau@redhat.com