Skip to content

Commit cdc4e56

Browse files
committed
chore: discovery cleanup
1 parent b6c6911 commit cdc4e56

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

internal/discovery/discovery.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -518,12 +518,6 @@ func Parse(
518518
// Treat include-only/no-settings configs as non-fatal during discovery when suppression is enabled
519519
if suppressParseErrors && containsNoSettingsError(err) {
520520
l.Debugf("Skipping include-only config during discovery: %s", parseOpts.TerragruntConfigPath)
521-
522-
// Store an empty partial config to avoid nil dereferences in subsequent dependency discovery
523-
if unit, ok := c.(*component.Unit); ok {
524-
unit.StoreConfig(&config.TerragruntConfig{IsPartial: true})
525-
}
526-
527521
return nil
528522
}
529523

@@ -1178,6 +1172,12 @@ func (d *DependencyDiscovery) DiscoverDependencies(
11781172
}
11791173

11801174
terragruntCfg := unit.Config()
1175+
if terragruntCfg == nil {
1176+
// Config is still nil after parsing (e.g., include-only config with suppressParseErrors)
1177+
// No dependencies to discover
1178+
return nil
1179+
}
1180+
11811181
dependencyBlocks := terragruntCfg.TerragruntDependencies
11821182

11831183
depPaths := make([]string, 0, len(dependencyBlocks))

0 commit comments

Comments
 (0)