Skip to content

Treat all maps & slices of zero-length equal whether they are nil or not in managed.APISimpleReferenceResolver#618

Merged
turkenh merged 1 commit intocrossplane:masterfrom
ulucinar:fix-617
Dec 5, 2023
Merged

Treat all maps & slices of zero-length equal whether they are nil or not in managed.APISimpleReferenceResolver#618
turkenh merged 1 commit intocrossplane:masterfrom
ulucinar:fix-617

Conversation

@ulucinar
Copy link
Contributor

@ulucinar ulucinar commented Dec 4, 2023

Description of your changes

Fixes #617

This PR passes the cmpopts.EquateEmpty() option when the managed.APISimpleReferenceResolver is checking whether any reference fields (Ref fields if a label selector is specified and the reference target fields) have been set by the downstreamResolveReferences call, so that all maps & slices of zero-length will be considered as equal whether they are nil or empty.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Tested with a custom build of upbound/provider-aws.

…not in managed.APISimpleReferenceResolver

Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
@ulucinar ulucinar requested review from a team as code owners December 4, 2023 15:51
@ulucinar ulucinar requested review from ezgidemirel and negz December 4, 2023 15:51
Copy link
Member

@turkenh turkenh 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 @ulucinar 🙌

@turkenh turkenh merged commit 4697781 into crossplane:master Dec 5, 2023
@ulucinar ulucinar deleted the fix-617 branch December 5, 2023 11:19
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.

Treat all maps & slices of zero-length equal whether they are nil or not in managed.APISimpleReferenceResolver

2 participants