From 597d504e6855c89b67cb6d07647942da5f63dfd9 Mon Sep 17 00:00:00 2001 From: nikpivkin Date: Tue, 27 Aug 2024 12:50:10 +0600 Subject: [PATCH] fix(micsonf): use module to log when metadata retrieval fails Signed-off-by: nikpivkin --- pkg/iac/rego/embed.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/iac/rego/embed.go b/pkg/iac/rego/embed.go index e582508a396b..082870071c90 100644 --- a/pkg/iac/rego/embed.go +++ b/pkg/iac/rego/embed.go @@ -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 }