core: NodePlanDeposedResourceInstanceObject populate EvalReadStateDeposed
The Provider field is required and will cause a panic if not populated.
This commit is contained in:
parent
444cb96b48
commit
2fd016738a
|
@ -88,6 +88,13 @@ type EvalReadStateDeposed struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *EvalReadStateDeposed) Eval(ctx EvalContext) (interface{}, error) {
|
func (n *EvalReadStateDeposed) Eval(ctx EvalContext) (interface{}, error) {
|
||||||
|
if n.Provider == nil || *n.Provider == nil {
|
||||||
|
panic("EvalReadStateDeposed used with no Provider object")
|
||||||
|
}
|
||||||
|
if n.ProviderSchema == nil || *n.ProviderSchema == nil {
|
||||||
|
panic("EvalReadStateDeposed used with no ProviderSchema object")
|
||||||
|
}
|
||||||
|
|
||||||
key := n.Key
|
key := n.Key
|
||||||
if key == states.NotDeposed {
|
if key == states.NotDeposed {
|
||||||
return nil, fmt.Errorf("EvalReadStateDeposed used with no instance key; this is a bug in Terraform and should be reported")
|
return nil, fmt.Errorf("EvalReadStateDeposed used with no instance key; this is a bug in Terraform and should be reported")
|
||||||
|
|
|
@ -88,6 +88,7 @@ func (n *NodePlanDeposedResourceInstanceObject) EvalTree() EvalNode {
|
||||||
},
|
},
|
||||||
&EvalReadStateDeposed{
|
&EvalReadStateDeposed{
|
||||||
Addr: addr.Resource,
|
Addr: addr.Resource,
|
||||||
|
Provider: &provider,
|
||||||
ProviderSchema: &providerSchema,
|
ProviderSchema: &providerSchema,
|
||||||
Key: n.DeposedKey,
|
Key: n.DeposedKey,
|
||||||
Output: &state,
|
Output: &state,
|
||||||
|
|
Loading…
Reference in New Issue