Commit 80e4bcc2 authored by Furkan Mustafa's avatar Furkan Mustafa

docker: return error in progress if anything happens while pulling

it was only returning initial errors.
parent da4711f4
......@@ -408,24 +408,28 @@ class ImageList(RPCEndpoint):
else:
return
pro_tasks = [
send_progress(digest)
for digest in Services.docker_util.queues[jobid].keys() # type: ignore
]
pro_future = asyncio.gather(*pro_tasks)
await pro_future
config_json_str, image_id, _ = await config_future
del Services.docker_util.queues[jobid] # type: ignore
# Do we need to save repo_digest to database?
# config_json_str, image_id, _ = \
# await Services.docker_util.create_or_download_config(tag_or_digest) # type: ignore
tarball_path = await Services.docker_util.create_image_from_tar( # type: ignore
tag_or_digest, config_json_str, image_id)
await Services.docker_util.load_image(tarball_path) # type: ignore
try:
pro_tasks = [
send_progress(digest)
for digest in Services.docker_util.queues[jobid].keys() # type: ignore
]
pro_future = asyncio.gather(*pro_tasks)
await pro_future
config_json_str, image_id, _ = await config_future
del Services.docker_util.queues[jobid] # type: ignore
# Do we need to save repo_digest to database?
# config_json_str, image_id, _ = \
# await Services.docker_util.create_or_download_config(tag_or_digest) # type: ignore
tarball_path = await Services.docker_util.create_image_from_tar( # type: ignore
tag_or_digest, config_json_str, image_id)
await Services.docker_util.load_image(tarball_path) # type: ignore
except Exception as err:
rpc_endpoint.write('{"error":"%s"}]}' % str(err)) # type: ignore
rpc_endpoint.finish() # type: ignore
# # save repo_digest ?
# image = DockerImage.get().where(...)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment