Namespace the storage in the registry to prevent leaking images if one acquires the image id.
This commit is contained in:
parent
deee70d53b
commit
44255421df
5 changed files with 116 additions and 93 deletions
|
@ -27,20 +27,25 @@ class Storage(object):
|
|||
namespace,
|
||||
repository)
|
||||
|
||||
def image_json_path(self, image_id):
|
||||
return '{0}/{1}/json'.format(self.images, image_id)
|
||||
def image_json_path(self, namespace, repository, image_id):
|
||||
return '{0}/{1}/{2}/{3}/json'.format(self.images, namespace,
|
||||
repository, image_id)
|
||||
|
||||
def image_mark_path(self, image_id):
|
||||
return '{0}/{1}/_inprogress'.format(self.images, image_id)
|
||||
def image_mark_path(self, namespace, repository, image_id):
|
||||
return '{0}/{1}/{2}/{3}/_inprogress'.format(self.images, namespace,
|
||||
repository, image_id)
|
||||
|
||||
def image_checksum_path(self, image_id):
|
||||
return '{0}/{1}/_checksum'.format(self.images, image_id)
|
||||
def image_checksum_path(self, namespace, repository, image_id):
|
||||
return '{0}/{1}/{2}/{3}/_checksum'.format(self.images, namespace,
|
||||
repository, image_id)
|
||||
|
||||
def image_layer_path(self, image_id):
|
||||
return '{0}/{1}/layer'.format(self.images, image_id)
|
||||
def image_layer_path(self, namespace, repository, image_id):
|
||||
return '{0}/{1}/{2}/{3}/layer'.format(self.images, namespace,
|
||||
repository, image_id)
|
||||
|
||||
def image_ancestry_path(self, image_id):
|
||||
return '{0}/{1}/ancestry'.format(self.images, image_id)
|
||||
def image_ancestry_path(self, namespace, repository, image_id):
|
||||
return '{0}/{1}/{2}/{3}/ancestry'.format(self.images, namespace,
|
||||
repository, image_id)
|
||||
|
||||
def tag_path(self, namespace, repository, tagname=None):
|
||||
if not tagname:
|
||||
|
|
Reference in a new issue