crossplane-contrib / provider-upjet-aws

Official AWS Provider for Crossplane by Upbound.
https://marketplace.upbound.io/providers/upbound/provider-aws
Apache License 2.0
137 stars 113 forks source link

[Bug]: fields in Init provider are not ignored #1260

Closed MichaelHarden closed 1 week ago

MichaelHarden commented 2 months ago

Is there an existing issue for this?

Affected Resource(s)

Resource MRs required to reproduce the bug

apiVersion: dynamodb.aws.upbound.io/v1beta1 kind: Table metadata: name: test-initprovider spec: forProvider: attribute:

Steps to Reproduce

  1. Apply the MR.
  2. In AWS change read or write capacity to something else.
  3. Observe Crossplane will re-sync and reset read and write capacity back to 1

What happened?

Since read and write capacity was set in the InitProvider and not ForProvider i would expect Crossplane to ignore future changes to these parameters. But, when changes are made to the read and write capacity, apart from the Crossplane MR, Crossplane continuously resets the values back.

Relevant Error Output Snippet

No response

Crossplane Version

v1.15.0

Provider Version

v1.3.1

Kubernetes Version

v1.28, v1.21

Kubernetes Distribution

K3D and EKS

Additional Info

No response

nsilve commented 2 months ago

I have faced the same issue with another resource. I believe that documentation is not very clear, but you can overcome this issue by removing the LateInitialize management policy.

MichaelHarden commented 1 week ago

Eventually figured this out. The way around this is to change the management policy on the MR to:

managementPolicies: 
            - "Create"
            - "Update"
            - "Delete"
            - "Observe"

This allows for initProvider to not update the forProvider while also maintaining the forProvider's drift protection.