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

resourcerecordset: Should set AliasTarget when check if it is up to date #1621

Merged
merged 1 commit into from
Jan 9, 2023

Conversation

july2993
Copy link
Contributor

@july2993 july2993 commented Jan 5, 2023

Description of your changes

When setting AliasTarget in v1alpha1.ResourceRecordSetParameters, IsUpToDate() will always return false since it does not fill up the field AliasTarget then CreatePatch will contain the part about AliasTarget when comparing with the expected state.

This will make it always try to do a useless update after observing the state.

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

Add unit test.
Note before fixing it, the first call of IsUpToDate in the added test case should be true, but it return false.

When setting `AliasTarget` in `v1alpha1.ResourceRecordSetParameters`, `IsUpToDate()`
will always return false since it do not fill up the field `AliasTarget`
then `CreatePatch` will contains the part about `AliasTarget` when
compare the the expect state.

This will make it always try to do a useless update after observing the
state.

Signed-off-by: Jiahao Huang <july2993@gmail.com>
@july2993
Copy link
Contributor Author

july2993 commented Jan 6, 2023

@haarchri
Would you help take a look

Copy link
Member

@haarchri haarchri left a comment

Choose a reason for hiding this comment

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

thanks for this fix

@haarchri haarchri merged commit 38d1abc into crossplane-contrib:master Jan 9, 2023
@july2993 july2993 deleted the alias branch January 9, 2023 06:45
@july2993 july2993 mentioned this pull request Mar 2, 2023
2 tasks
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