Add GC of layers in Clair
Fixes https://www.pivotaltracker.com/story/show/135583207
This commit is contained in:
parent
0aa6e6cd58
commit
49872838ab
5 changed files with 57 additions and 23 deletions
|
@ -547,6 +547,19 @@ class TestSecurityScanner(unittest.TestCase):
|
|||
notification = model.notification.create_repo_notification(repo, 'vulnerability_found', 'quay_notification', {}, {'level': 0})
|
||||
self.assertFalse(VulnerabilityFoundEvent().should_perform(event_data, notification))
|
||||
|
||||
def test_garbage_collection(self):
|
||||
requests_made = set()
|
||||
|
||||
@urlmatch(netloc=r'(.*\.)?mockclairservice', path=r'/v1/layers/(.+)')
|
||||
def delete_layer(url, request):
|
||||
requests_made.add(request.method)
|
||||
|
||||
with HTTMock(delete_layer):
|
||||
# Purge a repository.
|
||||
model.repository.purge_repository('devtable', 'simple')
|
||||
|
||||
# Ensure that DELETE is called (and only DELETE) for the layers in the security scanner.
|
||||
self.assertEquals(set(['DELETE']), requests_made)
|
||||
|
||||
def test_notification_worker(self):
|
||||
pages_called = []
|
||||
|
|
Reference in a new issue