This project is mirrored from https://:*****@github.com/hashicorp/terraform.git.
Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
- 25 Mar, 2020 19 commits
-
-
James Bardin authored
As the Graph is walked, the current way to set the context path was to have the walker return a context from EnterPath. This required that every node know it's absolute path, which can no longer be the case during plan when modules have not been expanded. This introduces a new method called WithPath, which returns a copy of the context with the internal path updated to reflect the method argument. Any use of the EvalContext that requires knowing the path will now panic if it wasn't explicitly set to ensure that evaluations always occur in the correct path. Add EvalContext to the GraphWalker interface. EvalContext returns an EvalContext that has not yet set a path. This will allow us to enforce that all context operations requiring a module instance path will require that a path be explicitly set rather than evaluating within the wrong path.
-
Martin Atkins authored
This was incorrectly removing the _source_ entry prior to creating the symlink, therefore ending up with a dangling symlink and no source file. This wasn't obvious before because the test case for LinkFromOtherCache was also incorrectly named and therefore wasn't running. Fixing the name of that test made this problem apparent. The TestLinkFromOtherCache test case now ends up seeing the final resolved directory rather than the symlink target, because of upstream changes to the internal/getproviders filesystem scanning logic to handle symlinks properly.
-
Martin Atkins authored
Previously this was failing to treat symlinks to directories as unpacked layout, because our file info was only an Lstat result, not a full Stat. Now we'll resolve the symlink first, allowing us to handle a symlink to a directory. That's important because our internal/providercache behavior is to symlink from one cache to another where possible.
-
Martin Atkins authored
There's a lot going on in these functions that can be hard to follow from the outside, so we'll add some additional trace logging so that we can more easily understand why things are behaving the way they are.
-
Martin Atkins authored
This was accidentally left out of an earlier commit due to our top-level .gitignore file containing *.exe as an ignore pattern.
-
Pam Selle authored
-
James Bardin authored
Expander.ExpandResource cannot expand all modules
-
Martin Atkins authored
When a provider source produces an HTTP URL location we'll expect it to resolve to a zip file, which we'll first download to a temporary directory and then treat it like a local archive. When a provider source produces a local archive path we'll expect it to be a zip file and extract it into the target directory. This does not yet include an implementation of installing from an already-unpacked local directory. That will follow in a subsequent commit, likely following a similar principle as in Dir.LinkFromOtherCache.
-
Martin Atkins authored
These new functions allow command implementations to get hold of the providercache objects and installation source object derived from the current CLI configuration.
-
Martin Atkins authored
The MultiSource isn't actually properly implemented yet, but this is a minimal implementation just for the case where there are no underlying sources at all, because we use an empty MultiSource as a placeholder when a test in the "command" package fails to explicitly populate a ProviderSource.
-
Martin Atkins authored
This is not tested yet, but it's a compilable strawman implementation of the necessary sequence of events to coordinate all of the moving parts of running a provider installation operation. This will inevitably see more iteration in later commits as we complete the surrounding parts and wire it up to be used by "terraform init". So far, it's just dead code not called by any other package.
-
Martin Atkins authored
The Installer type will encapsulate the logic for running an entire provider installation request: given a set of providers to install, it will determine a method to obtain each of them (or detect that they are already installed) and then take the necessary actions. So far it doesn't do anything, but this stubs out an interface by which the caller can request ongoing notifications during an installation operation.
-
Martin Atkins authored
This will eventually be responsible for actually retrieving a package from a source and then installing it into the cache directory, but for the moment it's just a stub to complete the proposed API, which I intend to test in a subsequent commit by writing the full "Installer" API that will encapsulate the full installation logic.
-
Martin Atkins authored
When a system-wide shared plugin cache is configured, we'll want to make use of entries already in the shared cache when populating a local (configuration-specific) cache. This new method LinkFromOtherCache encapsulates the work of placing a link from one cache to another. If possible it will create a symlink, therefore retaining a key advantage of configuring a shared plugin cache, but otherwise we'll do a deep copy of the package directory from one cache to the other. Our old provider installer would always skip trying to create symlinks on Windows because Go standard library support for os.Symlink on Windows was inconsistent in older versions. However, os.Symlink can now create symlinks using a new API introduced in a Windows 10 update and cleanly fail if symlink creation is impossible, so it's safe for us to just try to create the symlink and react if that produces an error, just as we used to do on non-Windows systems when possibly creating symlinks on filesystems that cannot support them.
-
Martin Atkins authored
The existing functionality in this package deals with finding packages that are either available for installation or already installed. In order to support installation we also need to determine the location where a package should be installed. This lives in the getproviders package because that way all of the logic related to the filesystem layout for local provider directories lives together here where they can be maintained together more easily in future.
-
Martin Atkins authored
We've previously been copying this function around so it could remain unexported while being used in various packages. However, it's a non-trivial function with lots of specific assumptions built into it, so here we'll put it somewhere that other packages can depend on it _and_ document the assumptions it seems to be making for future reference. As a bonus, this now uses os.SameFile to detect when two paths point to the same physical file, instead of the slightly buggy local implementation we had before which only worked on Unix systems and did not correctly handle when the paths were on different physical devices. The copy of the function I extracted here is the one from internal/initwd, so this commit also includes the removal of that unexported version and updating the callers in that package to use at at this new location.
-
Martin Atkins authored
Historically our logic to handle discovering and installing providers has been spread across several different packages. This package is intended to become the home of all logic related to what is now called "provider cache directories", which means directories on local disk where Terraform caches providers in a form that is ready to run. That includes both logic related to interrogating items already in a cache (included in this commit) and logic related to inserting new items into the cache from upstream provider sources (to follow in later commits). These new codepaths are focused on providers and do not include other plugin types (provisioners and credentials helpers), because providers are the only plugin type that is represented by a heirarchical, decentralized namespace and the only plugin type that has an auto-installation protocol defined. The existing codepaths will remain to support the handling of the other plugin type...
-
Martin Atkins authored
Previously this was available by instantiating a throwaway FilesystemMirrorSource, but that's pretty counter-intuitive for callers that just want to do a one-off scan without retaining any ongoing state. Now we expose SearchLocalDirectory as an exported function, and the FilesystemMirrorSource then uses it as part of its implementation too. Callers that just want to know what's available in a directory can call SearchLocalDirectory directly.
-
James Bardin authored
ExpandResource must only check the specific ModuleInstances in the requested path, because the resource may not have been registered yet in all module instances.
-
- 24 Mar, 2020 3 commits
-
-
James Bardin authored
Expander.ExpandResource should use AbsResource
-
James Bardin authored
This also calls ExpandModuleResource in one location, because the logic is not yet updated to handle actual module expansion, but that will be fixed in a forthcoming PR.
-
James Bardin authored
It turns out that within terraform resource expansion will normally happen with an absolute address. This is because in order to evaluate the expansion expression, we need to already have the context within a module instance. This leaves the existing ExpandResource logic in place as ExpandModuleResource since it's working, and in case we do find a location where it's useful to get a full expansion (which may be needed for instance dependency tracking) Reword some of the resource related arguments and comments, as they were copied from the module methods and not entirely accurate.
-
- 23 Mar, 2020 3 commits
-
-
Kristin Laemmert authored
-
Kristin Laemmert authored
* add IsLegacy and IsDefault funcs to addrs.Provider * add some test coverage
-
Adam Leskis authored
-
- 20 Mar, 2020 2 commits
-
-
Kristin Laemmert authored
missingPlugins was hard-coded to work only with provider plugins, so I renamed it to clarify the usage. Also renamed a test provider from greater_than to greater-than as the underscore is an invalid provider name character and this will become a hard error in the near future.
-
Kristin Laemmert authored
* import: remove Config from ImportOpts `Config` in ImportOpts was any provider configuration provided by the user on the command line. This option has already been removed in favor of only taking the provider from the configuration loaded in the current context. * terrafrom: add Config to ImportStateTransformer and refactor Transform to get the resource provider FQN from the Config
-
- 19 Mar, 2020 5 commits
-
-
Alisdair McDiarmid authored
-
Alisdair McDiarmid authored
registry: Fix panic when server is unreachable
-
Alisdair McDiarmid authored
Non-HTTP errors previously resulted in a panic due to dereferencing the resp pointer while it was nil, as part of rendering the error message. This commit changes the error message formatting to cope with a nil response, and extends test coverage. Fixes #24384
-
Kristin Laemmert authored
-
Kristin Laemmert authored
* command: remove 0.12upgrade and related `configupgrade` library * leave deprecation warning for 0.12upgrade to point users to v0.12
-
- 18 Mar, 2020 5 commits
-
-
Nick Fagerlund authored
Since these links were in the soon-to-be-deprecated 0.11 language section, I think we can just remove them without needing to find an equivalent link.
-
Alisdair McDiarmid authored
-
Alisdair McDiarmid authored
-
Alisdair McDiarmid authored
command: Add scaffold for 0.13upgrade command
-
Kristin Laemmert authored
* terraform: large refactor to use Provider from configs.Resource configs.Resource.ImpliedProvider() now returns a string; it is the callers' responsibility to turn that into an addrs.Provider if needed. GraphNodeProviderConsumer ProvidedBy() no longer returns nil (reverting to earlier, pre-provider-fqn behavior): it will return either the provider set in config, provider set in state, or the default provider.
-
- 17 Mar, 2020 3 commits
-
-
aqche authored
-
Martin Atkins authored
It seems that the checksum for v3.3.10+incompatible has changed at some point, causing "go mod vendor" to fail now. We can see by the fact that no files within "vendor" have changed that the change in checksum is not the result of any material change in the module code, and therefore presumably resulted from some change in metadata or a change in the Go module hashing algorithm since Go 1.12.
-
James Bardin authored
more module expansion foundation
-