From 64e1241ae34013d4db1582ea2caca5c37609418f Mon Sep 17 00:00:00 2001 From: Krista LaFentres Date: Tue, 11 Jan 2022 16:53:36 -0600 Subject: [PATCH] backend/local: Remove unused DisablePlanFileStateLineageChecks flag Now that show command has been refactored to remove its dependence on a local backend and local run, this flag is no longer needed to fix #30195. --- internal/backend/backend.go | 7 ------- internal/backend/local/backend_local.go | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/internal/backend/backend.go b/internal/backend/backend.go index 0e1daef40..4124b2abd 100644 --- a/internal/backend/backend.go +++ b/internal/backend/backend.go @@ -275,13 +275,6 @@ type Operation struct { // the variables set in the plan are used instead, and they must be valid. AllowUnsetVariables bool - // When loading a plan file for a read-only operation, we may want to - // disable the state lineage checks which are only relevant for operations - // which can modify state. An example where this is important is showing - // a plan which was prepared against a non-default state file, because the - // lineage checks are always against the default state. - DisablePlanFileStateLineageChecks bool - // View implements the logic for all UI interactions. View views.Operation diff --git a/internal/backend/local/backend_local.go b/internal/backend/local/backend_local.go index a4a4fb67e..6082bfdf6 100644 --- a/internal/backend/local/backend_local.go +++ b/internal/backend/local/backend_local.go @@ -284,7 +284,7 @@ func (b *Local) localRunForPlanFile(op *backend.Operation, pf *planfile.Reader, )) return nil, snap, diags } - if !op.DisablePlanFileStateLineageChecks && currentStateMeta != nil { + if currentStateMeta != nil { // If the caller sets this, we require that the stored prior state // has the same metadata, which is an extra safety check that nothing // has changed since the plan was created. (All of the "real-world"