terraform: compare diffs on shadow Apply

This commit is contained in:
Mitchell Hashimoto 2016-10-12 19:01:02 +08:00
parent 7f04b33d3d
commit 9a876f65ba
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
1 changed files with 7 additions and 1 deletions

View File

@ -523,7 +523,13 @@ func (p *shadowResourceProviderShadow) Apply(
p.ErrorLock.Unlock()
}
// TODO: compare diffs
if !diff.Equal(result.Diff) {
p.ErrorLock.Lock()
p.Error = multierror.Append(p.Error, fmt.Errorf(
"Apply: unequal diffs (real, then shadow):\n\n%#v\n\n%#v",
result.Diff, diff))
p.ErrorLock.Unlock()
}
return result.Result, result.ResultErr
}