plans/planfile: allow resource instances with no instance key
This happens for resources that don't have either "count" or "for_each" set.
This commit is contained in:
parent
9e0f7c10d9
commit
9179cdcbc6
|
@ -172,6 +172,7 @@ func resourceChangeFromTfplan(rawChange *planproto.ResourceInstanceChange) (*pla
|
||||||
|
|
||||||
var instKey addrs.InstanceKey
|
var instKey addrs.InstanceKey
|
||||||
switch rawTk := rawChange.InstanceKey.(type) {
|
switch rawTk := rawChange.InstanceKey.(type) {
|
||||||
|
case nil:
|
||||||
case *planproto.ResourceInstanceChange_Int:
|
case *planproto.ResourceInstanceChange_Int:
|
||||||
instKey = addrs.IntKey(rawTk.Int)
|
instKey = addrs.IntKey(rawTk.Int)
|
||||||
case *planproto.ResourceInstanceChange_Str:
|
case *planproto.ResourceInstanceChange_Str:
|
||||||
|
@ -382,6 +383,8 @@ func resourceChangeToTfplan(change *plans.ResourceInstanceChangeSrc) (*planproto
|
||||||
ret.Name = relAddr.Resource.Name
|
ret.Name = relAddr.Resource.Name
|
||||||
|
|
||||||
switch tk := relAddr.Key.(type) {
|
switch tk := relAddr.Key.(type) {
|
||||||
|
case nil:
|
||||||
|
// Nothing to do, then.
|
||||||
case addrs.IntKey:
|
case addrs.IntKey:
|
||||||
ret.InstanceKey = &planproto.ResourceInstanceChange_Int{
|
ret.InstanceKey = &planproto.ResourceInstanceChange_Int{
|
||||||
Int: int64(tk),
|
Int: int64(tk),
|
||||||
|
|
Loading…
Reference in New Issue