From 73d235bb068240bef7a1da223d57faf99c7b699e Mon Sep 17 00:00:00 2001 From: Florent Benoit Date: Sun, 23 Oct 2022 10:59:59 +0200 Subject: [PATCH] fix: start a pod instead of trying to start each individual container Change-Id: I41ece2faff39b736a5c85f4e675a624df96b3336 Signed-off-by: Florent Benoit --- .../src/lib/pod/PodCreateFromContainers.svelte | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/renderer/src/lib/pod/PodCreateFromContainers.svelte b/packages/renderer/src/lib/pod/PodCreateFromContainers.svelte index e0555a1a14c..527579ed340 100644 --- a/packages/renderer/src/lib/pod/PodCreateFromContainers.svelte +++ b/packages/renderer/src/lib/pod/PodCreateFromContainers.svelte @@ -67,6 +67,7 @@ async function doCreatePodFromContainers() { const containersToStart: { engineId: string; id: string }[] = []; + // then, stop all containers for (const container of podCreation.containers) { // make sure it is stopped try { @@ -74,21 +75,22 @@ async function doCreatePodFromContainers() { } catch (error) { // already stopped } + } + // then replicate containers + for (const container of podCreation.containers) { // recreate the container but adding the pod and using a different name + const replicatedContainer = await window.replicatePodmanContainer( { ...container }, { engineId }, { pod: Id, name: container.name + '-podified' }, ); - containersToStart.push({ engineId, id: replicatedContainer.Id }); } - for (const containerToStart of containersToStart) { - // start the new container - await window.startContainer(containerToStart.engineId, containerToStart.id); - } + // finally, start the pod + await window.startPod(engineId, Id); // ok now, redirect to the pods router.goto('/pods/');