From 4e069994e7e9c9e22fc0ecbadea30069a6d4acfd Mon Sep 17 00:00:00 2001 From: Andrea Tosatto Date: Mon, 25 Jul 2016 08:45:12 +0200 Subject: [PATCH] Correct actions channel in container backend --- container/backend/backend.go | 2 +- container/backend/docker/docker.go | 2 +- engine/engine.go | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/container/backend/backend.go b/container/backend/backend.go index a768e32..9f92840 100644 --- a/container/backend/backend.go +++ b/container/backend/backend.go @@ -13,7 +13,7 @@ import ( type Backend interface { Monitor(eventsChan chan<- event.Event, errChan chan<- error) - Exec(actionsChan chan<- action.Action, errChan chan<- error) + Exec(actionsChan <-chan action.Action, errChan chan<- error) } func NewBackend(name string, c config.BackendConfig) (Backend, error) { diff --git a/container/backend/docker/docker.go b/container/backend/docker/docker.go index 5d3f0ef..ff01939 100644 --- a/container/backend/docker/docker.go +++ b/container/backend/docker/docker.go @@ -90,6 +90,6 @@ func (d *Docker) Monitor(eventsChan chan<- kevent.Event, errChan chan<- error) { } } -func (d *Docker) Exec(actionsChan chan<- kaction.Action, errChan chan<- error) { +func (d *Docker) Exec(actionsChan <-chan kaction.Action, errChan chan<- error) { log.Debug("[Docker][Exec] Start") } diff --git a/engine/engine.go b/engine/engine.go index 59e29c4..7ae9e95 100644 --- a/engine/engine.go +++ b/engine/engine.go @@ -3,16 +3,16 @@ package engine import ( log "github.com/Sirupsen/logrus" "github.com/opsfactory/kappa/container/action" - "github.com/opsfactory/kappa/container/backend" + containerBackend "github.com/opsfactory/kappa/container/backend" "github.com/opsfactory/kappa/container/event" ) type Engine struct { - backend backend.Backend + containerBackend containerBackend.Backend } -func NewEngine(b backend.Backend) *Engine { - return &Engine{backend: b} +func NewEngine(b containerBackend.Backend) *Engine { + return &Engine{containerBackend: b} } func (e Engine) Run() error { @@ -21,8 +21,8 @@ func (e Engine) Run() error { eventsChan := make(chan event.Event) actionsChan := make(chan action.Action) - go e.backend.Monitor(eventsChan, errChan) - go e.backend.Exec(actionsChan, errChan) + go e.containerBackend.Monitor(eventsChan, errChan) + go e.containerBackend.Exec(actionsChan, errChan) go e.handleEvent(eventsChan, actionsChan, errChan) for err := range errChan {