Migrate data back to Image in preparation for v2
This commit is contained in:
parent
abb1486a96
commit
b56de3355c
7 changed files with 72 additions and 6 deletions
|
@ -99,9 +99,16 @@ def __create_subtree(repo, structure, creator_username, parent, tag_map):
|
|||
creation_time = REFERENCE_DATE + timedelta(weeks=image_num) + timedelta(days=model_num)
|
||||
command_list = SAMPLE_CMDS[image_num % len(SAMPLE_CMDS)]
|
||||
command = json.dumps(command_list) if command_list else None
|
||||
|
||||
v1_metadata = {
|
||||
'id': docker_image_id,
|
||||
}
|
||||
if parent is not None:
|
||||
v1_metadata['parent'] = parent.docker_image_id
|
||||
|
||||
new_image = model.image.set_image_metadata(docker_image_id, repo.namespace_user.username,
|
||||
repo.name, str(creation_time), 'no comment', command,
|
||||
parent)
|
||||
v1_metadata, parent)
|
||||
|
||||
compressed_size = random.randrange(1, 1024 * 1024 * 1024)
|
||||
model.image.set_image_size(docker_image_id, repo.namespace_user.username, repo.name,
|
||||
|
|
Reference in a new issue