Skip to content

Commit

Permalink
fix(misconf): not to warn about missing selectors of libraries (#7638)
Browse files Browse the repository at this point in the history
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
  • Loading branch information
nikpivkin authored Oct 3, 2024
1 parent 69bf7e0 commit fcaea74
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 fcaea74

Please sign in to comment.