Skip to content

Commit

Permalink
Consul watcher error logs (#50)
Browse files Browse the repository at this point in the history
Signed-off-by: Sotirios Mantziaris <[email protected]>
  • Loading branch information
Sotirios Mantziaris authored May 22, 2020
1 parent 76a1643 commit 440d83b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions monitor/consul/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ func (w *Watcher) createKeyPlan(key string, ch chan<- []*change.Change) (*watch.
return nil, err
}
pl.Handler = func(idx uint64, data interface{}) {
if data == nil {
return
}
pair, ok := data.(*api.KVPair)
if !ok {
harvesterlog.Errorf("data is not kv pair: %v", data)
Expand All @@ -130,6 +133,9 @@ func (w *Watcher) createKeyPrefixPlan(keyPrefix string, ch chan<- []*change.Chan
return nil, err
}
pl.Handler = func(idx uint64, data interface{}) {
if data == nil {
return
}
pp, ok := data.(api.KVPairs)
if !ok {
harvesterlog.Errorf("data is not kv pairs: %v", data)
Expand Down

0 comments on commit 440d83b

Please sign in to comment.