Skip to content

Commit ef3715b

Browse files
fix(observability): gate needsCR on targetAllocator enabled
$needsCR granted the monitoring.coreos.com SM/PM read rule whenever any agent had prometheusCR.enabled, even if that agent's targetAllocator was disabled, so a stale prometheusCR.enabled over-granted. Mirror $needsTA by also requiring targetAllocator.enabled, keeping the ClusterRole least-privilege. The otelCI scrape path ($otelCIScrape) still grants it as before.
1 parent e032f1a commit ef3715b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

charts/amazon-cloudwatch-observability/templates/target-allocator-clusterrole.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{{- if or (and (hasKey ($customAgent.prometheus) "targetAllocator") (hasKey ($customAgent.prometheus.targetAllocator) "enabled") $customAgent.prometheus.targetAllocator.enabled) $otelCIScrape }}
1313
{{- $needsTA = true }}
1414
{{- end }}
15-
{{- if or (and (hasKey ($customAgent.prometheus) "targetAllocator") (hasKey ($customAgent.prometheus.targetAllocator) "prometheusCR") $customAgent.prometheus.targetAllocator.prometheusCR.enabled) $otelCIScrape }}
15+
{{- if or (and (hasKey ($customAgent.prometheus) "targetAllocator") (hasKey ($customAgent.prometheus.targetAllocator) "enabled") $customAgent.prometheus.targetAllocator.enabled (hasKey ($customAgent.prometheus.targetAllocator) "prometheusCR") $customAgent.prometheus.targetAllocator.prometheusCR.enabled) $otelCIScrape }}
1616
{{- $needsCR = true }}
1717
{{- end }}
1818
{{- end }}

0 commit comments

Comments
 (0)