terraform/terraform
Paul Hinze f882dd1427 core: Encode Targets in saved Planfile
When a user specifies `-target`s on a `terraform plan` and stores
the resulting diff in a plan file using `-out` - it usually works just
fine since the diff is scoped based on the targets.

When there are tainted resources in the state, however, graph nodes to
destroy them were popping back into the plan when it was being loaded
from a file. This was because Targets weren't being stored in the
Planfile, so Terraform didn't know to filter them out. (In the
non-Planfile scenario, we still had the Targets loaded directly from the
flags.)

By encoding Targets in with the Planfile we can ensure that the same
filters are always applied.

Backwards compatibility should be fine here, since we're just adding a
field. The gob encoder/decoder will just do the right thing (ignore/skip
the field) with planfiles stored w/ versions that don't know about
Targets.

Fixes #5183
2016-03-08 14:29:37 -06:00
..
test-fixtures core: Encode Targets in saved Planfile 2016-03-08 14:29:37 -06:00
context.go core: Encode Targets in saved Planfile 2016-03-08 14:29:37 -06:00
context_apply_test.go core: Encode Targets in saved Planfile 2016-03-08 14:29:37 -06:00
context_input_test.go core: don't error on computed value during input walk 2015-08-12 14:23:33 -05:00
context_plan_test.go Merge pull request #5026 from hashicorp/phinze/destroy-node-copies 2016-02-09 11:12:01 -06:00
context_refresh_test.go core: fix deadlock when dependable node replaced with non-dependable one 2015-08-10 15:50:36 -05:00
context_test.go terraform: issue 5254 test case (not yet working) 2016-02-24 10:55:55 -05:00
context_validate_test.go terraform: upgrade resource name regexp failure to error 2016-02-23 10:32:49 -06:00
diff.go core: fix diff mismatch when RequiresNew field and list both change 2016-01-19 15:38:04 -06:00
diff_test.go core: fix diff mismatch when RequiresNew field and list both change 2016-01-19 15:38:04 -06:00
eval.go core: demote early exit log from ERROR -> DEBUG 2016-02-24 09:58:33 -06:00
eval_apply.go removed extra parentheses 2015-10-08 15:48:04 +03:00
eval_check_prevent_destroy.go update prevent_destroy error message 2015-08-13 09:57:52 -05:00
eval_context.go core: close provider/provisioner connections 2015-06-19 21:52:50 +02:00
eval_context_builtin.go terraform: provider input should be scoped by path 2015-06-24 09:34:21 -07:00
eval_context_builtin_test.go terraform: provider input should be scoped by path 2015-06-24 09:34:21 -07:00
eval_context_mock.go core: close provider/provisioner connections 2015-06-19 21:52:50 +02:00
eval_count.go terraform: catch scenario where both "foo" and "foo.0" are in state 2015-03-01 21:28:41 -08:00
eval_diff.go terraform: tweak diffs didn't match output spacing 2016-02-23 14:35:30 -06:00
eval_diff_test.go terraform: destroy node should not create 2015-02-24 22:45:47 -08:00
eval_error.go core: [refactor] store Deposed resource instances as a list 2015-03-04 12:25:59 -06:00
eval_filter.go terraform: more eval stuff 2015-02-19 12:07:54 -08:00
eval_filter_operation.go terraform: clean up EvalNodes 2015-02-19 12:08:32 -08:00
eval_if.go core: [refactor] pull Deposed out of Tainted list 2015-03-04 12:25:47 -06:00
eval_ignore_changes.go Started the work for the AWS CodeCommit Repository resource 2015-10-30 21:39:04 +00:00
eval_interpolate.go terraform: clean up EvalNodes 2015-02-19 12:08:32 -08:00
eval_interpolate_test.go terraform: clean up EvalNodes 2015-02-19 12:08:32 -08:00
eval_noop.go terraform: clean up EvalNodes 2015-02-19 12:08:32 -08:00
eval_output.go terraform: EvalDeleteOutput and context test 2015-04-29 11:27:12 -07:00
eval_provider.go core: close provider/provisioner connections 2015-06-19 21:52:50 +02:00
eval_provider_test.go core: close provider/provisioner connections 2015-06-19 21:52:50 +02:00
eval_provisioner.go core: close provider/provisioner connections 2015-06-19 21:52:50 +02:00
eval_provisioner_test.go core: close provider/provisioner connections 2015-06-19 21:52:50 +02:00
eval_refresh.go Add resource ID to refresh errors 2015-07-22 14:09:39 +02:00
eval_resource.go terraform: clean up EvalNodes 2015-02-19 12:08:32 -08:00
eval_sequence.go terraform: clean up EvalNodes 2015-02-19 12:08:32 -08:00
eval_sequence_test.go terraform: Refresh, Read/Write state 2015-02-19 12:08:00 -08:00
eval_state.go Support for multiple providers of the same type 2015-04-20 14:14:34 -07:00
eval_state_test.go core: tweaks from code review 2015-03-05 10:11:14 -06:00
eval_test.go terraform: clean up EvalNodes 2015-02-19 12:08:32 -08:00
eval_validate.go terraform: upgrade resource name regexp failure to error 2016-02-23 10:32:49 -06:00
eval_variable.go terraform: set variables in the proper location 2015-05-01 16:29:19 -07:00
evaltree_provider.go Add operation walkDestroy 2015-10-03 14:16:40 -07:00
graph.go core: fix deadlock when dependable node replaced with non-dependable one 2015-08-10 15:50:36 -05:00
graph_builder.go Bypass CreateBeforeDestroyTransformer during terraform destroy 2016-02-10 20:08:36 -08:00
graph_builder_test.go Bypass CreateBeforeDestroyTransformer during terraform destroy 2016-02-10 20:08:36 -08:00
graph_config_node.go terraform: fill in more flat interfaces 2015-05-01 15:28:41 -07:00
graph_config_node_module.go terraform: update comment 2015-05-04 10:49:34 -07:00
graph_config_node_module_test.go terraform: add module destroy node to graph 2015-05-01 18:26:35 -07:00
graph_config_node_output.go Add operation walkDestroy 2015-10-03 14:16:40 -07:00
graph_config_node_provider.go terraform: providers in flattened graphs should depend on the parent 2015-05-01 16:41:49 -07:00
graph_config_node_resource.go terraform: don't prune resource if count contains interpolations 2016-02-24 12:04:42 -05:00
graph_config_node_test.go terraform: redo how flattening works 2015-05-01 15:18:40 -07:00
graph_config_node_type.go terraform: add variables as graph nodes (no eval yet) 2015-04-30 16:27:20 -07:00
graph_config_node_variable.go terraform: prune resources and variables 2015-07-20 08:57:34 -07:00
graph_config_node_variable_test.go terraform: set variables in the proper location 2015-05-01 16:29:19 -07:00
graph_dot.go Fix three trivial errors 'go vet' discovered. 2015-05-13 21:23:07 -04:00
graph_dot_test.go removed extra parentheses 2015-10-08 15:48:04 +03:00
graph_interface_subgraph.go terraform: subpath context setting 2015-05-01 14:19:32 -07:00
graph_test.go core: fix deadlock when dependable node replaced with non-dependable one 2015-08-10 15:50:36 -05:00
graph_walk.go terraform: subpath context setting 2015-05-01 14:19:32 -07:00
graph_walk_context.go core: log eval tree operations 2016-02-24 09:49:11 -06:00
graph_walk_operation.go Add operation walkDestroy 2015-10-03 14:16:40 -07:00
graph_walk_test.go terraform: trying this graphwalker thing 2015-02-19 12:07:56 -08:00
graphnodeconfigtype_string.go Reflect new comment format in stringer.go 2015-11-09 11:38:51 -05:00
hook.go terraform: PostStateUpdate hook and EvalUpdateStateHook 2015-02-23 19:09:48 -08:00
hook_mock.go terraform: PostStateUpdate hook and EvalUpdateStateHook 2015-02-23 19:09:48 -08:00
hook_stop.go terraform: PostStateUpdate hook and EvalUpdateStateHook 2015-02-23 19:09:48 -08:00
hook_stop_test.go terraform: stopHook and tests 2014-07-02 16:16:38 -07:00
hook_test.go terraform: initial hook impl 2014-06-26 16:52:15 -07:00
instancetype.go core: formalize resource addressing 2015-03-31 15:04:10 -05:00
instancetype_string.go Reflect new comment format in stringer.go 2015-11-09 11:38:51 -05:00
interpolate.go core: error instead of panic on self var in wrong scope 2016-02-23 11:44:24 -06:00
interpolate_test.go core: error instead of panic on self var in wrong scope 2016-02-23 11:44:24 -06:00
path.go terraform: module inputs are passed through to subgraphs 2015-02-19 12:08:01 -08:00
plan.go core: Encode Targets in saved Planfile 2016-03-08 14:29:37 -06:00
plan_test.go terraform: Plan should use module.Tree 2014-09-24 14:56:48 -07:00
resource.go helper/schema: FieldReaderConfig detects computed maps 2015-04-21 22:07:52 +02:00
resource_address.go core: Make copies when creating destroy nodes 2016-02-09 09:25:16 -06:00
resource_address_test.go core: Orphan addressing / targeting 2016-01-19 17:48:44 -06:00
resource_provider.go core: close provider/provisioner connections 2015-06-19 21:52:50 +02:00
resource_provider_mock.go command: fix flaky parallelism tests 2015-10-29 15:16:34 -05:00
resource_provider_mock_test.go terraform: provider mock should close itself to find bugs 2015-06-29 10:33:37 -07:00
resource_provider_test.go terraform: add ResourceProviderFactoryFixed 2014-07-10 09:46:21 -07:00
resource_provisioner.go core: close provider/provisioner connections 2015-06-19 21:52:50 +02:00
resource_provisioner_mock.go terraform: change provisioners to take UIOutput 2014-10-04 09:20:05 -07:00
resource_provisioner_mock_test.go terraform: Adding mock resource provisioner 2014-07-10 11:38:56 -07:00
resource_test.go terraform: replace config/lang usage 2016-02-03 13:24:04 -05:00
semantics.go terraform: start implementing interfaces for semantic checks 2015-02-19 12:07:52 -08:00
semantics_test.go terraform: semantic check that variables are set on the correct types 2014-07-22 09:27:28 -07:00
state.go core: fix bug detecting deeply nested module orphans 2016-02-09 10:35:46 -06:00
state_test.go Fix additional vet warnings 2016-02-17 11:59:50 -08:00
state_v1.go config: add Config method 2014-10-02 11:34:08 -07:00
state_v1_test.go Fix additional vet warnings 2016-02-17 11:59:50 -08:00
terraform_test.go Fix additional vet warnings 2016-02-17 11:59:50 -08:00
transform.go terraform: GraphVertexTransformers 2015-02-19 12:07:57 -08:00
transform_config.go core: module targeting 2015-05-05 21:58:48 -05:00
transform_config_test.go terraform: add variables as graph nodes (no eval yet) 2015-04-30 16:27:20 -07:00
transform_deposed.go Add operation walkDestroy 2015-10-03 14:16:40 -07:00
transform_destroy.go terraform: orphan dependencies should be inverted 2015-06-23 20:41:02 -07:00
transform_destroy_test.go core: validate graph w/ diff during plan phase 2015-05-05 17:24:44 -05:00
transform_expand.go terraform: orphan module should flatten 2015-05-14 20:54:33 -07:00
transform_expand_test.go terraform: fix tests 2015-02-19 12:08:01 -08:00
transform_flatten.go remove various typos 2015-09-11 11:56:20 -07:00
transform_flatten_test.go terraform: add module destroy node to graph 2015-05-01 18:26:35 -07:00
transform_module.go terraform: add module destroy node to graph 2015-05-01 18:26:35 -07:00
transform_module_test.go terraform: module inputs are passed through to subgraphs 2015-02-19 12:08:01 -08:00
transform_noop.go terraform: remove print 2015-07-20 08:57:35 -07:00
transform_noop_test.go terraform: PruneNoopTransformer 2015-07-20 08:57:34 -07:00
transform_orphan.go core: Orphan addressing / targeting 2016-01-19 17:48:44 -06:00
transform_orphan_test.go core: Orphan addressing / targeting 2016-01-19 17:48:44 -06:00
transform_output.go Add operation walkDestroy 2015-10-03 14:16:40 -07:00
transform_output_test.go terraform: add output orphan transformer 2015-04-29 11:18:58 -07:00
transform_provider.go Rename `graphNodeMissingProvider` to `graphNodeProvider` 2016-02-04 21:41:04 +01:00
transform_provider_test.go Rename `graphNodeMissingProvider` to `graphNodeProvider` 2016-02-04 21:41:04 +01:00
transform_provisioner.go Cleaning up the PruneProvisionerTransformer 2016-02-04 21:32:10 +01:00
transform_provisioner_test.go Cleaning up the PruneProvisionerTransformer 2016-02-04 21:32:10 +01:00
transform_proxy.go terraform: proxy uses custom edge 2015-05-01 11:41:01 -07:00
transform_proxy_test.go terraform: GraphNodeProxy 2015-05-01 11:38:36 -07:00
transform_resource.go Added EvalIgnoreChanges on diffApply. 2016-02-02 15:23:25 -07:00
transform_resource_test.go terraform: inner-count dependencies work [GH-1540] 2015-04-18 15:56:43 -07:00
transform_root.go terraform: prune resources and variables 2015-07-20 08:57:34 -07:00
transform_root_test.go terraform: validation in progress 2015-02-19 12:07:55 -08:00
transform_tainted.go Add operation walkDestroy 2015-10-03 14:16:40 -07:00
transform_tainted_test.go Support for multiple providers of the same type 2015-04-20 14:14:34 -07:00
transform_targets.go core: Orphan addressing / targeting 2016-01-19 17:48:44 -06:00
transform_targets_test.go core: targeted operations 2015-03-31 14:49:38 -05:00
transform_transitive_reduction.go terraform: add TransitiveReductionTransformer 2015-02-27 19:18:04 -08:00
transform_transitive_reduction_test.go terraform: add TransitiveReductionTransformer 2015-02-27 19:18:04 -08:00
transform_vertex.go terraform: GraphVertexTransformers 2015-02-19 12:07:57 -08:00
transform_vertex_test.go terraform: GraphVertexTransformers 2015-02-19 12:07:57 -08:00
ui_input.go helper/scheam: support UI defaults 2014-09-29 14:00:35 -07:00
ui_input_mock.go terraform: Input() asks for variable inputs 2014-09-28 23:37:36 -07:00
ui_input_prefix.go terraform: Make output more machine-like 2014-09-29 12:52:48 -07:00
ui_input_prefix_test.go terraform: prefix the Id for configuring providers 2014-09-29 10:36:49 -07:00
ui_output.go terraform: UIOutput interface 2014-10-04 09:00:07 -07:00
ui_output_callback.go terraform: provisioners 2015-02-19 12:08:06 -08:00
ui_output_callback_test.go terraform: provisioners 2015-02-19 12:08:06 -08:00
ui_output_mock.go fmt 2014-10-10 14:50:35 -07:00
ui_output_mock_test.go terraform: UIOutput interface 2014-10-04 09:00:07 -07:00
ui_output_provisioner.go terraform: no longer require uiOutput, do it auto in Hook 2014-10-04 16:24:07 -07:00
ui_output_provisioner_test.go terraform: no longer require uiOutput, do it auto in Hook 2014-10-04 16:24:07 -07:00
util.go Support for multiple providers of the same type 2015-04-20 14:14:34 -07:00
util_test.go terraform: Adding a semaphore implementation 2014-10-16 10:04:36 -07:00
version.go release: clean up after v0.6.12 2016-02-24 20:33:57 +00:00
walkoperation_string.go Reflect new comment format in stringer.go 2015-11-09 11:38:51 -05:00