Skip to content

Commit

Permalink
fix(misconf): not to warn about missing selectors of libraries (aquas…
Browse files Browse the repository at this point in the history
…ecurity#7638)

Signed-off-by: nikpivkin <[email protected]>
  • Loading branch information
nikpivkin authored and fhielpos committed Dec 20, 2024
1 parent 041fa9e commit df0a042
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pkg/iac/rego/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,14 +302,17 @@ func (s *Scanner) filterModules(retriever *MetadataRetriever) error {
}

if len(meta.InputOptions.Selectors) == 0 {
s.logger.Warn(
"Module has no input selectors - it will be loaded for all inputs!",
log.FilePath(module.Package.Location.File),
log.String("module", name),
)
if !meta.Library {
s.logger.Warn(
"Module has no input selectors - it will be loaded for all inputs!",
log.FilePath(module.Package.Location.File),
log.String("module", name),
)
}
filtered[name] = module
continue
}

for _, selector := range meta.InputOptions.Selectors {
if selector.Type == string(s.sourceType) {
filtered[name] = module
Expand Down

0 comments on commit df0a042

Please sign in to comment.