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

Do not issue update when diff is nil vs empty for either slices or maps #172

Merged
merged 2 commits into from
Feb 13, 2020

Conversation

hasheddan
Copy link
Member

Signed-off-by: hasheddan georgedanielmangum@gmail.com

Description of your changes

Follow up on #166 that causes our comparison functions to treat all maps and slices with a length of zero to be equal, regardless of whether they are nil. I ran into a constantly updating instance that was being triggered by this check. I don't think it should cause any problems with needing an update when a slice or map has changed (i.e. if it either was of length zero or will be of length zero then it by definition had to change its length, meaning this check will produce a diff).

Checklist

I have:

  • Run make reviewable to ensure this PR is ready for review.
  • Ensured this PR contains a neat, self documenting set of commits.
  • Updated any relevant documentation, examples, or release notes.
  • Updated the dependencies in app.yaml to include any new role permissions.
  • Updated the stack resources documentation to include any new managed resources or classes.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
@hasheddan hasheddan requested review from negz and muvaf February 13, 2020 06:20
@@ -110,6 +110,7 @@ func GenerateDatabaseInstance(name string, in v1beta1.CloudSQLInstanceParameters
ExpirationTime: gcp.StringValue(val.ExpirationTime),
Name: gcp.StringValue(val.Name),
Value: gcp.StringValue(val.Value),
Kind: "sql#aclEntry",
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: anywhere where we fully replace a struct when it is not nil, we need to make sure that we include all fields like this. I checked CloudMemorystore, GKECluster, and NodePool for similar issues and did not find any.

Copy link
Member

Choose a reason for hiding this comment

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

ACLEntry. I think that might be a high level API resource that I was planning to implement a controller for during bucket stuff #137

Copy link
Member

Choose a reason for hiding this comment

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

Though this PR is not the right place to do it right now. So, my comment is not blocking

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
@upbound-bot
Copy link
Collaborator

59% (+0.01%) vs master 59%

@upbound-bot
Copy link
Collaborator

59% (+0.01%) vs master 59%

@negz negz merged commit ed11930 into crossplane-contrib:master Feb 13, 2020
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.

4 participants