a provisioner may not always have a connection
This commit is contained in:
parent
07042a95fa
commit
cdaeed4f26
|
@ -305,7 +305,9 @@ func (n *EvalApplyProvisioners) apply(ctx EvalContext, provs []*configs.Provisio
|
||||||
config, _, configDiags := ctx.EvaluateBlock(prov.Config, schema, instanceAddr, instanceAddr.Key)
|
config, _, configDiags := ctx.EvaluateBlock(prov.Config, schema, instanceAddr, instanceAddr.Key)
|
||||||
diags = diags.Append(configDiags)
|
diags = diags.Append(configDiags)
|
||||||
|
|
||||||
connInfo, _, connInfoDiags := ctx.EvaluateBlock(prov.Config, connectionBlockSupersetSchema, instanceAddr, instanceAddr.Key)
|
// A provisioner may not have a connection block
|
||||||
|
if prov.Connection != nil {
|
||||||
|
connInfo, _, connInfoDiags := ctx.EvaluateBlock(prov.Connection.Config, connectionBlockSupersetSchema, instanceAddr, instanceAddr.Key)
|
||||||
diags = diags.Append(connInfoDiags)
|
diags = diags.Append(connInfoDiags)
|
||||||
|
|
||||||
if configDiags.HasErrors() || connInfoDiags.HasErrors() {
|
if configDiags.HasErrors() || connInfoDiags.HasErrors() {
|
||||||
|
@ -338,6 +340,7 @@ func (n *EvalApplyProvisioners) apply(ctx EvalContext, provs []*configs.Provisio
|
||||||
overlay[k] = v
|
overlay[k] = v
|
||||||
}
|
}
|
||||||
state.Ephemeral.ConnInfo = overlay
|
state.Ephemeral.ConnInfo = overlay
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// Call pre hook
|
// Call pre hook
|
||||||
|
|
Loading…
Reference in New Issue