un-export new data eval nodes

This commit is contained in:
James Bardin 2020-05-13 09:06:39 -04:00
parent 8e3728af54
commit 7b8f13862c
6 changed files with 18 additions and 18 deletions

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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,

View File

@ -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,

View File

@ -73,7 +73,7 @@ func (n *NodePlannableResourceInstance) evalTreeDataResource(addr addrs.AbsResou
ProviderSchema: &providerSchema,
},
&EvalReadDataPlan{
&evalReadDataPlan{
evalReadData: evalReadData{
Addr: addr.Resource,
Config: n.Config,