Skip to content

Commit

Permalink
adding reporters logs and handlers to http map
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostec committed Sep 28, 2018
1 parent c1f38b7 commit 4d0a608
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion metadata/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
package metadata

//Version of Maestro
var Version = "7.1.0"
var Version = "7.1.1"

//KubeVersion is the desired Kubernetes version
var KubeVersion = "v1.7.5"
2 changes: 2 additions & 0 deletions reporters/http/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
)

var handlers = map[string]interface{}{
constants.EventSchedulerCreate: AnyHandler,
constants.EventSchedulerDelete: AnyHandler,
constants.EventSchedulerUpdate: AnyHandler,
}

Expand Down
7 changes: 7 additions & 0 deletions reporters/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
package reporters

import (
"fmt"
"strings"
"sync"

"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -67,6 +69,11 @@ func MakeReporters(config *viper.Viper, logger *logrus.Logger) {
if config.IsSet("reporters.http") {
MakeHTTP(config, logger, GetInstance())
}
correctlySet := []string{}
for k := range GetInstance().reporters {
correctlySet = append(correctlySet, k)
}
logger.Info(fmt.Sprintf("Active reporters: %s", strings.Join(correctlySet, ", ")))
}

// NewReporters ctor
Expand Down
2 changes: 2 additions & 0 deletions reporters/reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ var _ = Describe("Reporters", func() {
singleton := reporters.GetInstance()
_, prs := singleton.GetReporter("dogstatsd")
Expect(prs).To(Equal(true))
_, prs = singleton.GetReporter("http")
Expect(prs).To(Equal(true))
})

It("must delete an existing reporter from singleton with UnsetReporter", func() {
Expand Down

0 comments on commit 4d0a608

Please sign in to comment.