common

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TrivyIgnore []byte

Functions

func CopyCacheDir added in v0.14.0

func CopyCacheDir(t *testing.T, srcCacheDir string) string

CopyCacheDir creates a per-test copy of the Trivy cache directory to avoid concurrent cache lock contention between parallel tests. Uses hardlinks for data files to avoid expensive copies (the DB files are read-only during scans).

func DownloadDB

func DownloadDB(t *testing.T, envVars ...string)

func DownloadDBToDir added in v0.14.0

func DownloadDBToDir(t *testing.T, cacheDir string, envVars ...string)

DownloadDBToDir downloads the Trivy vulnerability database to a specific cache directory.

func ValidateVEXJSON

func ValidateVEXJSON(t *testing.T, dir string)

Types

type AddrWrapper

type AddrWrapper struct {
	// contains filtered or unexported fields
}
var DockerDINDAddress AddrWrapper

func (*AddrWrapper) Addr

func (w *AddrWrapper) Addr() string

func (*AddrWrapper) Env

func (w *AddrWrapper) Env() []string

func (*AddrWrapper) Set

func (w *AddrWrapper) Set(val string)

type ScannerCmd

type ScannerCmd struct {
	Output       string
	SkipDBUpdate bool
	IgnoreFile   string
	ExitCode     int
	Platform     string
	ImageSrc     string
	CacheDir     string
}

func NewScanner

func NewScanner() *ScannerCmd

func (*ScannerCmd) Scan

func (s *ScannerCmd) Scan(t *testing.T, ref string, ignoreErrors bool, envVars ...string)

func (*ScannerCmd) WithCacheDir added in v0.14.0

func (s *ScannerCmd) WithCacheDir(cacheDir string) *ScannerCmd

func (*ScannerCmd) WithExitCode

func (s *ScannerCmd) WithExitCode(exitCode int) *ScannerCmd

func (*ScannerCmd) WithIgnoreFile

func (s *ScannerCmd) WithIgnoreFile(ignoreFile string) *ScannerCmd

func (*ScannerCmd) WithImageSrc

func (s *ScannerCmd) WithImageSrc(imageSrc string) *ScannerCmd

func (*ScannerCmd) WithOutput

func (s *ScannerCmd) WithOutput(output string) *ScannerCmd

func (*ScannerCmd) WithPlatform

func (s *ScannerCmd) WithPlatform(platform string) *ScannerCmd

func (*ScannerCmd) WithSkipDBUpdate

func (s *ScannerCmd) WithSkipDBUpdate() *ScannerCmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL