Repository navigation
Remove deprecated preserveUnknownFields from CRD manifests - #11
Merged
Merged
Conversation
Closed
Fixes #10. The spec.preserveUnknownFields field is deprecated in apiextensions.k8s.io/v1 and omitted from stored objects when false, causing ArgoCD to report a perpetual OutOfSync diff. Removing it is behavior-neutral (pruning is the only supported mode in v1) and controller-gen v0.13.0 (pinned in the Makefile) never emits it, so removing it from the CRD source guarantees regenerated manifests stay clean. A CI guard in the build workflow now fails if the field is ever reintroduced into manifest.yaml. Co-authored-by: fredleger <2778741+fredleger@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix argocd app sync issue with preserveUnknownFields
Remove deprecated preserveUnknownFields from CRD manifests
Oct 18, 2026
fredleger
requested changes
Oct 18, 2026
|
@copilot handle feedbacks |
Per review on #11: the verification that controller-gen v0.13.0 never re-emits spec.preserveUnknownFields is sufficient; no dedicated CI check is needed. Reverts .github/workflows/build.yaml to its original state. The actual fix (removing the deprecated field from the CRD source and the generated manifest) is unchanged. Co-authored-by: fredleger <2778741+fredleger@users.noreply.github.com>
Author
All feedback is handled. The only review comment (removing the CI guard from |
fredleger
approved these changes
Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
ArgoCD apps pointing at
manifest.yamlsit in perpetual OutOfSync: the diff showspreserveUnknownFields: falseon the ClusterPullSecret CRD.Root cause:
spec.preserveUnknownFieldsis deprecated inapiextensions.k8s.io/v1(per the upstream API type docs) and is aboolwithomitempty— the API server strips it from stored objects whenfalse, so the desired manifest always carries a line the live object never has. Removal is behavior-neutral: with a structural schema, pruning unknown fields is the only supported mode in v1;falseis implicit.Changes:
config/crd/bases/ops.alexellis.io_clusterpullsecrets.yaml— dropped the field at the source. Editing onlymanifest.yamlwould be overwritten by the nextmake shrinkwrap(release workflow regenerates it from here).manifest.yaml— dropped the same line; verified byte-identical tokustomize build config/defaultoutput (modulo image tag)..github/workflows/build.yaml— guard in the existing "Apply manifests" step so a reintroduction fails CI:Regression risk is low: verified in the pinned controller-gen v0.13.0 source (
pkg/crd/spec.go) that CRD spec construction never sets this field — it's a leftover from an ancient generator version, and only the per-schemax-kubernetes-preserve-unknown-fieldsmarker survives in v0.13.0.Which issue # does this fix? And was it approved before you worked on it?
Checklist:
Note: if the PR is for a typo, please close it and raise an issue instead.
How Has This Been Tested?
kustomize build config/defaultoutput diffed against the updatedmanifest.yaml— identical (modulo image tag), zero occurrences of the field.go build ./...andgo vet ./...pass. No unit test files exist in the repo; the e2e path runs in the build workflow against a kind cluster, which now also applies the cleaned manifest.How are existing users impacted? What migration steps/scripts do we need?
None. The field was a no-op — pruning behavior is unchanged. Users applying
manifest.yamldirectly or via GitOps (ArgoCD/Flux) will simply see the perpetual diff disappear on next sync. No data migration, no CRD version bump.Checklist:
I have:
git commit -s