terraform: Provier.Diff (shadow) deep copy the config before call
This commit is contained in:
parent
817979c56d
commit
c2dd9a7338
|
@ -172,11 +172,12 @@ func (p *shadowResourceProviderReal) Diff(
|
|||
desired *ResourceConfig) (*InstanceDiff, error) {
|
||||
// Thse have to be copied before the call since call can modify
|
||||
stateCopy := state.DeepCopy()
|
||||
desiredCopy := desired.DeepCopy()
|
||||
|
||||
result, err := p.ResourceProvider.Diff(info, state, desired)
|
||||
p.Shared.Diff.SetValue(info.uniqueId(), &shadowResourceProviderDiff{
|
||||
State: stateCopy,
|
||||
Desired: desired,
|
||||
Desired: desiredCopy,
|
||||
Result: result.DeepCopy(),
|
||||
ResultErr: err,
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue