mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-27 09:21:14 -06:00
Fix race on Provisioner.RawConfig
A race when accessing Provisioner.RawConfig can cause unexpected output for provisioners that interpolate variables. Use RawConfig.Copy which needs to acquire the RawConfig mutex to get the values. Fixes #8890
This commit is contained in:
parent
73183a064c
commit
475e0f1e6b
@ -215,13 +215,13 @@ func (n *EvalApplyProvisioners) apply(ctx EvalContext) error {
|
|||||||
provisioner := ctx.Provisioner(prov.Type)
|
provisioner := ctx.Provisioner(prov.Type)
|
||||||
|
|
||||||
// Interpolate the provisioner config
|
// Interpolate the provisioner config
|
||||||
provConfig, err := ctx.Interpolate(prov.RawConfig, n.InterpResource)
|
provConfig, err := ctx.Interpolate(prov.RawConfig.Copy(), n.InterpResource)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Interpolate the conn info, since it may contain variables
|
// Interpolate the conn info, since it may contain variables
|
||||||
connInfo, err := ctx.Interpolate(prov.ConnInfo, n.InterpResource)
|
connInfo, err := ctx.Interpolate(prov.ConnInfo.Copy(), n.InterpResource)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user