remove IsFullDestroy workaround

IsFullDestroy was a workaround during apply to detect when the change
set was created by a destroy plan. This no longer works correctly, and
we need to fall back to the UIMode set in the plan.
pull/32051/head
James Bardin 4 years ago
parent bcb792ee00
commit 47b6386348

@ -21,24 +21,6 @@ type ChangesSync struct {
changes *Changes
}
// IsFullDestroy returns true if the set of changes indicates we are doing a
// destroy of all resources.
func (cs *ChangesSync) IsFullDestroy() bool {
if cs == nil {
panic("FullDestroy on nil ChangesSync")
}
cs.lock.Lock()
defer cs.lock.Unlock()
for _, c := range cs.changes.Resources {
if c.Action != Delete {
return false
}
}
return true
}
// AppendResourceInstanceChange records the given resource instance change in
// the set of planned resource changes.
//

@ -728,7 +728,7 @@ func (d *evaluationStateData) GetResource(addr addrs.Resource, rng tfdiags.Sourc
// Decode all instances in the current state
instances := map[addrs.InstanceKey]cty.Value{}
pendingDestroy := d.Evaluator.Changes.IsFullDestroy()
pendingDestroy := d.Operation == walkDestroy
for key, is := range rs.Instances {
if is == nil || is.Current == nil {
// Assume we're dealing with an instance that hasn't been created yet.

Loading…
Cancel
Save