mirror of
https://github.com/opentofu/opentofu.git
synced 2026-02-18 18:17:54 -05:00
states: SyncState.ResourceInstanceObjectFull tolerate missing resource
This was previously dealing okay with the case where a resource doesn't have the requested instance, but was not handling the situation where the resource doesn't exist at all yet. Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
This commit is contained in:
parent
e879e9060f
commit
f36fd65dbd
1 changed files with 3 additions and 0 deletions
|
|
@ -84,6 +84,9 @@ func (s *SyncState) ResourceInstanceObjectFull(addr addrs.AbsResourceInstance, d
|
|||
defer s.lock.RUnlock()
|
||||
|
||||
rsrc := s.state.Resource(addr.ContainingResource())
|
||||
if rsrc == nil {
|
||||
return nil
|
||||
}
|
||||
inst := rsrc.Instances[addr.Resource.Key]
|
||||
if inst == nil {
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue