fix: remove deprecated spec.preserveUnknownFields#644
Conversation
The preserveUnknownFields field is deprecated in CRD v1 and defaults to false. Explicitly setting it is unnecessary and triggers deprecation warnings. Signed-off-by: meskinemohamed <mohamed.meskine@dataiku.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #644 +/- ##
===========================================
- Coverage 54.68% 43.56% -11.12%
===========================================
Files 71 97 +26
Lines 5241 5380 +139
===========================================
- Hits 2866 2344 -522
- Misses 2073 2733 +660
- Partials 302 303 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR removes the deprecated spec.preserveUnknownFields field from CustomResourceDefinition (CRD) specifications. In CRD apiextensions.k8s.io/v1, this field defaults to false and has been deprecated in favor of using x-kubernetes-preserve-unknown-fields at the schema level.
- Removed
preserveUnknownFields: falsefrom ConstraintTemplate CRD definitions - Eliminated redundant kustomize patch that was setting this deprecated field
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| constraint/pkg/schema/yaml_constant.go | Removed deprecated preserveUnknownFields: false from the CRD YAML constant string |
| constraint/deploy/crds.yaml | Removed deprecated preserveUnknownFields: false from the deployed CRD manifest |
| constraint/config/crds/kustomization.yaml | Removed the entire kustomize patch section that was setting the deprecated field, reorganizing the file structure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@meskinemohamed these changes look good, thanks for working on this! can you run
After replcaing you will need to run go mod tidy && go mod vendor and then push changes to GK pr. |
da5c19c to
943cda7
Compare
Run make manifests && make generate to update generated files after removing deprecated spec.preserveUnknownFields. Signed-off-by: meskinemohamed <mohamed.meskine@dataiku.com>
spec.preserveUnknownFields: falsefrom CRD definitionsx-kubernetes-preserve-unknown-fieldsRelated to: