Log when pulls occur in V2

Fixes #958
This commit is contained in:
Joseph Schorr 2015-11-20 21:29:57 -05:00
parent 4c3e41984d
commit 5c8eea2728

View file

@ -224,6 +224,10 @@ def fetch_manifest_by_tagname(namespace, repo_name, manifest_ref):
manifest_ref)
raise ManifestUnknown()
repo = model.repository.get_repository(namespace, repo_name)
if repo is not None:
track_and_log('pull_repo', repo)
return make_response(manifest.json_data, 200)
@ -238,6 +242,10 @@ def fetch_manifest_by_digest(namespace, repo_name, manifest_ref):
# Without a tag name to reference, we can't make an attempt to generate the manifest
raise ManifestUnknown()
repo = model.repository.get_repository(namespace, repo_name)
if repo is not None:
track_and_log('pull_repo', repo)
return make_response(manifest.json_data, 200)
@ -371,6 +379,8 @@ def delete_manifest_by_digest(namespace, repo_name, manifest_ref):
manifest.delete_instance()
# TODO(jschorr): Log this as a new log type.
return make_response('', 202)