mirror of
https://github.com/anchore/syft
synced 2024-11-10 14:24:12 +00:00
ea611dab5f
* Option to enable specific language or ecosystem cataloger Signed-off-by: ramanan-ravi <ramanan@deepfence.io> Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * Disable dotnet cataloger Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * Option to enable specific language or ecosystem cataloger Signed-off-by: Ramanan Ravikumar <ramanan@deepfence.io> Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * rename "enable-cataloger" option to "catalogers" Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * add cli test for --catalogers option Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * update readme with latest cataloger names Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * enable dotnet cataloger Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * fix linting Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * fix cataloger imports Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * update readme with alpmdb cataloger config example Signed-off-by: Alex Goodman <alex.goodman@anchore.com> Co-authored-by: ramanan-ravi <ramanan@deepfence.io>
23 lines
890 B
Go
23 lines
890 B
Go
package config
|
|
|
|
import (
|
|
"github.com/anchore/syft/syft/pkg/cataloger"
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
type pkg struct {
|
|
Cataloger catalogerOptions `yaml:"cataloger" json:"cataloger" mapstructure:"cataloger"`
|
|
SearchUnindexedArchives bool `yaml:"search-unindexed-archives" json:"search-unindexed-archives" mapstructure:"search-unindexed-archives"`
|
|
SearchIndexedArchives bool `yaml:"search-indexed-archives" json:"search-indexed-archives" mapstructure:"search-indexed-archives"`
|
|
}
|
|
|
|
func (cfg pkg) loadDefaultValues(v *viper.Viper) {
|
|
cfg.Cataloger.loadDefaultValues(v)
|
|
c := cataloger.DefaultSearchConfig()
|
|
v.SetDefault("package.search-unindexed-archives", c.IncludeUnindexedArchives)
|
|
v.SetDefault("package.search-indexed-archives", c.IncludeIndexedArchives)
|
|
}
|
|
|
|
func (cfg *pkg) parseConfigValues() error {
|
|
return cfg.Cataloger.parseConfigValues()
|
|
}
|