Add Keepalived to backend
@@ -10,6 +10,7 @@ import (
"github.com/sensu/sensu-go/backend/daemon"
"github.com/sensu/sensu-go/backend/dashboardd"
"github.com/sensu/sensu-go/backend/eventd"
+ "github.com/sensu/sensu-go/backend/keepalived"
"github.com/sensu/sensu-go/backend/messaging"
"github.com/sensu/sensu-go/backend/pipelined"
"github.com/sensu/sensu-go/backend/schedulerd"
@@ -52,6 +53,7 @@ type Backend struct {
dashboardd daemon.Daemon
eventd daemon.Daemon
pipelined daemon.Daemon
+ keepalived daemon.Daemon
}
// NewBackend will, given a Config, create an initialized Backend and return a
@@ -181,6 +183,14 @@ func (b *Backend) Run() error {
return err
}
+ b.keepalived = &keepalived.Keepalived{
+ KeepaliveStore: st,
+ MessageBus: b.messageBus,
+ }
+ if err := b.keepalived.Start(); err != nil {
+ return err
+ }
+
inErrChan := make(chan error)
go func() {
@@ -215,6 +225,10 @@ func (b *Backend) Run() error {
inErrChan <- <-b.eventd.Err()
}()
+ go func() {
+ inErrChan <- <-b.keepalived.Err()
+ }()
+
select {
case err := <-inErrChan:
logger.Error(err.Error())
