Remove all or none of object keys in set #859
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please refer to my analysis from hashicorp/terraform-provider-helm#817 to find out how the current behavior makes terraform-provider-helm create inconsistent final plan when value in set refers to unknown value that actually doesn't change after apply.
It looks that all object keys in set defined in schema are meant to be always present while object still in set. So my proposal is to delete a key from an object only when all keys of that object get deleted, which means an object itself gets deleted from set.
The latest 2.4.1 version of terraform-provider-helm uses terraform-plugin-sdk 2.8.0. I rebuilt and checked with 2.10.1 and the problem is still there.
I'm not a go/tf developer, so my code may be ugly and my reasoning may be absolutely wrong. So please be patient. At least it fixes hashicorp/terraform-provider-helm#817.