terraform: if components is closed, initialize closed components

This was happening if the shadow initializes a provider that is never
used by the real side. We need to make sure it starts closed.
This commit is contained in:
Mitchell Hashimoto 2016-10-19 14:10:46 -07:00
parent d87bdc2d2b
commit 5d598ad217
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
1 changed files with 8 additions and 0 deletions

View File

@ -208,6 +208,10 @@ func (f *shadowComponentFactoryShared) ResourceProvider(
real, shadow := newShadowResourceProvider(p) real, shadow := newShadowResourceProvider(p)
entry.Real = real entry.Real = real
entry.Shadow = shadow entry.Shadow = shadow
if f.closed {
shadow.CloseShadow()
}
} }
// Store the value // Store the value
@ -246,6 +250,10 @@ func (f *shadowComponentFactoryShared) ResourceProvisioner(
real, shadow := newShadowResourceProvisioner(p) real, shadow := newShadowResourceProvisioner(p)
entry.Real = real entry.Real = real
entry.Shadow = shadow entry.Shadow = shadow
if f.closed {
shadow.CloseShadow()
}
} }
// Store the value // Store the value