fix: remove preserveUnknownFields to avoid OutOfSync in ArgoCD #3498
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix(argo-rollouts): remove
spec.preserveUnknownFieldsfrom CRDs to avoid Argo CD OutOfSyncWhat
Remove the
spec.preserveUnknownFields: falsekey from all Argo Rollouts CRD templates.Why
apiextensions.k8s.io/v1,spec.preserveUnknownFieldsis deprecated/invalid and the behavior must be expressed with the OpenAPI extensionx-kubernetes-preserve-unknown-fieldsinside the schema. Using the top-level field causes drift between desired and live objects. ([Kubernetes][1])spec.preserveUnknownFields: falsewill show as OutOfSync and recommends removing the field. ([Argo CD][2])Impact
How I validated
spec.preserveUnknownFields: false; removing the key restored a clean sync. (There’s also active community demand to drop the field.) ([GitHub][4])Notes for Maintainers
I have not completed the checklist (version bump, docs, changelog, etc.). I’m short on time to go through the full contribution process, but this is a minimal, safe fix that prevents avoidable OutOfSync states for everyone using Argo CD. Please apply the change on your side and handle versioning/changelog as you see fit.