← Back to Pull requests

CNV-101845: grant the monitoring-plugin SA the read-only RBAC required by the alerts management API #3194

Open
unknown opened this pull request with 239 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 25, 2026 14:24 UTC
Author

CMO creates the read-only RBAC that the monitoring-plugin service
account needs to serve the alerts management API. Both the RBAC
and the alert-management-api plugin flag follow the AlertManagement
feature gate (registered in openshift/api#3203) and are removed
when the gate is disabled:

  • ClusterRole: read-only access to prometheusrules and namespaces.

  • Role in openshift-monitoring: read-only access to alertingrules,

  • alertrelabelconfigs, configmaps, leases, the
    alert-relabel-configs secret and the alertmanager-main and
    prometheus-k8s routes.
  • Role in openshift-user-workload-monitoring: read-only access to

  • the alertmanager-user-workload route, created only while user
    workload monitoring is enabled.

    The permissions mirror what the plugin's background collectors
    use (rule informers, metrics collector, health endpoint). Reads
    and mutations through the API run with the requesting user's
    token.

    On clusters where the gate isn't registered yet, the operator
    treats it as disabled. The operator also gets create/get/update
    permissions on leases: RBAC's privilege escalation admission
    requires it to hold every permission it grants to the plugin's
    service account.

    Jira: https://issues.redhat.com/browse/CNV-101845
    Enhancement: openshift/enhancements#1822
    Feature gate: openshift/api#3203
    Plugin: openshift/monitoring-plugin#1172

    Validation passed:

  • go build ./pkg/... ./cmd/...

  • go vet and go test on pkg/manifests, pkg/tasks and pkg/operator

  • golangci-lint run (no new issues)

  • yamllint on the changed assets

  • make check-assets

  • make jsonnet-fmt and make build-jsonnet (generated files in sync)
  • Telemetry report

    Not applicable: this change does not modify telemetry collection selectors in manifests/0000_50_cluster-monitoring-operator_04-config.yaml.

    Signed-off-by: Shirly Radco <sradco@redhat.com>
    Co-authored-by: GLM <noreply@z.ai>

    Diff: 239 lines (+179 / -60) across 2 files Reviewer: sradco Review duration: 12902m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 239 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.328
    Real PR Conversation Timeline
    1 comments
    "Review active on #3194"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 37.2% (MEDIUM) · Higher = larger blast radius
    37.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.9% · Safe to merge
    19.9%