From 475e0f1e6b3916169a6562a094dc181097cbde7c Mon Sep 17 00:00:00 2001 From: James Bardin Date: Mon, 26 Sep 2016 14:24:13 -0400 Subject: [PATCH] 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 --- terraform/eval_apply.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/eval_apply.go b/terraform/eval_apply.go index 5dced0136..f8a42ed47 100644 --- a/terraform/eval_apply.go +++ b/terraform/eval_apply.go @@ -215,13 +215,13 @@ func (n *EvalApplyProvisioners) apply(ctx EvalContext) error { provisioner := ctx.Provisioner(prov.Type) // Interpolate the provisioner config - provConfig, err := ctx.Interpolate(prov.RawConfig, n.InterpResource) + provConfig, err := ctx.Interpolate(prov.RawConfig.Copy(), n.InterpResource) if err != nil { return err } // 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 { return err }