mirror of
https://github.com/project-zot/zot.git
synced 2024-12-23 22:27:35 -05:00
24 lines
525 B
Go
24 lines
525 B
Go
package cveinfo
|
|
|
|
import (
|
|
"github.com/anuvu/zot/pkg/log"
|
|
integration "github.com/aquasecurity/trivy/integration"
|
|
config "github.com/aquasecurity/trivy/integration/config"
|
|
)
|
|
|
|
// UpdateCVEDb ...
|
|
func UpdateCVEDb(dbDir string, log log.Logger) error {
|
|
config, err := config.NewConfig(dbDir)
|
|
if err != nil {
|
|
log.Error().Err(err).Msg("Unable to get config")
|
|
return err
|
|
}
|
|
|
|
err = integration.RunTrivyDb(config.TrivyConfig)
|
|
if err != nil {
|
|
log.Error().Err(err).Msg("Unable to update DB ")
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|