diff --git a/cmd/clair/config.go b/cmd/clair/config.go index 09a01364..d5d2c402 100644 --- a/cmd/clair/config.go +++ b/cmd/clair/config.go @@ -26,8 +26,6 @@ import ( "github.com/coreos/clair" "github.com/coreos/clair/api" "github.com/coreos/clair/database" - "github.com/coreos/clair/ext/featurefmt" - "github.com/coreos/clair/ext/featurens" "github.com/coreos/clair/ext/notification" "github.com/coreos/clair/ext/vulnsrc" "github.com/coreos/clair/pkg/pagination" @@ -47,7 +45,6 @@ type File struct { type Config struct { Database database.RegistrableComponentConfig Updater *clair.UpdaterConfig - Worker *clair.WorkerConfig Notifier *notification.Config API *api.Config } @@ -62,10 +59,6 @@ func DefaultConfig() Config { EnabledUpdaters: vulnsrc.ListUpdaters(), Interval: 1 * time.Hour, }, - Worker: &clair.WorkerConfig{ - EnabledDetectors: featurens.ListDetectors(), - EnabledListers: featurefmt.ListListers(), - }, API: &api.Config{ HealthAddr: "0.0.0.0:6061", Addr: "0.0.0.0:6060", diff --git a/cmd/clair/main.go b/cmd/clair/main.go index da046351..e329af34 100644 --- a/cmd/clair/main.go +++ b/cmd/clair/main.go @@ -112,29 +112,16 @@ func configClairVersion(config *Config) { "Updaters": strings.Join(updaters, ","), }).Info("Clair registered components") - unregDetectors := strutil.CompareStringLists(config.Worker.EnabledDetectors, detectors) - unregListers := strutil.CompareStringLists(config.Worker.EnabledListers, listers) unregUpdaters := strutil.CompareStringLists(config.Updater.EnabledUpdaters, updaters) - if len(unregDetectors) != 0 || len(unregListers) != 0 || len(unregUpdaters) != 0 { + if len(unregUpdaters) != 0 { log.WithFields(log.Fields{ - "Unknown Detectors": strings.Join(unregDetectors, ","), - "Unknown Listers": strings.Join(unregListers, ","), - "Unknown Updaters": strings.Join(unregUpdaters, ","), - "Available Listers": strings.Join(featurefmt.ListListers(), ","), - "Available Detectors": strings.Join(featurens.ListDetectors(), ","), - "Available Updaters": strings.Join(vulnsrc.ListUpdaters(), ","), + "Unknown Updaters": strings.Join(unregUpdaters, ","), + "Available Updaters": strings.Join(vulnsrc.ListUpdaters(), ","), }).Fatal("Unknown or unregistered components are configured") } - // verify the user specified detectors/listers/updaters are implemented. If - // some are not registered, it logs warning and won't use the unregistered - // extensions. - - clair.Processors = database.Processors{ - Detectors: strutil.CompareStringListsInBoth(config.Worker.EnabledDetectors, detectors), - Listers: strutil.CompareStringListsInBoth(config.Worker.EnabledListers, listers), - } - + // All listers and detectors are enabled. + clair.Processors = database.Processors{Detectors: detectors, Listers: listers} clair.EnabledUpdaters = strutil.CompareStringListsInBoth(config.Updater.EnabledUpdaters, updaters) } diff --git a/config.yaml.sample b/config.yaml.sample index cb6fd5d3..1128aa10 100644 --- a/config.yaml.sample +++ b/config.yaml.sample @@ -51,19 +51,6 @@ clair: keyfile: certfile: - worker: - namespace_detectors: - - os-release - - lsb-release - - apt-sources - - alpine-release - - redhat-release - - feature_listers: - - apk - - dpkg - - rpm - updater: # Frequency the database will be updated with vulnerabilities from the default data sources # The value 0 disables the updater entirely. diff --git a/worker.go b/worker.go index 106a4c3e..5890acbb 100644 --- a/worker.go +++ b/worker.go @@ -52,11 +52,6 @@ var ( Processors database.Processors ) -type WorkerConfig struct { - EnabledDetectors []string `yaml:"namespace_detectors"` - EnabledListers []string `yaml:"feature_listers"` -} - // LayerRequest represents all information necessary to download and process a // layer. type LayerRequest struct {