Address comments
This commit is contained in:
parent
1022355bb1
commit
84e5c0644e
4 changed files with 7 additions and 3 deletions
|
@ -168,7 +168,7 @@ def _repo_verb(namespace, repository, tag, verb, formatter, checker=None, **kwar
|
||||||
|
|
||||||
@verbs.route('/aci/<server>/<namespace>/<repository>/<tag>/aci/<os>/<arch>/', methods=['GET'])
|
@verbs.route('/aci/<server>/<namespace>/<repository>/<tag>/aci/<os>/<arch>/', methods=['GET'])
|
||||||
@process_auth
|
@process_auth
|
||||||
def get_rocket_image(server, namespace, repository, tag, os, arch):
|
def get_aci_image(server, namespace, repository, tag, os, arch):
|
||||||
def checker(image_json):
|
def checker(image_json):
|
||||||
# Verify the architecture and os.
|
# Verify the architecture and os.
|
||||||
operating_system = image_json.get('os', 'linux')
|
operating_system = image_json.get('os', 'linux')
|
||||||
|
|
|
@ -150,7 +150,7 @@ class ACIImage(TarImageFormatter):
|
||||||
|
|
||||||
manifest = {
|
manifest = {
|
||||||
"acKind": "ImageManifest",
|
"acKind": "ImageManifest",
|
||||||
"acVersion": "0.1.1",
|
"acVersion": "0.2.0",
|
||||||
"name": '%s/%s/%s/%s' % (hostname, namespace, repository, tag),
|
"name": '%s/%s/%s/%s' % (hostname, namespace, repository, tag),
|
||||||
"labels": [
|
"labels": [
|
||||||
{
|
{
|
||||||
|
@ -172,7 +172,8 @@ class ACIImage(TarImageFormatter):
|
||||||
"group": config.get('Group', '') or 'root',
|
"group": config.get('Group', '') or 'root',
|
||||||
"eventHandlers": [],
|
"eventHandlers": [],
|
||||||
"workingDirectory": config.get('WorkingDir', ''),
|
"workingDirectory": config.get('WorkingDir', ''),
|
||||||
"environment": {key:value for (key, value) in [e.split('=') for e in config.get('Env')]},
|
"environment": [(key, value)
|
||||||
|
for (key, value) in [e.split('=') for e in config.get('Env')]],
|
||||||
"isolators": self._build_isolators(config),
|
"isolators": self._build_isolators(config),
|
||||||
"mountPoints": self._build_volumes(config),
|
"mountPoints": self._build_volumes(config),
|
||||||
"ports": self._build_ports(config),
|
"ports": self._build_ports(config),
|
||||||
|
|
Binary file not shown.
|
@ -39,6 +39,9 @@ class TarLayerFormat(object):
|
||||||
|
|
||||||
# Yield the tar header.
|
# Yield the tar header.
|
||||||
if self.path_prefix:
|
if self.path_prefix:
|
||||||
|
# Note: We use a copy here because we need to make sure we copy over all the internal
|
||||||
|
# data of the tar header. We cannot use frombuf(tobuf()), however, because it doesn't
|
||||||
|
# properly handle large filenames.
|
||||||
clone = copy.deepcopy(tar_info)
|
clone = copy.deepcopy(tar_info)
|
||||||
clone.name = os.path.join(self.path_prefix, clone.name)
|
clone.name = os.path.join(self.path_prefix, clone.name)
|
||||||
yield clone.tobuf()
|
yield clone.tobuf()
|
||||||
|
|
Reference in a new issue