Skip to content

Conversation

@eddygk
Copy link

@eddygk eddygk commented Oct 13, 2025

Which issue does this PR fix?
Fixes #3358

What does this PR do / Why do we need it?
Removes the deprecated spec.preserveUnknownFields field from all CRD definitions. This field was deprecated in Kubernetes 1.22 and causes resources to constantly fall out of sync when deploying via ArgoCD 3.0+, which removed default ignoring of this field.

The modern replacement x-kubernetes-preserve-unknown-fields: true is already present in the schema sections and will continue to function correctly.

Testing done on this change

  • Verified all occurrences of preserveUnknownFields have been removed (0 remaining)
  • Confirmed x-kubernetes-preserve-unknown-fields: true is still present in all CRD schemas
  • Reviewed YAML syntax and structure - all valid
  • Changes affect 5 files: source CRD and 4 regional manifests

Will this PR introduce any new dependencies?
No

Will this break upgrades or downgrades?
No - this only removes a deprecated field that was removed from Kubernetes 1.22+. Given K8s versions before 1.22 have been EOL for several years, this should not impact any supported clusters. The functionality is preserved through x-kubernetes-preserve-unknown-fields: true in the schema.

Does this change require updates to the CNI daemonset config files?
No

Does this PR introduce any user-facing change?

Removed deprecated spec.preserveUnknownFields field from CRDs (deprecated since Kubernetes 1.22). Resolves ArgoCD 3.0+ sync issues.

Removes spec.preserveUnknownFields field which was deprecated
in Kubernetes 1.22 and causes sync issues with ArgoCD 3.0+.

The replacement x-kubernetes-preserve-unknown-fields is already
in use within the schema and will continue to work correctly.

Fixes aws#3358
Copilot AI review requested due to automatic review settings October 13, 2025 16:30
@eddygk eddygk requested a review from a team as a code owner October 13, 2025 16:30
Copy link

Copilot AI left a 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 all CRD definitions to resolve sync issues with ArgoCD 3.0+. The field was deprecated in Kubernetes 1.22 and is no longer needed since the modern replacement x-kubernetes-preserve-unknown-fields: true is already present in the CRD schemas.

  • Removes preserveUnknownFields: false from 5 CRD manifest files
  • Maintains compatibility through existing x-kubernetes-preserve-unknown-fields: true in schemas
  • Resolves ArgoCD sync issues caused by the deprecated field

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
config/master/aws-k8s-cni.yaml Removes deprecated preserveUnknownFields from main CRD
config/master/aws-k8s-cni-us-gov-west-1.yaml Removes deprecated preserveUnknownFields from US Gov West region CRD
config/master/aws-k8s-cni-us-gov-east-1.yaml Removes deprecated preserveUnknownFields from US Gov East region CRD
config/master/aws-k8s-cni-cn.yaml Removes deprecated preserveUnknownFields from China region CRD
charts/aws-vpc-cni/crds/customresourcedefinition.yaml Removes deprecated preserveUnknownFields from Helm chart CRD

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove deprecated preserveUnknownFields field from CRDs

1 participant