From 8dc6f518c22a8e6d8a4abbc327c63a89f1f25834 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Wed, 30 Sep 2020 11:49:04 -0400 Subject: [PATCH] don't use same state in Validate for refreshState --- terraform/context.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/terraform/context.go b/terraform/context.go index 4dbb18012..ccb8941bb 100644 --- a/terraform/context.go +++ b/terraform/context.go @@ -743,12 +743,11 @@ func (c *Context) graphWalker(operation walkOperation) *ContextGraphWalker { switch operation { case walkValidate: // validate should not use any state - s := states.NewState() - state = s.SyncWrapper() + state = states.NewState().SyncWrapper() // validate currently uses the plan graph, so we have to populate the // refreshState. - refreshState = s.SyncWrapper() + refreshState = states.NewState().SyncWrapper() case walkPlan: state = c.state.SyncWrapper()