diff --git a/pkg/batch/writer.go b/pkg/batch/writer.go index e484d332..4bdc1ee4 100644 --- a/pkg/batch/writer.go +++ b/pkg/batch/writer.go @@ -5,7 +5,6 @@ import ( "time" ) - // Writer allows to buffer some items and call the Handler function either when the buffer is full or the timeout is // reached. There will also be support for concurrency for high volume. The handler function is supposed to return an // array of booleans to indicate whether the transfer was successful or not. It can be replaced with status codes in diff --git a/pkg/exporter/channel_registry.go b/pkg/exporter/channel_registry.go index 39db655a..95d29601 100644 --- a/pkg/exporter/channel_registry.go +++ b/pkg/exporter/channel_registry.go @@ -16,9 +16,9 @@ import ( // and we might need a mechanism to drop the vents // On closing, the registry sends a signal on all exit channels, and then waits for all to complete. type ChannelBasedReceiverRegistry struct { - ch map[string]chan kube.EnhancedEvent - exitCh map[string]chan interface{} - wg *sync.WaitGroup + ch map[string]chan kube.EnhancedEvent + exitCh map[string]chan interface{} + wg *sync.WaitGroup MetricsStore *metrics.Store } diff --git a/pkg/exporter/event.go b/pkg/exporter/event.go index 4939da1d..5c64ba72 100644 --- a/pkg/exporter/event.go +++ b/pkg/exporter/event.go @@ -1,2 +1 @@ package exporter - diff --git a/pkg/sinks/email.go b/pkg/sinks/email.go index 0e4ab034..afcf4510 100644 --- a/pkg/sinks/email.go +++ b/pkg/sinks/email.go @@ -1,3 +1,3 @@ package sinks -// Just kidding, please don't implement this \ No newline at end of file +// Just kidding, please don't implement this diff --git a/pkg/sinks/inmemory.go b/pkg/sinks/inmemory.go index c74a1199..77407c1d 100644 --- a/pkg/sinks/inmemory.go +++ b/pkg/sinks/inmemory.go @@ -22,5 +22,3 @@ func (i *InMemory) Send(ctx context.Context, ev *kube.EnhancedEvent) error { func (i *InMemory) Close() { // No-op } - - diff --git a/pkg/sinks/loki.go b/pkg/sinks/loki.go index 4d0a0d93..2c675d91 100644 --- a/pkg/sinks/loki.go +++ b/pkg/sinks/loki.go @@ -7,11 +7,11 @@ import ( "errors" "fmt" "github.com/resmoio/kubernetes-event-exporter/pkg/kube" + "github.com/rs/zerolog/log" "io/ioutil" "net/http" "strconv" "time" - "github.com/rs/zerolog/log" ) type promtailStream struct { diff --git a/pkg/sinks/opsgenie.go b/pkg/sinks/opsgenie.go index 6976c819..c4796a88 100644 --- a/pkg/sinks/opsgenie.go +++ b/pkg/sinks/opsgenie.go @@ -2,9 +2,9 @@ package sinks import ( "context" - "github.com/resmoio/kubernetes-event-exporter/pkg/kube" "github.com/opsgenie/opsgenie-go-sdk-v2/alert" "github.com/opsgenie/opsgenie-go-sdk-v2/client" + "github.com/resmoio/kubernetes-event-exporter/pkg/kube" ) type OpsgenieConfig struct { @@ -16,6 +16,13 @@ type OpsgenieConfig struct { Description string `yaml:"description"` Tags []string `yaml:"tags"` Details map[string]string `yaml:"details"` + Entity string `yaml:"entity"` + Responders []Responder `yaml:"responders"` +} + +type Responder struct { + Id string + Type string } type OpsgenieSink struct { diff --git a/pkg/sinks/pipe.go b/pkg/sinks/pipe.go index 8fe4abc8..60e75ef6 100644 --- a/pkg/sinks/pipe.go +++ b/pkg/sinks/pipe.go @@ -10,9 +10,9 @@ import ( ) type PipeConfig struct { - Path string `yaml:"path"` + Path string `yaml:"path"` // DeDot all labels and annotations in the event. For both the event and the involvedObject - DeDot bool `yaml:"deDot"` + DeDot bool `yaml:"deDot"` Layout map[string]interface{} `yaml:"layout"` } diff --git a/pkg/sinks/sms.go b/pkg/sinks/sms.go index 0e4ab034..afcf4510 100644 --- a/pkg/sinks/sms.go +++ b/pkg/sinks/sms.go @@ -1,3 +1,3 @@ package sinks -// Just kidding, please don't implement this \ No newline at end of file +// Just kidding, please don't implement this diff --git a/pkg/sinks/tmpl.go b/pkg/sinks/tmpl.go index 36f1f353..2a88db79 100644 --- a/pkg/sinks/tmpl.go +++ b/pkg/sinks/tmpl.go @@ -5,8 +5,8 @@ import ( "encoding/json" "text/template" - "github.com/resmoio/kubernetes-event-exporter/pkg/kube" "github.com/Masterminds/sprig/v3" + "github.com/resmoio/kubernetes-event-exporter/pkg/kube" ) func GetString(event *kube.EnhancedEvent, text string) (string, error) { diff --git a/pkg/version/version.go b/pkg/version/version.go index 300ed82d..0cb1c123 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -15,12 +15,12 @@ var ( func Revision() string { bi, ok := debug.ReadBuildInfo() - - if ok { + + if ok { for _, kv := range bi.Settings { switch kv.Key { - case "vcs.revision": - return kv.Value + case "vcs.revision": + return kv.Value } } }