providers/terraform: Always produce correctly-typed result
We need to produce values for all of the attributes implied by our schema, even if some of them are null.
This commit is contained in:
parent
235f582ae5
commit
630b0d147d
|
@ -112,6 +112,8 @@ func dataSourceRemoteStateRead(d *cty.Value) (cty.Value, tfdiags.Diagnostics) {
|
||||||
if ws != backend.DefaultStateName {
|
if ws != backend.DefaultStateName {
|
||||||
name = ws
|
name = ws
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
newState["workspace"] = cty.NullVal(cty.String)
|
||||||
}
|
}
|
||||||
|
|
||||||
state, err := b.StateMgr(name)
|
state, err := b.StateMgr(name)
|
||||||
|
@ -139,6 +141,8 @@ func dataSourceRemoteStateRead(d *cty.Value) (cty.Value, tfdiags.Diagnostics) {
|
||||||
k, v := it.Element()
|
k, v := it.Element()
|
||||||
outputs[k.AsString()] = v
|
outputs[k.AsString()] = v
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
newState["defaults"] = cty.NullVal(cty.DynamicPseudoType)
|
||||||
}
|
}
|
||||||
|
|
||||||
remoteState := state.State()
|
remoteState := state.State()
|
||||||
|
|
Loading…
Reference in New Issue