Add some images with multiple tags.
This commit is contained in:
parent
0eaf879af8
commit
cffb906d64
2 changed files with 12 additions and 6 deletions
16
initdb.py
16
initdb.py
|
@ -24,7 +24,7 @@ def __gen_checksum():
|
||||||
|
|
||||||
|
|
||||||
def create_subtree(repo, structure, parent):
|
def create_subtree(repo, structure, parent):
|
||||||
num_nodes, subtrees, last_node_tag = structure
|
num_nodes, subtrees, last_node_tags = structure
|
||||||
|
|
||||||
# create the nodes
|
# create the nodes
|
||||||
for i in range(num_nodes):
|
for i in range(num_nodes):
|
||||||
|
@ -40,8 +40,12 @@ def create_subtree(repo, structure, parent):
|
||||||
|
|
||||||
parent = new_image
|
parent = new_image
|
||||||
|
|
||||||
if last_node_tag:
|
if last_node_tags:
|
||||||
model.create_or_update_tag(repo.namespace, repo.name, last_node_tag,
|
if not isinstance(last_node_tags, list):
|
||||||
|
last_node_tags = [last_node_tags]
|
||||||
|
|
||||||
|
for tag_name in last_node_tags:
|
||||||
|
model.create_or_update_tag(repo.namespace, repo.name, tag_name,
|
||||||
new_image.docker_image_id)
|
new_image.docker_image_id)
|
||||||
|
|
||||||
for subtree in subtrees:
|
for subtree in subtrees:
|
||||||
|
@ -77,11 +81,13 @@ if __name__ == '__main__':
|
||||||
new_user_2.verified = True
|
new_user_2.verified = True
|
||||||
new_user_2.save()
|
new_user_2.save()
|
||||||
|
|
||||||
__generate_repository(new_user_1, 'simple', False, [], (4, [], 'latest'))
|
__generate_repository(new_user_1, 'simple', False, [], (4, [],
|
||||||
|
['latest', 'prod']))
|
||||||
|
|
||||||
__generate_repository(new_user_1, 'complex', False, [],
|
__generate_repository(new_user_1, 'complex', False, [],
|
||||||
(2, [(3, [], 'v2.0'),
|
(2, [(3, [], 'v2.0'),
|
||||||
(1, [(1, [(1, [], 'latest')], 'staging'),
|
(1, [(1, [(1, [], ['latest', 'prod'])],
|
||||||
|
'staging'),
|
||||||
(1, [], None)], None)], None))
|
(1, [], None)], None)], None))
|
||||||
|
|
||||||
__generate_repository(new_user_2, 'publicrepo', True, [],
|
__generate_repository(new_user_2, 'publicrepo', True, [],
|
||||||
|
|
BIN
test.db
BIN
test.db
Binary file not shown.
Reference in a new issue