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

core: don't check any parts of a computed set in InstanceDiff.Same #7205

Merged
merged 3 commits into from
Jun 17, 2016

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Jun 16, 2016

When checking for "same" values in a computed hash, not only might some
of the values differ between versions changing the hash, but there may be
fields not included at all in the original map, and different overall
counts.

Instead of trying to match individual set fields with different hashes,
remove any hashed key longer than the computed key with the same base
name.

Fixes #2027 (and hopefully a number of other "diffs didn't match during apply" issues)

When checking for "same" values in a computed hash, not only might some
of the values differ between versions changing the hash, but there may be
fields not included at all in the original map, and different overall
counts.

Instead of trying to match individual set fields with different hashes,
remove any hashed key longer than the computed key with the same base
name.
parts := strings.Split(k, ".")
parts2 := strings.Split(k, ".")
parts2 := append([]string(nil), parts...)
Copy link
Contributor

Choose a reason for hiding this comment

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

The append with []string(nil) base is a new one on me - looks like it makes sure parts2 is a freshly allocated slice?

Copy link
Member Author

Choose a reason for hiding this comment

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

yup! equivalent to parts2 := make([]string, len(parts)); copy(parts2, parts)

@phinze
Copy link
Contributor

phinze commented Jun 17, 2016

After chatting on phone about detail - this LGTM!

@ghost
Copy link

ghost commented Apr 25, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 25, 2020
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_security_group - diffs didn't match
3 participants