Skip to content

Commit 286a33c

Browse files
authored
feat: Adding bare enabled to unit and stack blocks (#6714)
* feat: Adding bare `enabled` to unit and stack blocks * chore: Fix-up
1 parent 51c60e2 commit 286a33c

17 files changed

Lines changed: 886 additions & 59 deletions

internal/stacks/output/output.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ func StackOutput(
154154
targetDir := filepath.Join(dir, config.StackDir)
155155

156156
for _, stack := range stackFile.Stacks {
157+
if !stack.IsEnabled() {
158+
continue
159+
}
160+
157161
declaredStacks[filepath.Join(targetDir, stack.Path)] = stack.Name
158162
l.Debugf(
159163
"Registered stack %s at path %s",
@@ -163,6 +167,10 @@ func StackOutput(
163167
}
164168

165169
for _, unit := range stackFile.Units {
170+
if !unit.IsEnabled() {
171+
continue
172+
}
173+
166174
unitDir := unit.GeneratedPath(dir)
167175

168176
// Excluded units are fully omitted from the final output, matching stack run behavior.

pkg/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,7 @@ func ParseConfig(
15041504
return nil, err
15051505
}
15061506

1507-
if err := ValidateExpansionExperiment(pctx.Experiments, file); err != nil {
1507+
if err := ValidateBlockIterationExperiment(pctx.Experiments, file); err != nil {
15081508
return nil, err
15091509
}
15101510

pkg/config/config_partial.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ func PartialParseConfig(
618618
return nil, err
619619
}
620620

621-
if err := ValidateExpansionExperiment(pctx.Experiments, file); err != nil {
621+
if err := ValidateBlockIterationExperiment(pctx.Experiments, file); err != nil {
622622
return nil, err
623623
}
624624

pkg/config/dependency.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,10 @@ func collectStackUnitOutputs(
10021002
unitOutputs := make(map[string]cty.Value)
10031003

10041004
for _, unit := range units {
1005+
if !unit.IsEnabled() {
1006+
continue
1007+
}
1008+
10051009
unitDir := unit.GeneratedPath(stackDir)
10061010
unitConfigPath := filepath.Join(unitDir, DefaultTerragruntConfigPath)
10071011

0 commit comments

Comments
 (0)