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>
* Rename module name from "github.com/hashicorp/terraform" to "github.com/placeholderplaceholderplaceholder/opentf".
Signed-off-by: Jakub Martin <kubam@spacelift.io>
* Gofmt.
Signed-off-by: Jakub Martin <kubam@spacelift.io>
* Regenerate protobuf.
Signed-off-by: Jakub Martin <kubam@spacelift.io>
* Fix comments.
Signed-off-by: Jakub Martin <kubam@spacelift.io>
* Undo issue and pull request link changes.
Signed-off-by: Jakub Martin <kubam@spacelift.io>
* Undo comment changes.
Signed-off-by: Jakub Martin <kubam@spacelift.io>
* Fix comment.
Signed-off-by: Jakub Martin <kubam@spacelift.io>
* Undo some link changes.
Signed-off-by: Jakub Martin <kubam@spacelift.io>
* make generate && make protobuf
Signed-off-by: Jakub Martin <kubam@spacelift.io>
---------
Signed-off-by: Jakub Martin <kubam@spacelift.io>
This is part of a general effort to move all of Terraform's non-library
package surface under internal in order to reinforce that these are for
internal use within Terraform only.
If you were previously importing packages under this prefix into an
external codebase, you could pin to an earlier release tag as an interim
solution until you've make a plan to achieve the same functionality some
other way.