Merge pull request #960 from coreos-inc/pullogs

Log when pulls occur in V2
This commit is contained in:
josephschorr 2015-11-21 00:09:22 -05:00
commit c9b1a02e9c

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)