furiko-io / furiko

Kubernetes cron and batch job platform
https://furiko.io
Apache License 2.0
484 stars 21 forks source link

feat(api): Make PodTemplateSpec schemaless #77

Closed irvinlim closed 2 years ago

irvinlim commented 2 years ago

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.

codecov[bot] commented 2 years ago

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%) :arrow_down:
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%) :arrow_up:

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.