← Back to Pull requests

fix(rbac): move TLS ClusterRole from ODH overlay to RHOAI-only overlay #167

Closed
unknown closed this pull request without merging on Aug 18, 2026 18:52 UTC
View on GitHub
unknown unknown commented on Aug 13, 2026 22:06 UTC
Author

Purpose of this PR

PR #156 added the spark-operator-tls-profile ClusterRole (covering config.openshift.io/apiservers) to config/overlays/odh/rbac/tls/. The module operator CI runs on Kind using the ODH overlay (platform detection defaults to OpenDataHub when OpenShift APIs are absent). Kubernetes RBAC escalation prevention blocks creating a ClusterRole that grants permissions the deploying SA doesn't already hold, causing every Spark Operator Module CI run since #156 to fail with:

unable to patch clusterroles.rbac.authorization.k8s.io "spark-operator-tls-profile" is forbidden:
user "system:serviceaccount:opendatahub:spark-operator-module-controller-manager"
is attempting to grant RBAC permissions not currently held

Proposed changes:

  • Move rbac/tls/ (ClusterRole + ClusterRoleBinding + kustomization) from config/overlays/odh/ to config/overlays/rhoai/

  • Remove the rbac/tls entry from config/overlays/odh/kustomization.yaml

  • Update config/overlays/rhoai/kustomization.yaml to reference its own rbac/tls instead of ../odh/rbac/tls
  • Change Category

  • Bugfix (non-breaking change which fixes an issue)
  • Rationale

    The RHOAI overlay is only deployed on OpenShift, where config.openshift.io exists and the ClusterRole is meaningful. The ODH overlay is used for both upstream Kind CI and non-RHOAI deployments, where the API group doesn't exist and the escalation check fails.

    This removes the root cause of the CI regression from #156 and makes the CI workaround in #166 unnecessary.

    Fixes: RHOAIENG-83301
    Supersedes: #166

    Checklist

  • I have conducted a self-review of my own code.

  • I have updated documentation accordingly.

  • I have added tests that prove my changes are effective or that my feature works.

  • Existing unit tests pass locally with my changes.
  • Additional Notes

    Verified via kustomize build:

  • ODH overlay: 0 occurrences of config.openshift.io (correct — Kind-compatible)

  • RHOAI overlay: 2 occurrences of config.openshift.io (correct — the TLS ClusterRole rules)
  • <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

    New Features
    Added permissions that enable the Spark operator to read OpenShift API server configuration.
    Applied these permissions to the Spark operator controller and webhook components.

    Configuration
    * Updated deployment overlays to use the dedicated TLS permissions configuration.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 320 lines (+240 / -80) across 4 files Reviewer: RobuRishabh Review duration: 7006m
    All Vouch review confidence checks passed
    Residual risk 0.26 = Change Risk (0.65) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.65 · 320 lines diff across 4 files
    0.65
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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
    Diff Size diff_size
    0.345
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.065
    Real PR Conversation Timeline
    1 comments
    "Review active on #167"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    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: 65.1% (HIGH) · Higher = larger blast radius
    65.1%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 25.7% · Safe to merge
    25.7%