Add error checks per report from errcheck-ng

This commit is contained in:
Oleksii Kliukin
2017-06-08 10:41:44 +02:00
committed by Oleksii Kliukin
parent 292a9bda05
commit bc0e9ab4bc
9 changed files with 48 additions and 19 deletions
+6 -2
View File
@@ -532,7 +532,9 @@ func (c *Cluster) Delete() error {
// ReceivePodEvent is called back by the controller in order to add the cluster's pod event to the queue.
func (c *Cluster) ReceivePodEvent(event spec.PodEvent) {
c.podEventsQueue.Add(event)
if err := c.podEventsQueue.Add(event); err != nil {
c.logger.Errorf("error when receiving pod events: %v", err)
}
}
func (c *Cluster) processPodEvent(obj interface{}) error {
@@ -562,7 +564,9 @@ func (c *Cluster) processPodEventQueue(stopCh <-chan struct{}) {
case <-stopCh:
return
default:
c.podEventsQueue.Pop(cache.PopProcessFunc(c.processPodEvent))
if _, err := c.podEventsQueue.Pop(cache.PopProcessFunc(c.processPodEvent)); err != nil {
c.logger.Errorf("error when processing pod event queeue %v", err)
}
}
}
}