More comments and names
This commit is contained in:
parent
fd34def9dc
commit
3b4382082d
|
@ -101,9 +101,9 @@ func (ms *Module) SetResourceInstanceCurrent(addr addrs.ResourceInstance, obj *R
|
||||||
delete(ms.Resources, addr.Resource.String())
|
delete(ms.Resources, addr.Resource.String())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// check for an existing resource
|
// check for an existing resource, now that we've ensured that rs.Instances is more than 0/not nil
|
||||||
inst := rs.Instances[addr.Key]
|
is := rs.Instances[addr.Key]
|
||||||
if inst == nil {
|
if is == nil {
|
||||||
// if there is no instance, but the resource exists and has other instances,
|
// if there is no instance, but the resource exists and has other instances,
|
||||||
// be chill, just return
|
// be chill, just return
|
||||||
return
|
return
|
||||||
|
@ -111,8 +111,8 @@ func (ms *Module) SetResourceInstanceCurrent(addr addrs.ResourceInstance, obj *R
|
||||||
// if we have an instance, update the current
|
// if we have an instance, update the current
|
||||||
// TODO: this setting happens below as well, so possibly this can be removed,
|
// TODO: this setting happens below as well, so possibly this can be removed,
|
||||||
// but not changing it right now as we might return in the block below
|
// but not changing it right now as we might return in the block below
|
||||||
inst.Current = obj
|
is.Current = obj
|
||||||
if !inst.HasObjects() {
|
if !is.HasObjects() {
|
||||||
// If we have no objects at all then we'll clean up.
|
// If we have no objects at all then we'll clean up.
|
||||||
delete(rs.Instances, addr.Key)
|
delete(rs.Instances, addr.Key)
|
||||||
if len(rs.Instances) == 0 {
|
if len(rs.Instances) == 0 {
|
||||||
|
@ -120,6 +120,7 @@ func (ms *Module) SetResourceInstanceCurrent(addr addrs.ResourceInstance, obj *R
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Nothing more to do here, so return!
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if rs == nil && obj != nil {
|
if rs == nil && obj != nil {
|
||||||
|
|
Loading…
Reference in New Issue