-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Update Knative Serving schema #13095
Conversation
I'm also seeing if we can upstream our |
/assign @nader-ziada |
Codecov Report
@@ Coverage Diff @@
## main #13095 +/- ##
==========================================
- Coverage 87.05% 86.77% -0.29%
==========================================
Files 197 197
Lines 14443 14477 +34
==========================================
- Hits 12573 12562 -11
- Misses 1576 1619 +43
- Partials 294 296 +2
Continue to review full report at Codecov.
|
looks like the failures in e2e are legit |
the serving install fails on the kind cluster before running the tests |
Yeah looks like the generated Schema is invalid - will take a look tomorrow |
/test build-tests_serving_main |
1 similar comment
/test build-tests_serving_main |
Just checking which version of the branch is being pulled from the go cache /test build-tests_serving_main |
/assign @evankanderson for conformance test changes |
lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pruning seems like unexpected behavior -- for example, if I write:
...
posts:
- port: 5000
name: http
Having Knative attempt to start my pod and eventually fail the health check seems less useful than "Hey dummy, what is posts
, I don't know about it."
Is there a way to error on fields not in the schema?
Unfortunately no and to catch these errors would mean you would have to preserve fields and still validate with webhooks. Also to preserve unknown fields while having the entire spec defined means you would need excess (with pruning) It does buy contributors some benefits
|
/assign @psschwei since Nader's OOO |
Testing this, I followed the structural schema validation example, and defined the CRD they mentioned. I then defined a custom resources where I mis-spelled apiVersion: "stable.example.com/v1"
kind: CronTab
metadata:
name: my-new-cron-object
spec:
cronSpec: "* * * * *"
image: my-awesome-cron-image
replica: 15 Running
But, it turns out this error is client-side, and if I pass Since the Knative spec was an attempt to back-document the Kubernetes apiserver behavior, I think we'd have to give this one a pass for now, but I'd love it if @dprotaso could file an issue upstream asking for a "validation means validation, not silently make my request something different" feature. |
Created an upstream issue here: kubernetes/kubernetes#111074 |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dprotaso, evankanderson 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 |
fix (issue knative#14231): DEVELOPMENT.md is outdated * As part of Fix knative#13095 it seems like both allowedFields from preserveUnknownFields in schemapatch-config.yaml. Hence, updated DEVELOPMENT.md to drop references to these 2 fields.
Updated DEVELOPMENT.md * As part of Fix knative#13095 it seems like both `allowedFields` and `preserveUnknownFields` were removed from [schemapatch-config.yaml](https://github.com/knative/serving/blob/main/hack/schemapatch-config.yaml). Hence, updated [DEVELOPMENT.md](https://github.com/knative/serving/blob/main/DEVELOPMENT.md) to drop references to these 2 fields.
…rveUnknownFields (#14865) * Fixes #14231 Updated DEVELOPMENT.md * As part of Fix #13095 it seems like both `allowedFields` and `preserveUnknownFields` were removed from [schemapatch-config.yaml](https://github.com/knative/serving/blob/main/hack/schemapatch-config.yaml). Hence, updated [DEVELOPMENT.md](https://github.com/knative/serving/blob/main/DEVELOPMENT.md) to drop references to these 2 fields. * Update DEVELOPMENT.md Documented usage of kubebuilder:validation:DropProperties and kubebuilder:pruning:PreserveUnknownFields with example * Update DEVELOPMENT.md Added comment Co-authored-by: Paul Schweigert <[email protected]> * Update DEVELOPMENT.md Co-authored-by: Paul Schweigert <[email protected]> --------- Co-authored-by: Paul Schweigert <[email protected]>
Part of #11980
Proposed Changes
x-kubernetes-preserve-unknown-fields
markers further down in the schema to the properties behind feature flagscontainerConcurrency
Release Note