Skip to content

Commit

Permalink
some rename
Browse files Browse the repository at this point in the history
  • Loading branch information
dsa0x committed Dec 11, 2024
1 parent f41ce87 commit 7f44609
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion internal/terraform/context_apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 3 additions & 1 deletion internal/terraform/context_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions internal/terraform/graph_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions internal/terraform/graph_builder_apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,17 @@ 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
func (b *ApplyGraphBuilder) Build(path addrs.ModuleInstance) (*Graph, tfdiags.Diagnostics) {
return (&BasicGraphBuilder{
Steps: b.Steps(),
Name: "ApplyGraphBuilder",
SkipGraphValidation: b.SkipValidation,
SkipGraphValidation: b.SkipGraphValidation,
}).Build(path)
}

Expand Down
6 changes: 3 additions & 3 deletions internal/terraform/graph_builder_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}

Expand Down

0 comments on commit 7f44609

Please sign in to comment.