fix panic when updating a sensitive field that requires replacement #35372
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.
This PR fixes a panic that occurs during a plan when a sensitive value update forces a resource to be replaced. We refactored the logic for gathering the required replace paths into a separate function in ddabb6a. This refactor missed that previously it was the
unmarkedPriorVal
that was being used for comparison rather than the basicpriorVal
. When the values are then compared for equality, one of the values was marked which meant the overall returned boolean value was also marked, and then the panic occurs at line 2857.This PR simply passes in the unmarked values for both the planned and prior values, instead of recomputing the unmarked values internally. This should be acceptable as nothing about the values are actually exposed via the function, it is only the paths and there is nothing sensitive about the paths.
Target Release
1.9.0 (hopefully)
Draft CHANGELOG entry
N/A, this bug was introduced in between releases so as long as we fix before 1.9.0 we don't need a changelog entry.