mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-27 09:21:14 -06:00
27ad9861ce
Several top-level block types in the Terraform language have a body where two different schemas are overlayed on top of one another: Terraform first looks for "meta-arguments" that are built into the language, and then evaluates all of the remaining arguments against some externally-defined schema whose content is not fully controlled by Terraform. So far we've been cautiously adding new meta-arguments in these namespaces after research shows us that there are relatively few existing providers or modules that would have functionality masked by those additions, but that isn't really a viable path forward as we prepare to make stronger compatibility promises. In an earlier commit we've introduced the foundational parts of a new language versioning mechanism called "editions" which should allow us to make per-module-opt-in breaking changes in the future, but these shared namespaces remain a liability because it would be annoying if adopting a new edition made it impossible to use a feature of a third-party provider or module that was already using a name that has now become reserved in the new edition. This commit introduces a new syntax intended to be a rarely-used escape hatch for that situation. When we're designing new editions we will do our best to choose names that don't conflict with commonly-used providers and modules, but there are many providers and modules that we cannot see and so there is a risk that any name we might choose could collide with at least one existing provider or module. The automatic migration tool to upgrade an existing module to a new edition should therefore detect that situation and make use of this escaping block syntax in order to retain the existing functionality until all the called providers or modules are updated to no longer use conflicting names. Although we can't put in technical constraints on using this feature for other purposes (because we don't know yet what future editions will add), this mechanism is intentionally not documented for now because it serves no immediate purpose. In effect, this change is just squatting on the syntax of a special block type named "_" so that later editions can make use of it without it _also_ conflicting, creating a confusing nested escaping situation. However, the first time a new edition actually makes use of this syntax we should then document alongside the meta-arguments so folks can understand the meaning of escaping blocks produced by edition upgrade tools. |
||
---|---|---|
.. | ||
configload | ||
configschema | ||
hcl2shim | ||
testdata | ||
backend.go | ||
compat_shim.go | ||
config_build_test.go | ||
config_build.go | ||
config_test.go | ||
config.go | ||
depends_on.go | ||
doc.go | ||
escaping_blocks_test.go | ||
experiments_test.go | ||
experiments.go | ||
module_call_test.go | ||
module_call.go | ||
module_merge_body.go | ||
module_merge_test.go | ||
module_merge.go | ||
module_test.go | ||
module.go | ||
named_values_test.go | ||
named_values.go | ||
parser_config_dir_test.go | ||
parser_config_dir.go | ||
parser_config_test.go | ||
parser_config.go | ||
parser_test.go | ||
parser_values_test.go | ||
parser_values.go | ||
parser.go | ||
provider_meta.go | ||
provider_requirements_test.go | ||
provider_requirements.go | ||
provider_test.go | ||
provider_validation.go | ||
provider.go | ||
provisioner.go | ||
provisioneronfailure_string.go | ||
provisionerwhen_string.go | ||
resource.go | ||
synth_body_test.go | ||
synth_body.go | ||
util.go | ||
variable_type_hint.go | ||
variabletypehint_string.go | ||
version_constraint.go |