-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
omitempty
corrections
#2255
omitempty
corrections
#2255
Conversation
6b26711
to
284d5ab
Compare
@Tom-Newton Since v2, we use kubebuilder to create api for SparkApplication/SchedulerSparkApplication with the command like follows: kubebuilder create api --version v1beta2 --kind SparkApplication and the |
Thanks for the info. Does that mean that mean we should keep them as they were? or is there somewhere else that is source of truth to mark them as required when running |
I think it is better to keep the metadata and spec annotations as default unless there is a good reason. For many other types, such as the ones in the kubeflow/training-operator, the |
The serviceType in driverIngressConfigurations also need to add spark-operator/api/v1beta2/sparkapplication_types.go Lines 313 to 315 in 1491550
|
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Yes, I think I got that one https://github.com/kubeflow/spark-operator/pull/2255/files#diff-fae12edea9174bb072c60830180dc6e65aeaf098de9dfb7ac69240c3e1c347b1R315 |
My reasoning is:
Let me know if you think these constitute good reason - if not I'll revert them. |
9674cfc
to
18e0e3d
Compare
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
18e0e3d
to
df0cc95
Compare
|
From my testing that is not correct. If I use the use the following config
and I test against
and I see from the webhook logs that this did call the webhook
BTW with this change the second of those validation errors would go away.
This is exactly what removing the |
I have just tested it and you are right. The webhook is called and the |
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
d1c4946
to
a1c249c
Compare
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
8f5b549
to
8a591fd
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ChenYi015 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@Tom-Newton Well done! Thanks for reporting the issue and fixing it. |
Thanks for reviewing 🙂 |
Purpose of this PR
Some corrections to make a couple of required fields required and optional fields genuinely optional.
Proposed changes:
sparkUIOptions
have become required #2215. This problem was caused by some optional fields in the CRD not usingomitempty
. That meant that validSparkApplication
configs gotnull
s added were they weren't allowed during some encode and decode in the SparkApplication default webhook.\+optional\n^(?!.*omitempty).*$
to find all the optional parameters that don't useomitempty
and addomitempty
to them, to avoid the same problem in other places.omitempty
onmetadata
andspec
fields ofSparkApplication
andScheduledSparkApplication
. I think these should be required and they used to be in the past. and I suspect this may have been changed accidentally. Obviously let me know if there is good reason to addomitempty
on these.mainApplicationFile
a required fieldWrite unittests for both of the above. I wasn't really sure how to do this but I came up with something. I don't know if its a good way to do it, but it adds the required coverage. My approach was to read the openapiv3 schema from the CRD and validate against that.Ended up removing this maybe we can add something better as a follow up.Change Category
Indicate the type of change by marking the applicable boxes:
Checklist
Before submitting your PR, please review the following:
make build-api-docs
to capture makingmainApplicationFile
required.Additional Notes
I'm still a
golang
noob.