opentofu/configs/configload
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
..
test-fixtures configs/configload: installer tests inspect their result 2018-02-15 15:56:39 -08:00
copy_dir.go configs/configload: installation from registry and go-getter 2018-02-15 15:56:39 -08:00
doc.go configs/configload: package for loading configurations 2018-02-15 15:56:38 -08:00
getter.go configs/configload: installation from registry and go-getter 2018-02-15 15:56:39 -08:00
inode_freebsd.go configs/configload: installation from registry and go-getter 2018-02-15 15:56:39 -08:00
inode_windows.go configs/configload: installation from registry and go-getter 2018-02-15 15:56:39 -08:00
inode.go configs/configload: installation from registry and go-getter 2018-02-15 15:56:39 -08:00
loader_init_from_module_test.go configs/configload: InitDirFromModule 2018-02-15 15:56:39 -08:00
loader_init_from_module.go configs/configload: InitDirFromModule 2018-02-15 15:56:39 -08:00
loader_install_hooks.go configs/configload: installation of local modules 2018-02-15 15:56:38 -08:00
loader_install_test.go configs/configload: installer tests inspect their result 2018-02-15 15:56:39 -08:00
loader_install.go configs/configload: InitDirFromModule 2018-02-15 15:56:39 -08:00
loader_load_test.go configs/configload: package for loading configurations 2018-02-15 15:56:38 -08:00
loader_load.go configs/configload: package for loading configurations 2018-02-15 15:56:38 -08:00
loader_snapshot_test.go configload: Configuration snapshots 2018-10-16 18:50:29 -07:00
loader_snapshot.go configload: Configuration snapshots 2018-10-16 18:50:29 -07:00
loader_test.go configs/configload: installation from registry and go-getter 2018-02-15 15:56:39 -08:00
loader.go configs/configload: Helper for recognizing a config dir (or not) 2018-10-16 18:24:47 -07:00
module_manifest.go configs: use addrs.Module for module path, rather than []string 2018-10-16 18:46:46 -07:00
module_mgr.go Add a CredentialsForHost method to disco.Disco 2018-08-03 11:29:11 +02:00
source_addr.go configs/configload: installation from registry and go-getter 2018-02-15 15:56:39 -08:00
testing.go configload: helper functions for tests 2018-10-16 18:24:47 -07:00