skip unset values in conection blocks

There's no valid, null value for the connection strings, so we can skip
over any unset values from the schema.
This commit is contained in:
James Bardin 2018-05-29 15:01:54 -04:00 committed by Martin Atkins
parent 6a896c8748
commit 903852b8e2
1 changed files with 7 additions and 0 deletions

View File

@ -326,6 +326,12 @@ func (n *EvalApplyProvisioners) apply(ctx EvalContext, provs []*configs.Provisio
kv, vv := it.Element()
var k, v string
// there are no unset or null values in a connection block, and
// everything needs to map to a string.
if vv.IsNull() {
continue
}
err := gocty.FromCtyValue(kv, &k)
if err != nil {
// Should never happen, because connectionBlockSupersetSchema requires all primitives
@ -339,6 +345,7 @@ func (n *EvalApplyProvisioners) apply(ctx EvalContext, provs []*configs.Provisio
overlay[k] = v
}
state.Ephemeral.ConnInfo = overlay
}