mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-22 23:26:39 -08:00
fix(misconf): load cached tf modules (#6607)
This commit is contained in:
@@ -16,6 +16,10 @@ import (
|
||||
// It builds a graph based on the module dependencies and determines the modules that have no incoming dependencies,
|
||||
// considering them as root modules.
|
||||
func (p *Parser) FindRootModules(ctx context.Context, dirs []string) ([]string, error) {
|
||||
// skip cached terraform modules as they cannot be root modules
|
||||
dirs = lo.Filter(dirs, func(dir string, _ int) bool {
|
||||
return !strings.Contains(dir, ".terraform/modules/")
|
||||
})
|
||||
for _, dir := range dirs {
|
||||
if err := p.ParseFS(ctx, dir); err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user