← Back to Pull requests

fix(controller): keep driver ingress service names within the DNS label limit #3296

Open
unknown opened this pull request with 317 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 07, 2026 19:12 UTC
Author

Purpose of this PR

Fixes #3295

The Service created for each driverIngressOptions entry was named <app>-driver-<port> with no length handling. With the 63-character name limit in the webhook, any application name of 52 characters or more and a 4-digit port produced a name the API server rejects, and the application stayed SUBMITTED after the driver finished.

Proposed changes:

  • Add a util.GetDriverIngressServiceName helper that builds the name with the existing generateName helper, the one the web UI Service and Ingress names already use.

  • Use it in createDriverIngressServiceFromConfiguration and remove the old getDriverIngressServiceName function.

  • Add a unit test for the helper and an envtest case that reconciles a submitted application with a 63-character name and checks the driver ingress Service is created.
  • 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

    generateName returns the name unchanged when it fits in 63 characters, so Services for existing applications keep their current names. Only names that could never be created before are shortened, to the first characters of the application name, an 8-character hash and the driver-<port> suffix.

    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

    With the fix reverted, both new tests fail: the unit test reports that the name must be no more than 63 characters, and the envtest case fails with the same API server rejection quoted in the issue. go test ./pkg/util/ ./internal/controller/sparkapplication/ passes with the fix, and golangci-lint v2.1.6 reports 0 issues on both packages.

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Bug Fixes
    Driver ingress services can now be created for SparkApplications with long names, including names at the maximum supported length.
    * Generated service names remain valid and distinct across configured driver ingress ports, including common ports such as 4040 and 65535.

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

    Diff: 317 lines (+237 / -80) across 3 files Reviewer: tariq-hasan Review duration: 33040m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.40) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 317 lines diff across 3 files
    0.40
    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
    Diff Size diff_size
    0.345
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #3296"
    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: 40.4% (MEDIUM) · Higher = larger blast radius
    40.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: 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: 21.5% · Safe to merge
    21.5%