mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-22 23:26:39 -08:00
feat(db): added insecure skip tls verify to download trivy db (#2140)
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
This commit is contained in:
@@ -13,10 +13,10 @@ import (
|
||||
|
||||
// Run runs the scan
|
||||
func Run(ctx *cli.Context) error {
|
||||
return run(NewConfig(ctx))
|
||||
return run(NewOption(ctx))
|
||||
}
|
||||
|
||||
func run(c Config) (err error) {
|
||||
func run(c Option) (err error) {
|
||||
if err = log.InitLogger(c.Debug, c.Quiet); err != nil {
|
||||
return xerrors.Errorf("failed to initialize a logger: %w", err)
|
||||
}
|
||||
@@ -40,7 +40,7 @@ func run(c Config) (err error) {
|
||||
}
|
||||
|
||||
// download the database file
|
||||
if err = operation.DownloadDB(c.AppVersion, c.CacheDir, c.DBRepository, true, c.SkipDBUpdate); err != nil {
|
||||
if err = operation.DownloadDB(c.AppVersion, c.CacheDir, c.DBRepository, true, c.Insecure, c.SkipDBUpdate); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -53,5 +53,5 @@ func run(c Config) (err error) {
|
||||
}
|
||||
|
||||
server := rpcServer.NewServer(c.AppVersion, c.Listen, c.CacheDir, c.Token, c.TokenHeader)
|
||||
return server.ListenAndServe(cache)
|
||||
return server.ListenAndServe(cache, c.Insecure)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user