1
0
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:
Simon Pasquier
2026-01-27 17:54:15 +01:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@@ -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,
} {

View File

@@ -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,
} {