opentofu/configs
Martin Atkins eb7aaf2414 configload: Configuration snapshots
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.
2018-10-16 18:50:29 -07:00
..
configload configload: Configuration snapshots 2018-10-16 18:50:29 -07:00
test-fixtures configs: parse the "providers" map for module calls 2018-10-16 18:44:26 -07:00
backend.go command: Various updates for the new backend package API 2018-10-16 18:44:26 -07:00
compat_shim.go configs: Handle object constructor keys when shimming traversals 2018-10-16 18:49:20 -07:00
config_build_test.go configs/configload: package for loading configurations 2018-02-15 15:56:38 -08:00
config_build.go configs: use addrs.Module for module path, rather than []string 2018-10-16 18:46:46 -07:00
config.go configs: NewEmptyConfig function 2018-10-16 18:44:26 -07:00
depends_on.go configs: quoted keywords/references are warnings, not errors 2018-02-15 15:56:39 -08:00
doc.go configs: Additional guidance in doc.go 2018-02-15 15:56:39 -08:00
module_call_test.go configs: parse the "providers" map for module calls 2018-10-16 18:44:26 -07:00
module_call.go configs: parse the "providers" map for module calls 2018-10-16 18:44:26 -07:00
module_merge_body.go configs: Export MergeBodies and new SynthBody function 2018-10-16 18:24:47 -07:00
module_merge_test.go configs: allow full type constraints for variables 2018-03-08 16:23:35 -08:00
module_merge.go configs: Re-unify the ManagedResource and DataResource types 2018-10-16 18:44:26 -07:00
module.go configs: Allow looking up resources by resource addresses. 2018-10-16 18:46:46 -07:00
named_values.go configs: Helper methods to integrate with "addrs" package 2018-10-16 18:44:26 -07:00
parser_config_dir_test.go configs: record the source directory for modules 2018-10-16 18:46:46 -07:00
parser_config_dir.go configload: Configuration snapshots 2018-10-16 18:50:29 -07:00
parser_config_test.go configs: allow full type constraints for variables 2018-03-08 16:23:35 -08:00
parser_config.go configs: allow full type constraints for variables 2018-03-08 16:23:35 -08:00
parser_test.go configs: Implementation of mergeBody 2018-02-15 15:56:38 -08:00
parser_values_test.go configs: update values file invalid syntax test for new HCL behavior 2018-03-08 11:17:39 -08:00
parser_values.go configs: Parser.LoadValuesFile 2018-02-15 15:56:37 -08:00
parser.go configs: Parser type 2018-02-15 15:56:36 -08:00
provider.go configs: Helper methods to integrate with "addrs" package 2018-10-16 18:44:26 -07:00
provisioner.go don't hanlde "type" when parsing connection blocks 2018-10-16 18:49:20 -07:00
provisioneronfailure_string.go configs: stub out main configuration structs 2018-02-15 15:56:37 -08:00
provisionerwhen_string.go configs: stub out main configuration structs 2018-02-15 15:56:37 -08:00
resource.go don't hanlde "type" when parsing connection blocks 2018-10-16 18:49:20 -07:00
synth_body_test.go configs: Export MergeBodies and new SynthBody function 2018-10-16 18:24:47 -07:00
synth_body.go configs: Export MergeBodies and new SynthBody function 2018-10-16 18:24:47 -07:00
util.go configs: allow overrides files to omit args that primary files can't 2018-02-15 15:56:38 -08:00
variable_type_hint.go configs: stub out main configuration structs 2018-02-15 15:56:37 -08:00
variabletypehint_string.go configs: stub out main configuration structs 2018-02-15 15:56:37 -08:00
version_constraint.go configs: Parser.LoadConfigFile 2018-02-15 15:56:37 -08:00