mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-28 01:41:48 -06:00
eb7aaf2414
Here we introduce a new idea of a "configuration snapshot", which is an in-memory copy of the source code of each of the files that make up the configuration. The primary intended purpose for this is as an intermediate step before writing the configuration files into a plan file, and then reading them out when that plan file is later applied. During earlier configs package development we expected to use an afero vfs implementation to read directly from the zip file, but that doesn't work in practice because we need to preserve module paths from the source file system that might include parent directory traversals (../) while retaining the original path for use in error messages. The result, for now, is a bit of an abstraction inversion: we implement a specialized afero vfs implementation that makes the sparse filesystem representation from a snapshot appear like a normal filesystem just well enough that the config loader and parser can work with it. In future we may wish to rework the internals here so that the main abstraction is at a similar level to the snapshot and then that API is mapped to the native filesystem in the normal case, removing afero. For now though, this approach avoids the need for a significant redesign of the parser/loader internals, at the expense of some trickiness in the case where we're reading from a snapshot. This commit does not yet include the reading and writing of snapshots into plan files. That will follow in a subsequent commit. |
||
---|---|---|
.. | ||
configload | ||
test-fixtures | ||
backend.go | ||
compat_shim.go | ||
config_build_test.go | ||
config_build.go | ||
config.go | ||
depends_on.go | ||
doc.go | ||
module_call_test.go | ||
module_call.go | ||
module_merge_body.go | ||
module_merge_test.go | ||
module_merge.go | ||
module.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.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 |