@@ -16,6 +16,8 @@ limitations under the License.
16
16
package main
17
17
18
18
import (
19
+ "flag"
20
+ "fmt"
19
21
"github.com/coreos/go-etcd/etcd"
20
22
"github.com/samalba/dockerclient"
21
23
"log"
@@ -201,19 +203,15 @@ func handleContainerStart(netPlugin *plugin.NetPlugin, contId string) error {
201
203
return nil
202
204
}
203
205
204
- func handleDockerEvents (event * dockerclient.Event , args ... interface {}) {
206
+ func handleDockerEvents (event * dockerclient.Event , retErr chan error ,
207
+ args ... interface {}) {
205
208
var err error
206
209
207
210
netPlugin , ok := args [0 ].(* plugin.NetPlugin )
208
211
if ! ok {
209
212
log .Printf ("error decoding netplugin in handleDocker \n " )
210
213
}
211
214
212
- retErr , ok := args [1 ].(chan error )
213
- if ! ok {
214
- log .Printf ("error decoding netplugin in handleDocker \n " )
215
- }
216
-
217
215
log .Printf ("Received event: %#v, for netPlugin %v \n " , * event , netPlugin )
218
216
219
217
// XXX: with plugin (in a lib) this code will handle these events
@@ -252,7 +250,7 @@ func run(netPlugin *plugin.NetPlugin) error {
252
250
// start docker client and handle docker events
253
251
// wait on error chan for problems handling the docker events
254
252
dockerDriver := netPlugin .ContainerDriver .(* drivers.DockerDriver )
255
- dockerDriver .Client .StartMonitorEvents (handleDockerEvents , netPlugin , recvErr )
253
+ dockerDriver .Client .StartMonitorEvents (handleDockerEvents , recvErr , netPlugin )
256
254
257
255
// XXX: todo, restore any config that might have been created till this
258
256
// point
0 commit comments