From f95f904ba85340c43be4efefec5f9a76c646fbee Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 7 Nov 2016 14:09:11 -0800 Subject: [PATCH] terraform: add TargetsTransformer to plan --- terraform/context.go | 1 + terraform/graph_builder_plan.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/terraform/context.go b/terraform/context.go index 5403ec41db..01857d5c32 100644 --- a/terraform/context.go +++ b/terraform/context.go @@ -519,6 +519,7 @@ func (c *Context) Plan() (*Plan, error) { Module: c.module, State: c.state, Providers: c.components.ResourceProviders(), + Targets: c.targets, }).Build(RootModulePath) } if err != nil && !newGraphEnabled { diff --git a/terraform/graph_builder_plan.go b/terraform/graph_builder_plan.go index f38828f0c6..0bef6750d9 100644 --- a/terraform/graph_builder_plan.go +++ b/terraform/graph_builder_plan.go @@ -26,6 +26,9 @@ type PlanGraphBuilder struct { // Providers is the list of providers supported. Providers []string + // Targets are resources to target + Targets []string + // DisableReduce, if true, will not reduce the graph. Great for testing. DisableReduce bool } @@ -78,6 +81,9 @@ func (b *PlanGraphBuilder) Steps() []GraphTransformer { Module: b.Module, }, + // Target + &TargetsTransformer{Targets: b.Targets}, + // Attach the configuration to any resources &AttachResourceConfigTransformer{Module: b.Module},