Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 4f6aeb8

Browse files
committed
check conflicts when add new container
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
1 parent fe5cf27 commit 4f6aeb8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/init.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,12 @@ static int hyper_new_container(char *json, int length)
603603
return -1;
604604
}
605605

606+
if (hyper_find_container(pod, c->id) != NULL) {
607+
fprintf(stderr, "container id conflicts");
608+
hyper_cleanup_container(c, pod);
609+
return -1;
610+
}
611+
606612
list_add_tail(&c->list, &pod->containers);
607613
ret = hyper_setup_container(c, pod);
608614
if (ret >= 0)

0 commit comments

Comments
 (0)