From 817979c56d5e54e745dda34fe43b4ae6583c844e Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 8 Oct 2016 18:04:04 +0800 Subject: [PATCH] terraform: ResourceProvider.ValidateResource (shadow) config deep copy --- terraform/shadow_resource_provider.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/terraform/shadow_resource_provider.go b/terraform/shadow_resource_provider.go index 862c77515..4535660e3 100644 --- a/terraform/shadow_resource_provider.go +++ b/terraform/shadow_resource_provider.go @@ -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, })