plans: ChangesSync.GetResourceInstanceChange must copy the change

This is promised in its doc comment, but wasn't actually done in practice.
pull/19086/head
Martin Atkins 8 years ago
parent c27f900d92
commit 2f0e5d93c8

@ -54,10 +54,10 @@ func (cs *ChangesSync) GetResourceInstanceChange(addr addrs.AbsResourceInstance,
defer cs.lock.Unlock()
if gen == states.CurrentGen {
return cs.changes.ResourceInstance(addr)
return cs.changes.ResourceInstance(addr).DeepCopy()
}
if dk, ok := gen.(states.DeposedKey); ok {
return cs.changes.ResourceInstanceDeposed(addr, dk)
return cs.changes.ResourceInstanceDeposed(addr, dk).DeepCopy()
}
panic(fmt.Sprintf("unsupported generation value %#v", gen))
}

Loading…
Cancel
Save