Fix bug in V1 delete tag code and add a test

This commit is contained in:
Joseph Schorr 2018-09-24 10:50:48 -04:00
parent 077c3908e4
commit 7567808a10
3 changed files with 26 additions and 7 deletions

View file

@ -98,6 +98,9 @@ def delete_tag(namespace_name, repo_name, tag):
if permission.can():
repo = model.get_repository(namespace_name, repo_name)
if repo is None:
abort(403)
if repo.kind != 'image':
msg = 'This repository is for managing %s resources and not container images.' % repo.kind
abort(405, message=msg, namespace=namespace_name)