mirror of
https://github.com/coreos/prometheus-operator.git
synced 2026-02-05 06:45:27 +01:00
fix: add missing ScrapeConfigNamespaceSelector in handleMonitorNamespaceUpdate (#8334)
Signed-off-by: Sanchit2662 <sanchit2662@gmail.com>
This commit is contained in:
@@ -1199,13 +1199,14 @@ func (c *Operator) handleMonitorNamespaceUpdate(oldo, curo any) {
|
||||
c.metrics.TriggerByCounter("Namespace", operator.UpdateEvent).Inc()
|
||||
|
||||
// Check for Prometheus Agent instances selecting ServiceMonitors, PodMonitors,
|
||||
// and Probes in the namespace.
|
||||
// Probes and ScrapeConfigs in the namespace.
|
||||
err := c.promInfs.ListAll(labels.Everything(), func(obj any) {
|
||||
p := obj.(*monitoringv1alpha1.PrometheusAgent)
|
||||
|
||||
for name, selector := range map[string]*metav1.LabelSelector{
|
||||
"PodMonitors": p.Spec.PodMonitorNamespaceSelector,
|
||||
"Probes": p.Spec.ProbeNamespaceSelector,
|
||||
"ScrapeConfigs": p.Spec.ScrapeConfigNamespaceSelector,
|
||||
"ServiceMonitors": p.Spec.ServiceMonitorNamespaceSelector,
|
||||
} {
|
||||
|
||||
|
||||
@@ -774,7 +774,7 @@ func (c *Operator) handleMonitorNamespaceUpdate(oldo, curo any) {
|
||||
c.metrics.TriggerByCounter("Namespace", operator.UpdateEvent).Inc()
|
||||
|
||||
// Check for Prometheus instances selecting ServiceMonitors, PodMonitors,
|
||||
// Probes and PrometheusRules in the namespace.
|
||||
// Probes, PrometheusRules and ScrapeConfigs in the namespace.
|
||||
err := c.promInfs.ListAll(labels.Everything(), func(obj any) {
|
||||
p := obj.(*monitoringv1.Prometheus)
|
||||
|
||||
@@ -782,6 +782,7 @@ func (c *Operator) handleMonitorNamespaceUpdate(oldo, curo any) {
|
||||
"PodMonitors": p.Spec.PodMonitorNamespaceSelector,
|
||||
"Probes": p.Spec.ProbeNamespaceSelector,
|
||||
"PrometheusRules": p.Spec.RuleNamespaceSelector,
|
||||
"ScrapeConfigs": p.Spec.ScrapeConfigNamespaceSelector,
|
||||
"ServiceMonitors": p.Spec.ServiceMonitorNamespaceSelector,
|
||||
} {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user