Switch the checksums to use the registry computed value, remove all assumptions of namespaced paths for legacy storage, fix an upload race condition in the registry code.
This commit is contained in:
parent
246a216f80
commit
78c5aec5b9
11 changed files with 112 additions and 264 deletions
|
@ -29,41 +29,35 @@ class BaseStorage(object):
|
|||
|
||||
return tmpf, fn
|
||||
|
||||
def image_path(self, namespace, repository, image_id, storage_uuid):
|
||||
if storage_uuid:
|
||||
return '{0}/{1}/'.format(self.shared_images, storage_uuid)
|
||||
else:
|
||||
return '{0}/{1}/{2}/{3}/'.format(self.images, namespace, repository,
|
||||
image_id)
|
||||
def image_path(self, storage_uuid):
|
||||
return '{0}/{1}/'.format(self.shared_images, storage_uuid)
|
||||
|
||||
def image_json_path(self, namespace, repository, image_id, storage_uuid):
|
||||
base_path = self.image_path(namespace, repository, image_id, storage_uuid)
|
||||
def image_json_path(self, storage_uuid):
|
||||
base_path = self.image_path(storage_uuid)
|
||||
return '{0}json'.format(base_path)
|
||||
|
||||
def image_mark_path(self, namespace, repository, image_id, storage_uuid):
|
||||
base_path = self.image_path(namespace, repository, image_id, storage_uuid)
|
||||
def image_mark_path(self, storage_uuid):
|
||||
base_path = self.image_path(storage_uuid)
|
||||
return '{0}_inprogress'.format(base_path)
|
||||
|
||||
def image_checksum_path(self, namespace, repository, image_id, storage_uuid):
|
||||
base_path = self.image_path(namespace, repository, image_id, storage_uuid)
|
||||
def image_checksum_path(self, storage_uuid):
|
||||
base_path = self.image_path(storage_uuid)
|
||||
return '{0}_checksum'.format(base_path)
|
||||
|
||||
def image_layer_path(self, namespace, repository, image_id, storage_uuid):
|
||||
base_path = self.image_path(namespace, repository, image_id, storage_uuid)
|
||||
def image_layer_path(self, storage_uuid):
|
||||
base_path = self.image_path(storage_uuid)
|
||||
return '{0}layer'.format(base_path)
|
||||
|
||||
def image_ancestry_path(self, namespace, repository, image_id, storage_uuid):
|
||||
base_path = self.image_path(namespace, repository, image_id, storage_uuid)
|
||||
def image_ancestry_path(self, storage_uuid):
|
||||
base_path = self.image_path(storage_uuid)
|
||||
return '{0}ancestry'.format(base_path)
|
||||
|
||||
def image_file_trie_path(self, namespace, repository, image_id,
|
||||
storage_uuid):
|
||||
base_path = self.image_path(namespace, repository, image_id, storage_uuid)
|
||||
def image_file_trie_path(self, storage_uuid):
|
||||
base_path = self.image_path(storage_uuid)
|
||||
return '{0}files.trie'.format(base_path)
|
||||
|
||||
def image_file_diffs_path(self, namespace, repository, image_id,
|
||||
storage_uuid):
|
||||
base_path = self.image_path(namespace, repository, image_id, storage_uuid)
|
||||
def image_file_diffs_path(self, storage_uuid):
|
||||
base_path = self.image_path(storage_uuid)
|
||||
return '{0}diffs.json'.format(base_path)
|
||||
|
||||
def get_direct_download_url(self, path, expires_in=60):
|
||||
|
|
Reference in a new issue