Skip to content
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

[Backport release-1.10] Fix EKS Cluster conversion by injecting index key when list #1680

Merged

Conversation

turkenh
Copy link
Contributor

@turkenh turkenh commented Feb 10, 2025

Note

Backport of #1669 to provider-aws-release-1.10.

Description of your changes

Fixes the issue described in crossplane/upjet#465

We have observed some issue with the EKS Cluster resource where when we apply the manifest and let it to resolve references to spec.forProvider.vpcConfig.securityGroupIds, we noticed the following error in the status:

  - lastTransitionTime: "2025-02-06T07:28:46Z"
    message: 'cannot patch the managed resource via server-side apply: Cluster.eks.aws.upbound.io
      "some-eks-cluster" is invalid: [spec.forProvider.vpcConfig: Invalid
      value: "null": spec.forProvider.vpcConfig in body must be of type array: "null",
      <nil>: Invalid value: "null": some validation rules were not checked because
      the object was invalid; correct the existing errors to complete validation]'
    reason: ReconcileError
    status: "False"
    type: Synced

Our assumption (which is validated by observing this changes fixes the problem) is as follows:

Server Side Apply uses merge strategies to make decisions during merging changes by various owners/managers. In EKS Cluster object, for vpcConfig field, we mark +listType as map and //+listMapKey as index. During conversion between v1beta1 to v1beta2, we convert the that field from array to object, losing the index field since it is not in the schema. This is fine in most cases since in v1beta1 of the object schema index defaults to "0" , even though you don’t provide it.

However, with Server Side Apply, apparently some on the fly conversions happening when different managers using different api versions and losing index field causing unexpected merging results and drop of the whole spec.forProvider.vpcConfig object.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Please see crossplane/upjet#465

turkenh and others added 2 commits February 10, 2025 10:40
Manual cherry pick of crossplane-contrib#1669

Signed-off-by: Hasan Turken <turkenh@gmail.com>
(cherry picked from commit c14e716)
Signed-off-by: Fatih Türken <turkenf@gmail.com>
(cherry picked from commit 631850a)
@turkenh turkenh force-pushed the backport-1669-to-release-1.10 branch from a4c002c to 76ac1e3 Compare February 10, 2025 07:40
@turkenh
Copy link
Contributor Author

turkenh commented Feb 10, 2025

/test-examples="examples/eks/v1beta2/cluster.yaml"

@turkenh
Copy link
Contributor Author

turkenh commented Feb 10, 2025

/test-examples="examples/s3/v1beta1/bucket.yaml"

Copy link
Collaborator

@turkenf turkenf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @turkenh, LGTM.

@turkenf turkenf merged commit 32a0a49 into crossplane-contrib:release-1.10 Feb 10, 2025
10 checks passed
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.

2 participants