mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-05-23 22:00:54 -04:00
Other parts of the language allow deciding the sensitivity of a value based on results that won't be known until the apply phase, which means that in practice we cannot predict the final sensitivity of an unknown value. Previously this function assumed that an unknown value would always be a placeholder for a final value of the same sensitivity, which is not a valid assumption in practice and so using the results of this function could cause downstream value consistency checks to fail. This does unfortunately create a situation where a new version of OpenTofu will return an unknown value in a situation that was previously always known, which could therefore begin causing a plan-time error if the result is then used to populate something that is required to be known at plan time. However, the previous behavior caused OpenTofu to produce confusing errors (blaming a provider for OpenTofu's mistake) during the apply phase, and so the potential new plan-time errors are arguably better than the previous behavior. Any unknown result is refined as definitely not null to shrink the potential impact: other parts of the language will still be able to assume that the result of this function is not null even if it's not yet known. Signed-off-by: Martin Atkins <mart@degeneration.co.uk>