← Back to Pull requests

fix(spark-operator-module): select ODH/RHOAI overlay from injected pl… #168

Closed
unknown closed this pull request without merging on Aug 20, 2026 03:26 UTC
View on GitHub
unknown unknown commented on Aug 19, 2026 17:55 UTC
Author

Purpose of this PR

Spark Operator on RHOAI Self-Managed crash-loops because the module controller probes OLM to decide ODH vs RHOAI, gets forbidden on catalogsources, and silently falls back to the ODH overlay. The TLS ClusterRole (spark-operator-tls-profile) lives only in the RHOAI overlay, so it is never applied. Controller and webhook then fail to watch apiservers.config.openshift.io and never become Ready.

Proposed changes:

  • Stop calling cluster.DetectPlatform / OLM. Pick config/overlays/odh vs config/overlays/rhoai from ODH_MODULE_OPERATOR_PLATFORM_TYPE (fallback: ODH_PLATFORM_TYPE). Namespace from APPLICATIONS_NAMESPACE only.

  • Allow bind/escalate on spark-operator-tls-profile so the module can apply the RHOAI TLS ClusterRoleBinding.

  • Add unit tests for overlay and namespace selection from injected env.
  • Change Category

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

  • Feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that could affect existing functionality)

  • Documentation update
  • Rationale

    opendatahub-operator already injects ODH_MODULE_OPERATOR_PLATFORM_TYPE and APPLICATIONS_NAMESPACE into module Deployments (injectModuleEnv). KServe uses that and a single OpenShift overlay. Spark was re-detecting platform, reading the wrong env name (ODH_PLATFORM_TYPE), and defaulting to ODH on any error. No overlay merge: RHOAI still gets the RHOAI overlay (including TLS RBAC).

    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 locally:

    make test-spark-operator-module
    make precommit-som
    

    After merge, bump the sparkoperator SHA in opendatahub-operator (build/manifests-config.yaml / manifests-config.yaml) so RHOAI 3.6 picks up the new module RBAC and binary. No logic change is required in opendatahub-operator for this fix.

    Diff: 269 lines (+201 / -68) across 3 files Reviewer: RobuRishabh Review duration: 571m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 269 lines diff across 3 files
    0.39
    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.335
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #168"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 39.4% (MEDIUM) · Higher = larger blast radius
    39.4%
    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: 15.6% · Safe to merge
    15.6%