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

[Backward Incompatible] Modifying Hash function to be consistent #61

Merged
merged 3 commits into from
Aug 2, 2019

Conversation

anandswaminathan
Copy link
Contributor

Currently, whenever we upgrade "client-go", "apimachinery", "api" the hash value also changes.

This PR changes the hashing mechanism

I have tested this across these two SHAs - 9aaa992bf12ecd0577a4b0f7dfb1c248a93d47ea and f9206646aaffb7763657ec9e794bc979b0b4722b. The hash does not change.

@mwylde
Copy link
Contributor

mwylde commented Jul 31, 2019

This change makes the hash sensitive to the order of fields in the json output, which are not guaranteed to be consistent across versions of the json library or go (Java 8 for example changed its hashmap implementation, which caused fields to get re-ordered compared to java 7).

Ideally we'd find a solution that is insensitive to details of the map or json implementations, while still handling missing fields correctly.

@anandswaminathan
Copy link
Contributor Author

@mwylde Updated to use Object hash - https://github.com/benlaurie/objecthash

Copy link
Contributor

@mwylde mwylde left a comment

Choose a reason for hiding this comment

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

Looks good once the failing integration test is resolved

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