Documentation
¶
Index ¶
- func BuildTerraformGraph(stacks map[string]any) (*dependency.Graph, error)
- func ExecuteTerraform(ctx context.Context, opts TerraformOptions) error
- func FilterTerraformGraph(atmosConfig *schema.AtmosConfiguration, graph *dependency.Graph, ...) (*dependency.Graph, error)
- func FlagDepthToFilterDepth(flagValue int) int
- type TerraformDispatcher
- type TerraformExecution
- type TerraformExecutionResult
- type TerraformExecutor
- type TerraformNodeOutcome
- type TerraformOptions
- type TerraformSelection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTerraformGraph ¶
func BuildTerraformGraph(stacks map[string]any) (*dependency.Graph, error)
BuildTerraformGraph builds a Terraform component graph from described stacks.
func ExecuteTerraform ¶
func ExecuteTerraform(ctx context.Context, opts TerraformOptions) error
ExecuteTerraform runs selected Terraform components through the shared scheduler.
func FilterTerraformGraph ¶
func FilterTerraformGraph(atmosConfig *schema.AtmosConfiguration, graph *dependency.Graph, info *schema.ConfigAndStacksInfo, selection *TerraformSelection) (*dependency.Graph, error)
FilterTerraformGraph narrows graph nodes to the user-selected bulk operation set: a seed (stack/components/query filters or a precomputed --affected selection, further narrowed by tags/labels), optionally expanded with the dependency/dependent closure around the seed. Selectors choose the seed; closure flags expand it — closure-added nodes execute even when they do not match the selectors, since they are prerequisites (or dependents) of what was selected, not selections themselves.
func FlagDepthToFilterDepth ¶ added in v1.225.0
FlagDepthToFilterDepth converts the flag encoding (-1 = unlimited, N>0 = depth) into dependency.Filter's encoding (0 = unlimited). Exported so selection producers (e.g. the terraform --affected path) can carry the flag-side depth into TerraformSelection using the same conversion the closure spec applies to info.
Types ¶
type TerraformDispatcher ¶
type TerraformDispatcher struct {
// contains filtered or unexported fields
}
TerraformDispatcher adapts scheduler nodes to Terraform component execution.
func (*TerraformDispatcher) Dispatch ¶
func (d *TerraformDispatcher) Dispatch(ctx context.Context, node *dependency.Node) (scheduler.Result, error)
Dispatch executes one Terraform scheduler node.
type TerraformExecution ¶
type TerraformExecution struct {
Context context.Context
Info schema.ConfigAndStacksInfo
Stdout io.Writer
Stderr io.Writer
CaptureOutput bool
Flush func() error
}
TerraformExecution contains the execution context for one Terraform component.
type TerraformExecutionResult ¶
TerraformExecutionResult contains captured output for one Terraform component.
func (TerraformExecutionResult) CombinedOutput ¶
func (r TerraformExecutionResult) CombinedOutput() string
CombinedOutput returns stdout and stderr in the order hooks expect.
type TerraformExecutor ¶
type TerraformExecutor func(TerraformExecution) (TerraformExecutionResult, error)
TerraformExecutor executes one resolved Terraform component instance.
type TerraformNodeOutcome ¶
type TerraformNodeOutcome struct {
Processed bool `json:"processed"`
Changed bool `json:"changed"`
ExitCode int `json:"exit_code"`
LogFiles map[string]string `json:"log_files,omitempty"`
Output string `json:"-"`
}
TerraformNodeOutcome records the scheduler-visible result for one Terraform node.
type TerraformOptions ¶
type TerraformOptions struct {
AtmosConfig *schema.AtmosConfiguration
Info *schema.ConfigAndStacksInfo
Stacks map[string]any
Executor TerraformExecutor
Selection *TerraformSelection
}
TerraformOptions configures graph-backed Terraform bulk execution.
type TerraformSelection ¶
type TerraformSelection struct {
NodeIDs []string
IncludeDependencies bool
IncludeDependents bool
// DependencyDepth/DependentDepth bound the closure expansion in each
// direction when the matching Include* field is true (0 = unlimited).
DependencyDepth int
DependentDepth int
}
TerraformSelection narrows the scheduler graph to a precomputed set of Terraform nodes, optionally including graph closure around those nodes.