Commit Graph

12 Commits

Author SHA1 Message Date
Martin Atkins
c2ea647ff4 funcs: issensitive returns unknown when given an unknown value
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>
2025-07-10 08:12:29 -07:00
Oleksandr Levchenkov
5ff40ae505 refactor sensitive marks usage (#2503)
Signed-off-by: ollevche <ollevche@gmail.com>
2025-02-11 19:02:21 +02:00
Jonas Bakken
fc5ffe4edd feat: implement issensitive function (#1381)
Signed-off-by: Jonas Bakken <jonasbakken@protonmail.com>
2024-03-13 11:22:58 +01:00
namgyalangmo
cb2e9119aa Update copyright notice (#1232)
Signed-off-by: namgyalangmo <75657887+namgyalangmo@users.noreply.github.com>
2024-02-08 09:48:59 +00:00
Joao C Costa
28e6bce155 nonsensitive no longer produces error when applied to values that are not sensitive (#369)
Signed-off-by: Joao C Costa <joao.costa@kit-ar.com>
2023-12-27 15:16:13 +01:00
Yaron Yarimi
059190f273 Rename multiple packages to OpenTofu (#488) 2023-09-20 15:59:27 +03:00
Yaron Yarimi
c8acedd885 Rename github.com/placeholderplaceholderplaceholder/opentf to github.com/opentofu/opentofu (#461) 2023-09-20 14:35:35 +03:00
RLRabinowitz
650b1a339a Adjust mentions of terraform in internal/lang 2023-08-23 11:12:15 +03:00
Kuba Martin
ebcf7455eb Rename root module name. (#4)
* 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>
2023-08-17 14:45:11 +02:00
hashicorp-copywrite[bot]
325d18262e [COMPLIANCE] Add Copyright and License Headers 2023-05-02 15:33:06 +00:00
James Bardin
d9dfd451ea update to use typed sensitive marks 2021-06-25 12:49:07 -04:00
Martin Atkins
cdd9464f9a Move lang/ to internal/lang/
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.
2021-05-17 14:09:07 -07:00