Fix handling of manifests with unicode in the backfill

Also adds a bunch of tests around manifests to ensure we get the same information in and out
This commit is contained in:
Joseph Schorr 2018-08-15 11:41:15 -04:00
parent a66a4d6a10
commit fa58f3b1d2
9 changed files with 176 additions and 7 deletions

View file

@ -279,8 +279,9 @@ class V2Protocol(RegistryProtocol):
if options.manifest_content_type is not None:
manifest_headers['Content-Type'] = options.manifest_content_type
tag_or_digest = tag_name if not options.push_by_manifest_digest else manifest.digest
self.conduct(session, 'PUT',
'/v2/%s/manifests/%s' % (self.repo_name(namespace, repo_name), tag_name),
'/v2/%s/manifests/%s' % (self.repo_name(namespace, repo_name), tag_or_digest),
data=manifest.bytes,
expected_status=(put_code, expected_failure, V2ProtocolSteps.PUT_MANIFEST),
headers=manifest_headers)