From 1b7feb6ddb8c19cef126b4d2c803827845303def Mon Sep 17 00:00:00 2001 From: Florent Benoit Date: Sat, 22 Oct 2022 23:25:47 +0200 Subject: [PATCH] fix: start all containers after all the replication Change-Id: Iaf10beb50efef4fadca6d13964a6c93a282c09c1 Signed-off-by: Florent Benoit --- .../renderer/src/lib/pod/PodCreateFromContainers.svelte | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/renderer/src/lib/pod/PodCreateFromContainers.svelte b/packages/renderer/src/lib/pod/PodCreateFromContainers.svelte index 390e5e0e42d..e0555a1a14c 100644 --- a/packages/renderer/src/lib/pod/PodCreateFromContainers.svelte +++ b/packages/renderer/src/lib/pod/PodCreateFromContainers.svelte @@ -65,6 +65,8 @@ async function doCreatePodFromContainers() { // now, for each container, recreate it with the pod // but before, stop the container + const containersToStart: { engineId: string; id: string }[] = []; + for (const container of podCreation.containers) { // make sure it is stopped try { @@ -80,8 +82,12 @@ async function doCreatePodFromContainers() { { pod: Id, name: container.name + '-podified' }, ); + containersToStart.push({ engineId, id: replicatedContainer.Id }); + } + + for (const containerToStart of containersToStart) { // start the new container - await window.startContainer(engineId, replicatedContainer.Id); + await window.startContainer(containerToStart.engineId, containerToStart.id); } // ok now, redirect to the pods