core: Don't try to run provisioners with nil state
If a resource has been removed altogether then we have nothing to provision.
This commit is contained in:
parent
3e64311dc2
commit
e22f1d5dce
|
@ -205,6 +205,10 @@ type EvalApplyProvisioners struct {
|
|||
// TODO: test
|
||||
func (n *EvalApplyProvisioners) Eval(ctx EvalContext) (interface{}, error) {
|
||||
state := *n.State
|
||||
if state == nil {
|
||||
log.Printf("[TRACE] EvalApplyProvisioners: %s has no state, so skipping provisioners", n.Addr)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// The hook API still uses the legacy InstanceInfo type, so we need to shim it.
|
||||
legacyInfo := NewInstanceInfo(n.Addr.Absolute(ctx.Path()))
|
||||
|
|
Loading…
Reference in New Issue