mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-12 15:50:15 -08:00
refactor: use trivy-checks/pkg/specs package (#8226)
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
"golang.org/x/xerrors"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
||||
sp "github.com/aquasecurity/trivy-checks/pkg/spec"
|
||||
"github.com/aquasecurity/trivy-checks/pkg/specs"
|
||||
iacTypes "github.com/aquasecurity/trivy/pkg/iac/types"
|
||||
"github.com/aquasecurity/trivy/pkg/log"
|
||||
"github.com/aquasecurity/trivy/pkg/set"
|
||||
@@ -97,7 +97,7 @@ func GetComplianceSpec(specNameOrPath, cacheDir string) (ComplianceSpec, error)
|
||||
} else {
|
||||
_, err := os.Stat(filepath.Join(checksDir(cacheDir), "metadata.json"))
|
||||
if err != nil { // cache corrupt or bundle does not exist, load embedded version
|
||||
b = []byte(sp.NewSpecLoader().GetSpecByName(specNameOrPath))
|
||||
b = []byte(specs.GetSpec(specNameOrPath))
|
||||
log.Debug("Compliance spec loaded from embedded library", log.String("spec", specNameOrPath))
|
||||
} else {
|
||||
// load from bundle on disk
|
||||
|
||||
Reference in New Issue
Block a user