diff --git a/internal/terraform/context_apply.go b/internal/terraform/context_apply.go index 1aba22f8cf98..afc18b99462d 100644 --- a/internal/terraform/context_apply.go +++ b/internal/terraform/context_apply.go @@ -370,7 +370,7 @@ func (c *Context) applyGraph(plan *plans.Plan, config *configs.Config, opts *App Operation: operation, ExternalReferences: plan.ExternalReferences, Overrides: plan.Overrides, - SkipValidation: c.graphOpts.SkipGraphValidation, + SkipGraphValidation: c.graphOpts.SkipGraphValidation, }).Build(addrs.RootModuleInstance) diags = diags.Append(moreDiags) if moreDiags.HasErrors() { diff --git a/internal/terraform/context_plan.go b/internal/terraform/context_plan.go index 9536f7f9fb7c..3eae86d47d60 100644 --- a/internal/terraform/context_plan.go +++ b/internal/terraform/context_plan.go @@ -915,7 +915,7 @@ func (c *Context) planGraph(config *configs.Config, prevRunState *states.State, forgetResources: forgetResources, forgetModules: forgetModules, GenerateConfigPath: opts.GenerateConfigPath, - SkipValidation: c.graphOpts.SkipGraphValidation, + SkipGraphValidation: c.graphOpts.SkipGraphValidation, }).Build(addrs.RootModuleInstance) return graph, walkPlan, diags case plans.RefreshOnlyMode: @@ -931,6 +931,7 @@ func (c *Context) planGraph(config *configs.Config, prevRunState *states.State, Operation: walkPlan, ExternalReferences: opts.ExternalReferences, Overrides: opts.Overrides, + SkipGraphValidation: c.graphOpts.SkipGraphValidation, }).Build(addrs.RootModuleInstance) return graph, walkPlan, diags case plans.DestroyMode: @@ -944,6 +945,7 @@ func (c *Context) planGraph(config *configs.Config, prevRunState *states.State, skipRefresh: opts.SkipRefresh, Operation: walkPlanDestroy, Overrides: opts.Overrides, + SkipGraphValidation: c.graphOpts.SkipGraphValidation, }).Build(addrs.RootModuleInstance) return graph, walkPlanDestroy, diags default: diff --git a/internal/terraform/graph_builder.go b/internal/terraform/graph_builder.go index fb489c857c5a..f8ae346982fa 100644 --- a/internal/terraform/graph_builder.go +++ b/internal/terraform/graph_builder.go @@ -28,7 +28,8 @@ type BasicGraphBuilder struct { // Optional name to add to the graph debug log Name string - // SkipGraphValidation indicates whether the graph validation should be skipped. + // SkipGraphValidation indicates whether the graph validation (enabled by default) + // should be skipped after the graph is built. SkipGraphValidation bool } @@ -63,7 +64,7 @@ func (b *BasicGraphBuilder) Build(path addrs.ModuleInstance) (*Graph, tfdiags.Di // Return early if the graph validation is skipped // This behavior is currently only used by the graph command - // which only want to display the dot representation of the graph + // which only wants to display the dot representation of the graph if b.SkipGraphValidation { return g, diags } diff --git a/internal/terraform/graph_builder_apply.go b/internal/terraform/graph_builder_apply.go index 4c79f615901f..ee871eb0e57f 100644 --- a/internal/terraform/graph_builder_apply.go +++ b/internal/terraform/graph_builder_apply.go @@ -74,9 +74,9 @@ type ApplyGraphBuilder struct { // framework. Overrides *mocking.Overrides - // SkipValidation indicates whether the graph builder should skip + // SkipGraphValidation indicates whether the graph builder should skip // validation of the graph. - SkipValidation bool + SkipGraphValidation bool } // See GraphBuilder @@ -84,7 +84,7 @@ func (b *ApplyGraphBuilder) Build(path addrs.ModuleInstance) (*Graph, tfdiags.Di return (&BasicGraphBuilder{ Steps: b.Steps(), Name: "ApplyGraphBuilder", - SkipGraphValidation: b.SkipValidation, + SkipGraphValidation: b.SkipGraphValidation, }).Build(path) } diff --git a/internal/terraform/graph_builder_plan.go b/internal/terraform/graph_builder_plan.go index 3ee0057a6e6b..22c267afaadc 100644 --- a/internal/terraform/graph_builder_plan.go +++ b/internal/terraform/graph_builder_plan.go @@ -107,9 +107,9 @@ type PlanGraphBuilder struct { // If empty, then config will not be generated. GenerateConfigPath string - // SkipValidation indicates whether the graph builder should skip + // SkipGraphValidation indicates whether the graph builder should skip // validation of the graph. - SkipValidation bool + SkipGraphValidation bool } // See GraphBuilder @@ -118,7 +118,7 @@ func (b *PlanGraphBuilder) Build(path addrs.ModuleInstance) (*Graph, tfdiags.Dia return (&BasicGraphBuilder{ Steps: b.Steps(), Name: "PlanGraphBuilder", - SkipGraphValidation: b.SkipValidation, + SkipGraphValidation: b.SkipGraphValidation, }).Build(path) }