terraform: ResourceProvider.ValidateResource (shadow) config deep copy

This commit is contained in:
Mitchell Hashimoto 2016-10-08 18:04:04 +08:00
parent d7a5cc5b35
commit 817979c56d
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
1 changed files with 2 additions and 1 deletions

View File

@ -110,6 +110,7 @@ func (p *shadowResourceProviderReal) Configure(c *ResourceConfig) error {
func (p *shadowResourceProviderReal) ValidateResource(
t string, c *ResourceConfig) ([]string, []error) {
key := t
configCopy := c.DeepCopy()
// Real operation
warns, errs := p.ResourceProvider.ValidateResource(t, c)
@ -134,7 +135,7 @@ func (p *shadowResourceProviderReal) ValidateResource(
defer wrapper.Unlock()
wrapper.Calls = append(wrapper.Calls, &shadowResourceProviderValidateResource{
Config: c,
Config: configCopy,
Warns: warns,
Errors: errs,
})