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

ignore_changes formatting is wrong for list of lists #295

Open
Tracked by #4952
mergenci opened this issue Nov 3, 2023 · 0 comments
Open
Tracked by #4952

ignore_changes formatting is wrong for list of lists #295

mergenci opened this issue Nov 3, 2023 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@mergenci
Copy link
Member

mergenci commented Nov 3, 2023

What happened?

While working on supporting management policies in no-fork architecture, I noticed that getIgnoredFieldsArray() returns strings that contain “%s”, when supplied list of lists. It shouldn't do so, because these returned values are not used as format strings in any place. Rather, they are embedded into ignore_changes lifecycle meta-argument.

The bug stems from the confusion around name of the first argument, which is named “format”, but never used as a format string.

As far as I could see, we don't have any test cases covering list of lists.

It is likely that list of lists occurs rarely, if at all, in any Terraform schema. That's probably why this bug has not been encountered in the wild.

How can we reproduce it?

I've reproduced the issue, using relevant parts of the code, in a playground.

Resolution

Replacing fieldPath+"%s" with fieldPath should be enough. A test case to go with it would be nice.

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