diff --git a/pkg/compliance/spec/compliance.go b/pkg/compliance/spec/compliance.go index 95ed4ea44177..418480129c81 100644 --- a/pkg/compliance/spec/compliance.go +++ b/pkg/compliance/spec/compliance.go @@ -87,7 +87,7 @@ func GetComplianceSpec(specNameOrPath string, c cache.TrivyCache) (ComplianceSpe return ComplianceSpec{}, fmt.Errorf("error retrieving compliance spec from specified path: %w", err) } } else { - _, err := os.ReadFile(filepath.Join(c.GetChecksDir(), "metadata.json")) + _, err := os.Stat(filepath.Join(c.GetChecksDir(), "metadata.json")) if err != nil { // cache corrupt or bundle does not exist, load embedded version b = []byte(sp.NewSpecLoader().GetSpecByName(specNameOrPath)) log.Debug("Compliance spec loaded from embedded library", log.String("spec", specNameOrPath))