Skip to content

Commit fcaea74

Browse files
authored
fix(misconf): not to warn about missing selectors of libraries (#7638)
Signed-off-by: nikpivkin <[email protected]>
1 parent 69bf7e0 commit fcaea74

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

pkg/iac/rego/load.go

+8-5
Original file line numberDiff line numberDiff line change
@@ -302,14 +302,17 @@ func (s *Scanner) filterModules(retriever *MetadataRetriever) error {
302302
}
303303

304304
if len(meta.InputOptions.Selectors) == 0 {
305-
s.logger.Warn(
306-
"Module has no input selectors - it will be loaded for all inputs!",
307-
log.FilePath(module.Package.Location.File),
308-
log.String("module", name),
309-
)
305+
if !meta.Library {
306+
s.logger.Warn(
307+
"Module has no input selectors - it will be loaded for all inputs!",
308+
log.FilePath(module.Package.Location.File),
309+
log.String("module", name),
310+
)
311+
}
310312
filtered[name] = module
311313
continue
312314
}
315+
313316
for _, selector := range meta.InputOptions.Selectors {
314317
if selector.Type == string(s.sourceType) {
315318
filtered[name] = module

0 commit comments

Comments
 (0)