Commit Graph

23 Commits

Author SHA1 Message Date
Sida Chen
1b9ed99646 database: Move db logic to dbutil
Move all transaction related logic to dbutil to simplify and later unify
the db interface.
2019-03-06 15:22:21 -05:00
Jimmy Zelinskie
a4e7873d14 database: make locks SOI & add Extend method 2019-02-28 15:46:31 -05:00
Sida Chen
73bc2bc36b
Merge pull request #672 from KeyboardNerd/source_package/feature_type
Implement Feature types
2019-02-20 15:58:50 -05:00
Sida Chen
7dd989c0f2 database: Rename affected Type to feature type 2019-02-19 16:48:42 -05:00
Jimmy Zelinskie
f64bd117b2 updater,pkg/timeutil: minor cleanups 2019-02-14 11:26:22 -05:00
Jimmy Zelinskie
7084a226ae updater: extract deduplicate function 2019-01-10 13:50:47 -05:00
Jimmy Zelinskie
25078ac838 ext: add CleanAll() utility functions 2019-01-10 13:50:46 -05:00
Jimmy Zelinskie
e16d17dda9 updater: remove original RunUpdate() 2019-01-10 13:50:46 -05:00
Jimmy Zelinskie
0d41968acd updater: reimplement fetch() with errgroup
This adds context support to a few more functions in the update process.
This makes progress towards to goal of having cancellable updates.
2019-01-10 13:50:46 -05:00
Jimmy Zelinskie
6c5be7e1c6 updater: refactor to use errgroup
This addresses a race condition and makes this code much more
understandable.
2019-01-10 13:50:46 -05:00
Jimmy Zelinskie
300bb52696 database: add FindLock dbutil 2018-11-28 13:37:15 -05:00
Jimmy Zelinskie
4fbeb9ced5 database: add (Acquire|Release)Lock dbutils 2018-11-27 13:59:07 -05:00
Sida Chen
2236b0a5c9 updater: Add vulnsrc affected feature type
Each vulnerability source has a specific type of feature that it affects

We assume the following:
* Alpine: Binary Package
* Debian: Source Package
* Ubuntu: Source Package
* Oracle OVAL: Binary Package
* RHEL OVAL: Binary Package
2018-10-18 15:06:41 -04:00
Sida Chen
a3e9b5b55d database: rename utility functions with commit/rollback
All database utility functions are renamed to explicitly say if it will
commit changes or rollback changes on success.
2018-10-08 13:12:18 -04:00
Sida Chen
e657d26313 database: move dbutil and testutil to database from pkg
Move dbutil and testutil to database from pkg
Rename all "result"
2018-10-08 12:10:35 -04:00
Sida Chen
028324014b clair: Implement worker detector support
The worker is changed to accommodate the new database model and API.
Worker is refactored to move the database query helper functions to pkg.
2018-10-08 10:42:40 -04:00
Sida Chen
fb32dcfa58 Clair Logic, Extensions: updated mock tests, extensions, basic logic
Main Clair logic is changed in worker, updater, notifier for better adapting
ancestry schema. Extensions are updated with the new model and feature lister
 and namespace detector drivers are able to specify the specific listers and
detectors used to process layer's content. InRange and GetFixedIn interfaces
are added to Version format for adapting ranged affected features and next
available fixed in in the future. Tests for worker, updater and extensions
are fixed.
2017-08-10 11:24:40 -04:00
Jimmy Zelinskie
0d18a629ca updater: sleep before continuing the lock loop
This change makes the updater sleep for a small portion of time before
it continues to try and obtain a lock for running the updates. This will
prevent the CPU from being pinned in the case where an error is
consistently failing an update.

Fixes #415.
2017-06-28 17:13:27 -04:00
Sida Chen
9306e99368 converted to structured logging by using logrus
changed from capnslog to logrus for logging JSON structured message.

finished issue #383
2017-05-04 13:59:57 -04:00
Nick Platt
edfadc2f87 updater: Log fetch completion 2017-04-25 15:50:51 +00:00
Jimmy Zelinskie
b792eb61f6 updater: copy whole namespace when deduping vulns 2017-02-23 02:05:52 -05:00
Jimmy Zelinskie
6a569fd945 move config to main / decentralize config
This puts config in its relevant location and moves functions around
loading config files into the main package.

As a side effect of removing cyclic imports for the API config, the
context library is no longer used.
2017-01-27 00:36:13 -05:00
Jimmy Zelinskie
9c63a63944 clair: mv updater clair and mv severity to db 2017-01-22 23:20:56 -05:00