kubeflow / kubeflow/spark-operator

[FEATURE] Add tests covering CRD validation and JSON serialisation

Open
#2,284 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement lifecycle/frozen
Dominant language
Python
Stars
3.2k
Forks
1.5k
Avg merge
5d 10h
Merged PRs (30d)
13

Description

Community Note
  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
What is the outcome that you are trying to reach?

Avoid future bugs similar to what https://github.com/kubeflow/spark-operator/pull/2255 fixed.

Describe the solution you would like
  • Tests that ensure omitting spec or metadata in the SparkApplication fail CRD validation.
  • Tests that ensure optional fields still pass CRD validation after deserialization and re-serialisation by the validating webhook.

https://github.com/kubeflow/spark-operator/blob/0c49569afb2382738aabfe6ddbf5fddc577a6681/internal/webhook/sparkapplication_defaulter_test.go achieved this but was a kind of strange way to implement it.

Describe alternatives you have considered

No tests - pretty sure we don't want that.

Additional context

This is coming from discussion during PR review https://github.com/kubeflow/spark-operator/pull/2255#discussion_r1805931993 and I don't want it to get lost.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading internal/webhook/sparkapplication_defaulter_test.go and the discussion in PR 2255. Add coverage for missing spec or metadata failing CRD validation, and for optional fields surviving webhook deserialization and re-serialization while still passing validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
json, kubernetes
Domain
devops, testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.