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

Schema diff can match against an earlier version of the schema #333

Open
Noel-Jones opened this issue Nov 27, 2023 · 0 comments
Open

Schema diff can match against an earlier version of the schema #333

Noel-Jones opened this issue Nov 27, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Noel-Jones
Copy link

The function schemaLookup used in the custom diff looks for a non normalised schema and returns this if found. If not found then it looks for a normalised schema and returns this if found.

The wrapper function schemaLookupCheck tests if the id returned is the same as the (desired) id being compared against and if so the diff is considered semantically equivalent.

This logic misses a case where the non-normalised schema has been updated to a normalised schema....
100107 = v7 = normalised
100103 = v6 = non normalised

So we can match the non normalised schema, get back id 100103, compare that against 100107 and throw away the match. This results in drift that could be avoided if the code compared the id within the schema lookup function against the non normalised result if found and the normalised result if found, returning the id here only if it matches. In other words, look for the non normalised schema, if found compare against the desired id and return it if matched. If that doesn't match, look for the normalised schema, if found compare agasint the desired id and return it if found.

It's a bit of an edge case but one that occurred in our environment. Unfortunately the debug output does not show the ids found in each case so there is no useful logging that I can attach.

@linouk23 linouk23 added the bug Something isn't working label Nov 27, 2023
Lucatronlk pushed a commit to Lucatronlk/terraform-provider-confluent that referenced this issue Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants