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

Set the ID string to empty string on Terraform state for calculating the diffs #337

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

ulucinar
Copy link
Collaborator

@ulucinar ulucinar commented Jan 31, 2024

Description of your changes

It turns out that using a nil terraform.InstanceState for new resources while calculating the terraform.InstanceDiff breaks the verify.SetTagsDiff implementation. This PR resets the Terraform ID string to the empty string in terraform.InstanceState passed down to the noForkExternal.getResourceDataDiff so that the issue first observed in the CustomizeDiff implementation of ReplicationGroup.elasticache is resolved.

I have:

  • Read and followed Upjet'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

Tested via uptest in crossplane-contrib/provider-upjet-aws#1119: https://github.com/upbound/provider-aws/actions/runs/7729719052/job/21073558871

…the diffs

when the resource does not yet exist.

Signed-off-by: Alper Rifat Ulucinar <[email protected]>
@ulucinar ulucinar marked this pull request as draft January 31, 2024 16:17
@ulucinar ulucinar marked this pull request as ready for review January 31, 2024 17:16
Copy link
Member

@sergenyalcin sergenyalcin left a comment

Choose a reason for hiding this comment

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

Thanks @ulucinar LGTM!

@ulucinar ulucinar merged commit 3c2fda9 into crossplane:main Jan 31, 2024
7 checks passed
@ulucinar ulucinar deleted the fix-settagdiff-panic branch January 31, 2024 17:32
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