Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
🎉 Welcome to the Kubeflow Spark Operator! 🎉 Thanks for opening your first PR! We're happy to have you as part of our community 🚀 Here's what happens next:
Join the community:
Feel free to ask questions in the comments if you need any help or clarification! |
df25f16 to
3168eed
Compare
|
/ok-to-test |
Rejections reach users as flat, hand-written sentences that name no field, so kubectl prints one opaque line and clients cannot tell which part of the spec to fix. Emitting apimachinery field errors lets the API server render a per-field cause list, and gives the follow-up aggregation work a list to accumulate into. Signed-off-by: rjgoyln <pt40419@gmail.com>
3168eed to
10c6f29
Compare
Summary
Webhook validators currently reject invalid resources with hand-written error messages that do not identify the offending field. As a result,
kubectlprints an opaque error and clients cannot determine which part of the spec needs to be fixed.Emitting
k8s.io/apimachineryfield errors allows the API server to return structured, per-field validation causes.Closes #3131.
Change
field.ErrorList, which is wrapped withapierrors.NewInvalidat the admission entry points.SparkConfKeyDeniedErroris replaced withfield.Forbiddenon the offendingspec.sparkConfkey.NewForbidden, while a failed quota lookup is returned withNewInternalError, since neither represents an invalid field.Fail-fast behavior is preserved, so
causesnormally contains one entry; error aggregation is tracked separately in #3133.SparkApplication still does not validate
spec.driver.memoryorspec.executor.memory, so an unparseable value is not reported with a field path. Adding this validation would reject specs that are currently accepted, so it is left for a follow-up.Behavior change
Validation rejections that identify a bad field now return
422 Invalidwith per-fielddetails.causes. Previously, all webhook rejections were returned as403 Forbiddenwith a single error message.An exhausted ResourceQuota remains
403 Forbidden.Change Category
Checklist
🤖 Generated with Claude Code