From 0f5bf21983878fd15797ee29de50ab3a178756e6 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Fri, 9 Oct 2020 18:14:07 -0400 Subject: [PATCH] remove last use of the apply graph Destroy flag! The apply graph builder no longer uses the destroy flag, which is not always known since the destroy flag is not stored in the plan file. --- terraform/context.go | 1 - terraform/graph_builder_apply.go | 3 --- terraform/graph_builder_apply_test.go | 1 - 3 files changed, 5 deletions(-) diff --git a/terraform/context.go b/terraform/context.go index e3f26ef59..8db2e58ba 100644 --- a/terraform/context.go +++ b/terraform/context.go @@ -277,7 +277,6 @@ func (c *Context) Graph(typ GraphType, opts *ContextGraphOpts) (*Graph, tfdiags. Components: c.components, Schemas: c.schemas, Targets: c.targets, - Destroy: c.destroy, Validate: opts.Validate, }).Build(addrs.RootModuleInstance) diff --git a/terraform/graph_builder_apply.go b/terraform/graph_builder_apply.go index 5fc263516..a0a5210af 100644 --- a/terraform/graph_builder_apply.go +++ b/terraform/graph_builder_apply.go @@ -40,9 +40,6 @@ type ApplyGraphBuilder struct { // outputs should go into the diff so that this is unnecessary. Targets []addrs.Targetable - // Destroy, if true, represents a pure destroy operation - Destroy bool - // Validate will do structural validation of the graph. Validate bool } diff --git a/terraform/graph_builder_apply_test.go b/terraform/graph_builder_apply_test.go index 9f49ff743..3e1f6e29c 100644 --- a/terraform/graph_builder_apply_test.go +++ b/terraform/graph_builder_apply_test.go @@ -468,7 +468,6 @@ func TestApplyGraphBuilder_provisionerDestroy(t *testing.T) { } b := &ApplyGraphBuilder{ - Destroy: true, Config: testModule(t, "graph-builder-apply-provisioner"), Changes: changes, Components: simpleMockComponentFactory(),