config/hcl2shim: don't put nils in ConfigValue maps
Absent values are omitted by the old code we are emulating in HCL, so we must do the same here in order to avoid breaking assumptions in the helper/schema layer.
This commit is contained in:
parent
860a57d104
commit
c51d22bdeb
|
@ -73,7 +73,10 @@ func ConfigValueFromHCL2(v cty.Value) interface{} {
|
|||
it := v.ElementIterator()
|
||||
for it.Next() {
|
||||
ek, ev := it.Element()
|
||||
l[ek.AsString()] = ConfigValueFromHCL2(ev)
|
||||
cv := ConfigValueFromHCL2(ev)
|
||||
if cv != nil {
|
||||
l[ek.AsString()] = cv
|
||||
}
|
||||
}
|
||||
return l
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue