Skip to content

Commit

Permalink
Config update
Browse files Browse the repository at this point in the history
  • Loading branch information
denis256 committed Feb 21, 2025
1 parent 11be897 commit 7f73714
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
12 changes: 7 additions & 5 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -895,12 +895,14 @@ func ParseConfig(ctx *ParsingContext, file *hclparse.File, includeFromChild *Inc
}

// read unit files and add to context
unitValues, err := ReadUnitValues(ctx.Context, ctx.TerragruntOptions, filepath.Dir(file.ConfigPath))
if err != nil {
return nil, err
}
if ctx.TerragruntOptions.Experiments.Evaluate(experiment.Stacks) {
unitValues, err := ReadUnitValues(ctx.Context, ctx.TerragruntOptions, filepath.Dir(file.ConfigPath))
if err != nil {
return nil, err
}

ctx = ctx.WithValues(unitValues)
ctx = ctx.WithValues(unitValues)
}

// Decode just the Base blocks. See the function docs for DecodeBaseBlocks for more info on what base blocks are.
baseBlocks, err := DecodeBaseBlocks(ctx, file, includeFromChild)
Expand Down
14 changes: 9 additions & 5 deletions config/config_partial.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"os"
"path/filepath"

"github.com/gruntwork-io/terragrunt/internal/experiment"

"github.com/gruntwork-io/terragrunt/pkg/log"
"github.com/huandu/go-clone"

Expand Down Expand Up @@ -347,12 +349,14 @@ func PartialParseConfig(ctx *ParsingContext, file *hclparse.File, includeFromChi
ctx = ctx.WithTrackInclude(nil)

// read unit files and add to context
unitValues, err := ReadUnitValues(ctx.Context, ctx.TerragruntOptions, filepath.Dir(file.ConfigPath))
if err != nil {
return nil, err
}
if ctx.TerragruntOptions.Experiments.Evaluate(experiment.Stacks) {
unitValues, err := ReadUnitValues(ctx.Context, ctx.TerragruntOptions, filepath.Dir(file.ConfigPath))
if err != nil {
return nil, err
}

ctx = ctx.WithValues(unitValues)
ctx = ctx.WithValues(unitValues)
}

// Decode just the Base blocks. See the function docs for DecodeBaseBlocks for more info on what base blocks are.
// Initialize evaluation ctx extensions from base blocks.
Expand Down

0 comments on commit 7f73714

Please sign in to comment.