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) {
|
desired *ResourceConfig) (*InstanceDiff, error) {
|
||||||
// Thse have to be copied before the call since call can modify
|
// Thse have to be copied before the call since call can modify
|
||||||
stateCopy := state.DeepCopy()
|
stateCopy := state.DeepCopy()
|
||||||
|
desiredCopy := desired.DeepCopy()
|
||||||
|
|
||||||
result, err := p.ResourceProvider.Diff(info, state, desired)
|
result, err := p.ResourceProvider.Diff(info, state, desired)
|
||||||
p.Shared.Diff.SetValue(info.uniqueId(), &shadowResourceProviderDiff{
|
p.Shared.Diff.SetValue(info.uniqueId(), &shadowResourceProviderDiff{
|
||||||
State: stateCopy,
|
State: stateCopy,
|
||||||
Desired: desired,
|
Desired: desiredCopy,
|
||||||
Result: result.DeepCopy(),
|
Result: result.DeepCopy(),
|
||||||
ResultErr: err,
|
ResultErr: err,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue