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:
parent
27c1680975
commit
2379f59f6f
1 changed files with 7 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue