fix(controller): keep driver ingress service names within the DNS label limit #3296
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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.345
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #3296"
general
weight: 0.35
tariq-hasan
Purpose of this PR
Fixes #3295
The Service created for each
driverIngressOptionsentry 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:
util.GetDriverIngressServiceNamehelper that builds the name with the existinggenerateNamehelper, the one the web UI Service and Ingress names already use.createDriverIngressServiceFromConfigurationand remove the oldgetDriverIngressServiceNamefunction.Change Category
Rationale
generateNamereturns 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 thedriver-<port>suffix.Checklist
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 -->