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.
- 17 Oct, 2018 40 commits
-
-
Martin Atkins authored
We previously stubbed most of this out because it hadn't yet been updated to support the new state types, etc. This restores all of the previous behavior as covered by the tests. We intentionally remove one behavior that was not covered by the tests: we used to allow retrieval of outputs from non-root modules using the -module option, but since we no longer persist non-root outputs in the state we can no longer support this without a full expression evaluation walk, and that'd be overkill for this otherwise-simple command. Descendant module outputs are not part of the public interface of a configuration anyway, so accessing them from outside in this way is an anti-pattern. (For debugging scenarios it is still possible to access these from "terraform console", which _does_ do a full evaluation graph walk to prepare its evaluation scope.)
-
Martin Atkins authored
The plan file writer requires a backend config to be present, but we don't really need one for the sake of _this_ test, since we don't activate the backend to render a plan graph, and so we just write in a placeholder.
-
Martin Atkins authored
Some underlying assumptions have shifted here, so although the behavior is still broadly the same we need to accommodate some different details.
-
Martin Atkins authored
This fixes TestConsole_tfvars.
-
Martin Atkins authored
-
Martin Atkins authored
-
Martin Atkins authored
This connects a missing link left by earlier refactoring: the command package is responsible for gathering up variable values provided by the user and passing them through to the backend to use in operations.
-
Martin Atkins authored
-
Martin Atkins authored
There are several steps here and a number of them can include reaching out to remote servers or executing local processes, so it's helpful to have some trace logs to better narrow down causes of errors and hangs during this step.
-
Martin Atkins authored
Our serialization of the backend configuration has changed slightly for Terraform 0.12 due to reimplementing it in terms of the HCL2 types, so the base case that should be unchanged during the test needs to be changed.
-
Martin Atkins authored
In all real cases the schemas should be populated here, but we don't want to panic in UI rendering code if there's a bug here. This can also be tripped up by tests with incomplete mocks. It's unfortunate that this can therefore mask some problems in tests, but tests can protect against it by asserting on specific output text rather than just assuming that a zero exit status is a pass.
-
Martin Atkins authored
In earlier refactoring we skipped implementing prior state safety checks, propagating the target addresses from plan, and verifying that all of the providers are exactly the same from the plan being created. This change reinstates those checks, including a new error message for the "stale plan" situation.
-
Kristin Laemmert authored
-
Kristin Laemmert authored
also run go mod tidy
-
Martin Atkins authored
If we fail to parse the resource address given to "terraform import" then it's helpful to produce a "source code" snippet of what the user provided so they might see more precisely which part of the address was invalid.
-
Martin Atkins authored
-
Martin Atkins authored
Most of this is just updates to allow for the fact that we now always save the provider address as part of resource state, whereas before it was only saved conditionally. This also updates TestTaint_module for the intentional change that it now expects a child module to be specified using normal resource address syntax, rather than as a separate -module option.
-
Martin Atkins authored
The untaint command now uses normal resource address syntax to specify the module path, rather than passing it in as a separate argument.
-
Martin Atkins authored
Resource instance state now always includes the provider address fo each resource, so our expected state output strings needed to be adjusted.
-
Martin Atkins authored
-
Martin Atkins authored
This is just to make sure they show up later when we are working on the tests, so we can be sure not to forget to address them.
-
Martin Atkins authored
-
Kristin Laemmert authored
-
Kristin Laemmert authored
-
Kristin Laemmert authored
Added a very simple test with state and schema. TODO: if tests are added we should test using golden files (and example state files, instead of strings). This seemed unnecessary with the simple test cases.
-
Kristin Laemmert authored
Use functions from format/diff to print values
-
Kristin Laemmert authored
format/state now requires provider schemas to properly format output state. command/show has been modified to pass a context to format.State.
-
Martin Atkins authored
In previous work we didn't quite connect these dots. The connection here is sub-awesome since the existing interfaces here had some unfortunate assumptions that we'd like to move away from (like the idea of a "nil backend" implying the local backend) but we're accepting this for now to avoid another big round of refactoring. The main implication of this is that we will now always include a backend configuration in the plan, though it might just be a placeholder config for the local backend in the remaining cases where that's still implicitly set. Later we will change this so that there is no implicit local backend at all (terraform init is always required, _it_ will deal with setting implicitly setting the local backend when appropriate), which will allow us to rework this to be more straightforward and less "spooky".
-
Martin Atkins authored
If we don't do this, we can't produce any output when applying a saved plan file. Here we also introduce a check to the local backend's ReportResult function so that it won't panic if CLI init is skipped, although that will no longer happen in the apply-from-file case due to the change described in the previous paragraph.
-
Martin Atkins authored
We can't generate a valid plan file without a backend configuration to write into it, but it's the responsibility of the caller (the command package) to manage the backend configuration mechanism, so we require it to tell us what to write here. This feels a little strange because the backend in principle knows its own config, but in practice the backend only knows the _processed_ version of the config, not the raw configuration value that was used to configure it.
-
Martin Atkins authored
-
Kristin Laemmert authored
converted the existing testPlanState() from terraform.State to states.State to fix various plan tests. reverted the "bandaid" in plans/planfile/tfplan.go - at this moment the backend tests do not include backend configuration, and so the planfile package can write the plan file but not read it back in. That will be revisted in a separate track of work.
-
Kristin Laemmert authored
I have no confidence in the change to plans/planfile/tfplan.go. The tests were passing an empty backend config, which planfile was able to write to a file but not read from the same file. This change let me move past that and it did not break any tests in the planfile package, but I am concerned that it introduces undesired behavior.
-
Kristin Laemmert authored
-
Kristin Laemmert authored
-
Kristin Laemmert authored
for TestLocal_applyBackendFail, config is relative to the tests' wd
-
Kristin Laemmert authored
-
Kristin Laemmert authored
-
James Bardin authored
The legacy test wasn't really testing anything useful, just the plan behavior with no diff in a module returned a module with no diff. There's no reason to convert this to the new plans, since there's no legacy behavior to match.
-
James Bardin authored
-