@@ -11,6 +11,7 @@ import (
11
11
12
12
"github.com/aquasecurity/trivy/pkg/iac/scan"
13
13
"github.com/aquasecurity/trivy/pkg/iac/scanners/options"
14
+ tfscanner "github.com/aquasecurity/trivy/pkg/iac/scanners/terraform"
14
15
"github.com/samber/lo"
15
16
"github.com/stretchr/testify/assert"
16
17
"github.com/stretchr/testify/require"
@@ -23,6 +24,8 @@ func initScanner(opts ...options.ScannerOption) *Scanner {
23
24
options .ScannerWithPolicyNamespaces ("user" ),
24
25
options .ScannerWithPolicyDirs ("." ),
25
26
options .ScannerWithRegoOnly (true ),
27
+ options .ScannerWithRegoErrorLimits (0 ),
28
+ tfscanner .ScannerWithSkipCachedModules (true ),
26
29
}
27
30
28
31
opts = append (opts , defaultOpts ... )
@@ -110,6 +113,7 @@ func Test_ScanFS(t *testing.T) {
110
113
options .ScannerWithEmbeddedLibraries (false ),
111
114
options .ScannerWithEmbeddedPolicies (false ),
112
115
options .ScannerWithRegoErrorLimits (0 ),
116
+ tfscanner .ScannerWithSkipCachedModules (true ),
113
117
)
114
118
115
119
results , err := scanner .ScanFS (context .TODO (), fs , path .Join (tc .dir , "tfplan" ))
0 commit comments