plans/objchange: if priorV is unknown, fall through to the recursive call to `ProposedNewObject`
This commit is contained in:
parent
32974549cd
commit
2a8aa6a139
|
@ -96,7 +96,7 @@ func ProposedNewObject(schema *configschema.Block, prior, config cty.Value) cty.
|
||||||
newVals := make([]cty.Value, 0, l)
|
newVals := make([]cty.Value, 0, l)
|
||||||
for it := configV.ElementIterator(); it.Next(); {
|
for it := configV.ElementIterator(); it.Next(); {
|
||||||
idx, configEV := it.Element()
|
idx, configEV := it.Element()
|
||||||
if !priorV.HasIndex(idx).True() {
|
if priorV.IsKnown() && !priorV.HasIndex(idx).True() {
|
||||||
// If there is no corresponding prior element then
|
// If there is no corresponding prior element then
|
||||||
// we just take the config value as-is.
|
// we just take the config value as-is.
|
||||||
newVals = append(newVals, configEV)
|
newVals = append(newVals, configEV)
|
||||||
|
@ -159,7 +159,7 @@ func ProposedNewObject(schema *configschema.Block, prior, config cty.Value) cty.
|
||||||
for it := configV.ElementIterator(); it.Next(); {
|
for it := configV.ElementIterator(); it.Next(); {
|
||||||
idx, configEV := it.Element()
|
idx, configEV := it.Element()
|
||||||
k := idx.AsString()
|
k := idx.AsString()
|
||||||
if !priorV.HasIndex(idx).True() {
|
if priorV.IsKnown() && !priorV.HasIndex(idx).True() {
|
||||||
// If there is no corresponding prior element then
|
// If there is no corresponding prior element then
|
||||||
// we just take the config value as-is.
|
// we just take the config value as-is.
|
||||||
newVals[k] = configEV
|
newVals[k] = configEV
|
||||||
|
|
Loading…
Reference in New Issue