1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-21 11:48:53 +00:00

pkg/prometheus: check error immediately after List

This commit is contained in:
Sergiusz Urbaniak 2020-08-31 13:04:36 +02:00
parent 27c1680975
commit 2379f59f6f

View file

@ -1018,6 +1018,13 @@ func (c *Operator) enqueueForNamespace(store cache.Store, nsName string) {
ns := nsObject.(*v1.Namespace)
objs, err := c.promInfs.List(labels.Everything())
if err != nil {
level.Error(c.logger).Log(
"msg", "listing all Prometheus instances from cache failed",
"err", err,
)
return
}
for _, obj := range objs {
// Check for Prometheus instances in the namespace.
@ -1089,13 +1096,6 @@ func (c *Operator) enqueueForNamespace(store cache.Store, nsName string) {
return
}
}
if err != nil {
level.Error(c.logger).Log(
"msg", "listing all Prometheus instances from cache failed",
"err", err,
)
}
}
// worker runs a worker thread that just dequeues items, processes them, and