[helm][kuberay-operator] Don't emit empty ServiceMonitor labels; rename selector -> additionalLabels #4979
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.62) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.62 · 251 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.331
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.062
Real PR Conversation Timeline
1 comments
"Review active on #4979"
general
weight: 0.35
Future-Outlier
Why are these changes needed?
Two fixes to
helm-chart/kuberay-operator/templates/servicemonitor.yaml:1. Don't emit an empty
labels:blockThe template unconditionally rendered a
labels:key:With the default (empty) value, this produced an empty
metadata.labels, which doesn't match what Kubernetes actually stores on the object. As a result ArgoCD reports the ServiceMonitor asOutOfSync. Thelabels:key is now wrapped in{{- with }}so it's only emitted when labels are actually configured.2. Rename
selector→additionalLabels.Values.metrics.serviceMonitor.selectorpopulates the ServiceMonitor'smetadata.labels— it is not a selector. The name was confusing because:spec.selector(which selects the Service to scrape).The value exists so that Prometheus can discover this ServiceMonitor via its
serviceMonitorSelector(e.g.release: prometheusfor kube-prometheus-stack).additionalLabelsmatches the convention used by other charts (e.g. kube-prometheus-stack) and describes what the field actually does.Related issue number
<!-- For example: "Closes #1234" -->
Checks
values.yamland the helm-docs-generatedREADME.mdrow were updated to match. Verified withhelm lint(passes) andhelm template:additionalLabels→ nolabels:key rendered.additionalLabels.release=prometheus→metadata.labels.release: prometheusrendered.🤖 Generated with Claude Code