diff --git a/pkg/iac/rego/load.go b/pkg/iac/rego/load.go index 8f1033ecfa2d..7356384a3327 100644 --- a/pkg/iac/rego/load.go +++ b/pkg/iac/rego/load.go @@ -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