Skip to content

Commit beaff71

Browse files
committed
bug: fixed matching of default stack file
1 parent 817f3cf commit beaff71

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

config/config_helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ func ParseTerragruntConfig(ctx *ParsingContext, l log.Logger, configPath string,
740740
}
741741

742742
// check if file is stack file, decode as stack file
743-
if strings.HasSuffix(targetConfig, DefaultStackFile) {
743+
if filepath.Base(targetConfig) == DefaultStackFile {
744744
stackSourceDir := filepath.Dir(targetConfig)
745745

746746
values, readErr := ReadValues(ctx, l, opts, stackSourceDir)

internal/stacks/generate/generate.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,7 @@ func listStackFiles(l log.Logger, opts *options.TerragruntOptions, dir string) (
324324
if len(path) >= generationMaxPath {
325325
return errors.Errorf("Cycle detected: maximum path length (%d) exceeded at %s", generationMaxPath, path)
326326
}
327-
328-
if strings.HasSuffix(path, config.DefaultStackFile) {
327+
if filepath.Base(path) == config.DefaultStackFile {
329328
l.Debugf("Found stack file %s", path)
330329
stackFiles = append(stackFiles, path)
331330
}

0 commit comments

Comments
 (0)