Skip to content

Conversation

jaypipes
Copy link
Collaborator

Although it's not what I wanted and isn't the most efficient thing we
could do, I'm implementing the slice of struct and map of struct
comparisons using reflect.DeepEqual. Long-term, I'd like to enable our
generator-config CompareConfig for nested struct fields, and to do that
we cannot use reflect.DeepEqual, however for the time-being, since
slice and map of struct is a hole in our delta logic, I'm pushing up
this workaround.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

The `pkg/generate/code.CompareResource` function did not have a
docstring indicating what the expected output Go code is. Added it and
removed some extra blank newlines that were being injected into the
output code erroneously.
Although it's not what I wanted and isn't the most efficient thing we
could do, I'm implementing the slice of struct and map of struct
comparisons using `reflect.DeepEqual`. Long-term, I'd like to enable our
generator-config CompareConfig for nested struct fields, and to do that
we cannot use `reflect.DeepEqual`, however for the time-being, since
slice and map of struct is a hole in our delta logic, I'm pushing up
this workaround.
@RedbackThomson
Copy link
Contributor

Worth noting that DeepEqual will return false if the slices are ordered differently. This means our systems require determinism in all slices, and we would expect the same from the services.

I'm happy with this call for now. Functionality >> Performance with delta right now.

/approve

Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

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

/lgtm

@ack-bot ack-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 17, 2021
@ack-bot
Copy link
Collaborator

ack-bot commented Aug 17, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: A-Hilaly, jaypipes, RedbackThomson, vijtrip2

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [A-Hilaly,RedbackThomson,jaypipes,vijtrip2]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-bot ack-bot merged commit db2aa58 into aws-controllers-k8s:main Aug 17, 2021
@jaypipes
Copy link
Collaborator Author

Worth noting that DeepEqual will return false if the slices are ordered differently. This means our systems require determinism in all slices, and we would expect the same from the services.

Yeah, exactly. And that was a bridge too far for me to implement at this juncture... thus, this hack :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants