From e9d9205ce8461f7611cba369a5e8d4fea8c53034 Mon Sep 17 00:00:00 2001 From: Pam Selle <204372+pselle@users.noreply.github.com> Date: Fri, 4 Sep 2020 12:32:52 -0400 Subject: [PATCH] Modifications to eval_diff --- terraform/eval_diff.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/terraform/eval_diff.go b/terraform/eval_diff.go index 1408dd01c..78d152255 100644 --- a/terraform/eval_diff.go +++ b/terraform/eval_diff.go @@ -146,7 +146,6 @@ func (n *EvalDiff) Eval(ctx EvalContext) (interface{}, error) { // necessary unmarkedConfigVal := configVal var unmarkedPaths []cty.PathValueMarks - // var marks cty.ValueMarks if configVal.ContainsMarked() { // store the marked values so we can re-mark them later after // we've sent things over the wire. Right now this stores @@ -250,8 +249,9 @@ func (n *EvalDiff) Eval(ctx EvalContext) (interface{}, error) { plannedNewVal := resp.PlannedState // Add the marks back to the planned new value + markedPlannedNewVal := plannedNewVal if configVal.ContainsMarked() { - plannedNewVal = plannedNewVal.MarkWithPaths(unmarkedPaths) + markedPlannedNewVal = plannedNewVal.MarkWithPaths(unmarkedPaths) } plannedPrivate := resp.PlannedPrivate @@ -499,7 +499,10 @@ func (n *EvalDiff) Eval(ctx EvalContext) (interface{}, error) { Change: plans.Change{ Action: action, Before: priorVal, - After: plannedNewVal, + // Pass the marked value through in our change + // to propogate through evaluation. + // Marks will be removed when encoding. + After: markedPlannedNewVal, }, RequiredReplace: reqRep, }