From 4f1692cfaf5c9eb5010c3a31b9921de40076eed2 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Wed, 25 Mar 2020 15:53:54 -0400 Subject: [PATCH] comment updates --- terraform/eval_context_builtin.go | 6 ------ terraform/node_resource_apply.go | 2 -- terraform/node_resource_plan.go | 9 +-------- terraform/node_resource_refresh.go | 5 +++++ 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/terraform/eval_context_builtin.go b/terraform/eval_context_builtin.go index ff3dcf8b5..755d2d8f3 100644 --- a/terraform/eval_context_builtin.go +++ b/terraform/eval_context_builtin.go @@ -215,12 +215,6 @@ func (ctx *BuiltinEvalContext) ProviderInput(pc addrs.AbsProviderConfig) map[str func (ctx *BuiltinEvalContext) SetProviderInput(pc addrs.AbsProviderConfig, c map[string]cty.Value) { absProvider := pc - //if !absProvider.Module.Equal(ctx.Path().Module()) { - // // This indicates incorrect use of InitProvider: it should be used - // // only from the module that the provider configuration belongs to. - // panic(fmt.Sprintf("%s initialized by wrong module %s", absProvider, ctx.Path())) - //} - if !pc.Module.IsRoot() { // Only root module provider configurations can have input. log.Printf("[WARN] BuiltinEvalContext: attempt to SetProviderInput for non-root module") diff --git a/terraform/node_resource_apply.go b/terraform/node_resource_apply.go index 1e53c9cf2..6b4250a30 100644 --- a/terraform/node_resource_apply.go +++ b/terraform/node_resource_apply.go @@ -13,8 +13,6 @@ import ( // context with which to expand the resource into multiple instances. // This type should be a drop in replacement for NodeApplyableResource, and // needs to mirror any non-evaluation methods exactly. -// TODO: We may want to simplify this later by passing EvalContext to EvalTree, -// and returning an EvalEquence. type nodeExpandApplyableResource struct { *NodeAbstractResource } diff --git a/terraform/node_resource_plan.go b/terraform/node_resource_plan.go index 1fcc09f03..d78b451f1 100644 --- a/terraform/node_resource_plan.go +++ b/terraform/node_resource_plan.go @@ -11,17 +11,10 @@ import ( // nodeExpandPlannableResource handles the first layer of resource // expansion. We need this extra layer so DynamicExpand is called twice for // the resource, the first to expand the Resource for each module instance, and -// the second to expand each ResourceInstnace for the expanded Resources. -// -// Even though the Expander can handle this recursive expansion, the -// EvalWriteState nodes need to be expanded and Evaluated first, and our -// current graph doesn't allow evaluation within DynamicExpand, and doesn't -// call it recursively. +// the second to expand each ResourceInstance for the expanded Resources. type nodeExpandPlannableResource struct { *NodeAbstractResource - // TODO: can we eliminate the need for this flag and combine this with the - // apply expander? // ForceCreateBeforeDestroy might be set via our GraphNodeDestroyerCBD // during graph construction, if dependencies require us to force this // on regardless of what the configuration says. diff --git a/terraform/node_resource_refresh.go b/terraform/node_resource_refresh.go index 98603454d..e874f4705 100644 --- a/terraform/node_resource_refresh.go +++ b/terraform/node_resource_refresh.go @@ -14,6 +14,11 @@ import ( "github.com/hashicorp/terraform/tfdiags" ) +// nodeExpandRefreshableResource handles the first layer of resource +// expansion durin refresh. We need this extra layer so DynamicExpand is called +// twice for the resource, the first to expand the Resource for each module +// instance, and the second to expand each ResourceInstance for the expanded +// Resources. type nodeExpandRefreshableManagedResource struct { *NodeAbstractResource