core: Allow unknown values as variable outputs in EvalWriteOutput
At the moment this must be handled as a special case because we're still using the old representation of output state, but we do still need to handle this so that unknown values can properly pass between modules during validate and plan.
This commit is contained in:
parent
d5fda47751
commit
0b4ac6d9e3
|
@ -130,6 +130,17 @@ func (n *EvalWriteOutput) Eval(ctx EvalContext) (interface{}, error) {
|
||||||
Sensitive: n.Sensitive,
|
Sensitive: n.Sensitive,
|
||||||
Value: valueTyped,
|
Value: valueTyped,
|
||||||
}
|
}
|
||||||
|
case !val.IsWhollyKnown():
|
||||||
|
// While we're still using our existing state format, we can't represent
|
||||||
|
// partially-unknown values properly, so we'll just stub the whole
|
||||||
|
// thing out.
|
||||||
|
// FIXME: After the state format is revised, remove this special case
|
||||||
|
// and just store the unknown value directly.
|
||||||
|
mod.Outputs[n.Addr.Name] = &OutputState{
|
||||||
|
Type: "unknown",
|
||||||
|
Sensitive: n.Sensitive,
|
||||||
|
Value: hcl2shim.UnknownVariableValue,
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("output %s is not a valid type (%s)", n.Addr.Name, ty.FriendlyName())
|
return nil, fmt.Errorf("output %s is not a valid type (%s)", n.Addr.Name, ty.FriendlyName())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue