Skip to content

Commit

Permalink
fix(misconf): use module to log when metadata retrieval fails (#7405)
Browse files Browse the repository at this point in the history
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
  • Loading branch information
nikpivkin authored Aug 27, 2024
1 parent dd9733e commit 0799770
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/iac/rego/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ func RegisterRegoRules(modules map[string]*ast.Module) {
for _, module := range modules {
metadata, err := retriever.RetrieveMetadata(ctx, module)
if err != nil {
log.Warn("Failed to retrieve metadata", log.String("avdid", metadata.AVDID), log.Err(err))
log.Warn("Failed to retrieve metadata", log.String("package", module.Package.String()), log.Err(err))
continue
}

if metadata.AVDID == "" {
if !metadata.Library && metadata.AVDID == "" {
log.Warn("Check ID is empty", log.FilePath(module.Package.Location.File))
continue
}
Expand Down

0 comments on commit 0799770

Please sign in to comment.