-
Notifications
You must be signed in to change notification settings - Fork 838
fix: remove deprecated spec.preserveUnknownFields #4276
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
base: master
Are you sure you want to change the base?
fix: remove deprecated spec.preserveUnknownFields #4276
Conversation
9ce277a to
96e39cd
Compare
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.
Pull request overview
This PR removes the deprecated spec.preserveUnknownFields field from Kubernetes Custom Resource Definitions (CRDs) and updates the corresponding kubebuilder markers to use the newer syntax.
- Removes
preserveUnknownFields: falsefrom all CRD manifests - Updates kubebuilder markers from
+kubebuilder:validation:XPreserveUnknownFieldsto+kubebuilder:pruning:PreserveUnknownFields - Removes the kustomization patch that was applying the deprecated field
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| manifest_staging/deploy/gatekeeper.yaml | Removes deprecated preserveUnknownFields: false from 16 CRD definitions in the main deployment manifest |
| manifest_staging/charts/gatekeeper/crds/*.yaml (17 files) | Removes deprecated preserveUnknownFields: false from individual CRD chart files |
| config/crd/patches/preserve_unknown_fields_false.yaml | Deletes the patch file that was adding the deprecated field |
| config/crd/kustomization.yaml | Removes the kustomization patch reference for preserve_unknown_fields_false.yaml |
| apis/mutations/v1/value.go | Updates kubebuilder marker to new pruning syntax |
| apis/mutations/v1/modifyset_types.go | Updates kubebuilder marker to new pruning syntax |
| apis/mutations/v1alpha1/value.go | Updates kubebuilder marker to new pruning syntax |
| apis/mutations/v1alpha1/modifyset_types.go | Updates kubebuilder marker to new pruning syntax |
| apis/mutations/v1beta1/value.go | Updates kubebuilder marker to new pruning syntax |
| apis/mutations/v1beta1/modifyset_types.go | Updates kubebuilder marker to new pruning syntax |
| apis/mutations/unversioned/value.go | Updates kubebuilder marker to new pruning syntax |
| apis/mutations/unversioned/modifyset_types.go | Updates kubebuilder marker to new pruning syntax |
| apis/connection/v1alpha1/connection_types.go | Updates kubebuilder marker to new pruning syntax |
|
@meskinemohamed yeah please open a PR in frameworks as well and link it here. |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #4276 +/- ##
===========================================
- Coverage 54.49% 40.73% -13.77%
===========================================
Files 134 251 +117
Lines 12329 17723 +5394
===========================================
+ Hits 6719 7219 +500
- Misses 5116 9881 +4765
- Partials 494 623 +129
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:
|
|
@JaydipGabani Done, PR is available here thanks ! |
JaydipGabani
left a comment
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.
These changes looks good, please address this comment - open-policy-agent/frameworks#644 (comment) and also resolve conflict.
795da52 to
1a0ab5f
Compare
go.mod
Outdated
| sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect | ||
| ) | ||
|
|
||
| replace github.com/open-policy-agent/frameworks/constraint => github.com/meskinemohamed/frameworks/constraint v0.0.0-20251210214342-3fd8922d7fc4 |
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.
Just making a note to remove this and bump frameworks before merging this PR.
|
@meskinemohamed can you run |
- Remove preserveUnknownFields from all CRD definitions (deprecated in k8s 1.16+) - Remove config/crd/patches/preserve_unknown_fields_false.yaml patch file - Remove patch reference from config/crd/kustomization.yaml - Update kubebuilder annotations from +kubebuilder:validation:XPreserveUnknownFields to +kubebuilder:pruning:PreserveUnknownFields per KubeBuilder docs - Update frameworks/constraint to use fork with fix for regenerated manifests - Regenerate manifests Fixes open-policy-agent#3996 Signed-off-by: meskinemohamed <mohamed.meskine@dataiku.com>
3be7e0e to
8237e88
Compare
Fixes #3996
Also, I think we need to edit the constraints in framework, I can open a PR if need ?