From 7b8f13862c145deffb6a5b102713a40ff7ef909b Mon Sep 17 00:00:00 2001 From: James Bardin Date: Wed, 13 May 2020 09:06:39 -0400 Subject: [PATCH] un-export new data eval nodes --- terraform/eval_read_data.go | 10 +++++----- terraform/eval_read_data_apply.go | 6 +++--- terraform/eval_read_data_plan.go | 14 +++++++------- terraform/node_data_refresh.go | 2 +- terraform/node_resource_apply_instance.go | 2 +- terraform/node_resource_plan_instance.go | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/terraform/eval_read_data.go b/terraform/eval_read_data.go index 474e82f93..b00f031a3 100644 --- a/terraform/eval_read_data.go +++ b/terraform/eval_read_data.go @@ -186,13 +186,13 @@ func (n *evalReadData) providerMetas(ctx EvalContext) (cty.Value, tfdiags.Diagno return metaConfigVal, diags } -// EvalReadDataRefresh is an EvalNode implementation that handled the data +// evalReadDataRefresh is an EvalNode implementation that handled the data // resource lifecycle during refresh -type EvalReadDataRefresh struct { +type evalReadDataRefresh struct { evalReadData } -func (n *EvalReadDataRefresh) Eval(ctx EvalContext) (interface{}, error) { +func (n *evalReadDataRefresh) Eval(ctx EvalContext) (interface{}, error) { var diags tfdiags.Diagnostics if n.ProviderSchema == nil || *n.ProviderSchema == nil { @@ -237,9 +237,9 @@ func (n *EvalReadDataRefresh) Eval(ctx EvalContext) (interface{}, error) { // read again. if !configKnown || (priorVal.IsNull() && len(n.Config.DependsOn) > 0) { if configKnown { - log.Printf("[TRACE] EvalReadDataRefresh: %s configuration is fully known, but we're forcing a read plan to be created", absAddr) + log.Printf("[TRACE] evalReadDataRefresh: %s configuration is fully known, but we're forcing a read plan to be created", absAddr) } else { - log.Printf("[TRACE] EvalReadDataRefresh: %s configuration not fully known yet, so deferring to apply phase", absAddr) + log.Printf("[TRACE] evalReadDataRefresh: %s configuration not fully known yet, so deferring to apply phase", absAddr) } // We need to store a change so tat other references to this data diff --git a/terraform/eval_read_data_apply.go b/terraform/eval_read_data_apply.go index 5d70fc9f3..ecdd440e6 100644 --- a/terraform/eval_read_data_apply.go +++ b/terraform/eval_read_data_apply.go @@ -8,14 +8,14 @@ import ( "github.com/hashicorp/terraform/tfdiags" ) -// EvalReadDataApply is an EvalNode implementation that deals with the main part +// evalReadDataApply is an EvalNode implementation that deals with the main part // of the data resource lifecycle: either actually reading from the data source // or generating a plan to do so. -type EvalReadDataApply struct { +type evalReadDataApply struct { evalReadData } -func (n *EvalReadDataApply) Eval(ctx EvalContext) (interface{}, error) { +func (n *evalReadDataApply) Eval(ctx EvalContext) (interface{}, error) { absAddr := n.Addr.Absolute(ctx.Path()) var diags tfdiags.Diagnostics diff --git a/terraform/eval_read_data_plan.go b/terraform/eval_read_data_plan.go index c2ec7b2fb..0f86b9f4d 100644 --- a/terraform/eval_read_data_plan.go +++ b/terraform/eval_read_data_plan.go @@ -13,10 +13,10 @@ import ( "github.com/hashicorp/terraform/tfdiags" ) -// EvalReadDataPlan is an EvalNode implementation that deals with the main part +// evalReadDataPlan is an EvalNode implementation that deals with the main part // of the data resource lifecycle: either actually reading from the data source // or generating a plan to do so. -type EvalReadDataPlan struct { +type evalReadDataPlan struct { evalReadData // dependsOn stores the list of transitive resource addresses that any @@ -26,7 +26,7 @@ type EvalReadDataPlan struct { dependsOn []addrs.ConfigResource } -func (n *EvalReadDataPlan) Eval(ctx EvalContext) (interface{}, error) { +func (n *evalReadDataPlan) Eval(ctx EvalContext) (interface{}, error) { absAddr := n.Addr.Absolute(ctx.Path()) var diags tfdiags.Diagnostics @@ -67,9 +67,9 @@ func (n *EvalReadDataPlan) Eval(ctx EvalContext) (interface{}, error) { // it in the state. if n.forcePlanRead(ctx) || !configKnown { if configKnown { - log.Printf("[TRACE] EvalReadDataPlan: %s configuration is fully known, but we're forcing a read plan to be created", absAddr) + log.Printf("[TRACE] evalReadDataPlan: %s configuration is fully known, but we're forcing a read plan to be created", absAddr) } else { - log.Printf("[TRACE] EvalReadDataPlan: %s configuration not fully known yet, so deferring to apply phase", absAddr) + log.Printf("[TRACE] evalReadDataPlan: %s configuration not fully known yet, so deferring to apply phase", absAddr) } proposedNewVal := objchange.PlannedDataResourceObject(schema, configVal) @@ -112,7 +112,7 @@ func (n *EvalReadDataPlan) Eval(ctx EvalContext) (interface{}, error) { // are any differences. proposed := objchange.ProposedNewObject(schema, priorVal, configVal) if proposed.Equals(priorVal).True() { - log.Printf("[TRACE] EvalReadDataPlan: %s no change detected, using existing state", absAddr) + log.Printf("[TRACE] evalReadDataPlan: %s no change detected, using existing state", absAddr) // state looks up to date, and must have been read during refresh return nil, diags.ErrWithWarnings() } @@ -152,7 +152,7 @@ func (n *EvalReadDataPlan) Eval(ctx EvalContext) (interface{}, error) { // forcePlanRead determines if we need to override the usual behavior of // immediately reading from the data source where possible, instead forcing us // to generate a plan. -func (n *EvalReadDataPlan) forcePlanRead(ctx EvalContext) bool { +func (n *evalReadDataPlan) forcePlanRead(ctx EvalContext) bool { // Check and see if any depends_on dependencies have // changes, since they won't show up as changes in the // configuration. diff --git a/terraform/node_data_refresh.go b/terraform/node_data_refresh.go index 6bbc5d689..3a601e372 100644 --- a/terraform/node_data_refresh.go +++ b/terraform/node_data_refresh.go @@ -213,7 +213,7 @@ func (n *NodeRefreshableDataResourceInstance) EvalTree() EvalNode { // EvalReadDataRefresh will _attempt_ to read the data source, but // may generate an incomplete planned object if the configuration // includes values that won't be known until apply. - &EvalReadDataRefresh{ + &evalReadDataRefresh{ evalReadData{ Addr: addr.Resource, Config: n.Config, diff --git a/terraform/node_resource_apply_instance.go b/terraform/node_resource_apply_instance.go index 8f1970554..6b8206b2c 100644 --- a/terraform/node_resource_apply_instance.go +++ b/terraform/node_resource_apply_instance.go @@ -172,7 +172,7 @@ func (n *NodeApplyableResourceInstance) evalTreeDataResource(addr addrs.AbsResou // In this particular call to EvalReadData we include our planned // change, which signals that we expect this read to complete fully // with no unknown values; it'll produce an error if not. - &EvalReadDataApply{ + &evalReadDataApply{ evalReadData{ Addr: addr.Resource, Config: n.Config, diff --git a/terraform/node_resource_plan_instance.go b/terraform/node_resource_plan_instance.go index 7e5073480..19f2b633f 100644 --- a/terraform/node_resource_plan_instance.go +++ b/terraform/node_resource_plan_instance.go @@ -73,7 +73,7 @@ func (n *NodePlannableResourceInstance) evalTreeDataResource(addr addrs.AbsResou ProviderSchema: &providerSchema, }, - &EvalReadDataPlan{ + &evalReadDataPlan{ evalReadData: evalReadData{ Addr: addr.Resource, Config: n.Config,