Skip to content
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

feat(api): Make PodTemplateSpec schemaless #77

Merged
merged 3 commits into from May 3, 2022

Conversation

irvinlim
Copy link
Member

@irvinlim irvinlim commented May 2, 2022

Addresses an issue mentioned in #63:

Another solution without needing to use a string is to use type: object in the CRD definition without properties, which prevents any schema validation. We could consider doing this for the PodTemplateSpec field currently as well.

By avoiding an embed of the core/v1 API types in the CRD's OpenAPI schema, we avoid a few problems:

  1. Unknown fields error/pruning of unknown fields when Furiko is embedding a higher API version than the API version of the apiserver
  2. Incorrect/incomplete schema from kubectl explain
  3. (unlikely) Support backwards-incompatible changes from one API version to the next

Also fixes the issue that metav1.ObjectMeta fields (when not at the root of a CRD) will not be able to store non-string values, because for some reason, the apiserver treats it as map[string]string rather than an Object.

@irvinlim irvinlim added the area/api Related to public APIs, including CRD design, configuration, etc label May 2, 2022
@codecov
Copy link

codecov bot commented May 2, 2022

Codecov Report

Merging #77 (dd91947) into main (480dd7a) will increase coverage by 0.05%.
The diff coverage is 82.50%.

@@            Coverage Diff             @@
##             main      #77      +/-   ##
==========================================
+ Coverage   62.53%   62.59%   +0.05%     
==========================================
  Files         196      197       +1     
  Lines        9838     9872      +34     
==========================================
+ Hits         6152     6179      +27     
- Misses       3373     3380       +7     
  Partials      313      313              
Impacted Files Coverage Δ
apis/execution/v1alpha1/job_types.go 100.00% <ø> (ø)
apis/execution/v1alpha1/zz_generated.deepcopy.go 60.48% <41.66%> (-0.47%) ⬇️
apis/execution/v1alpha1/task_types.go 100.00% <100.00%> (ø)
pkg/execution/mutation/mutation.go 88.08% <100.00%> (ø)
...ecution/taskexecutor/podtaskexecutor/pod_client.go 76.92% <100.00%> (ø)
pkg/execution/validation/validation.go 91.94% <100.00%> (+0.51%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 480dd7a...dd91947. Read the comment docs.

@irvinlim irvinlim merged commit b94aa78 into main May 3, 2022
@irvinlim irvinlim deleted the irvinlim/feat/schemaless-podtemplatespec branch May 3, 2022 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Related to public APIs, including CRD design, configuration, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant