fix: start a pod instead of trying to start each individual container

Change-Id: I41ece2faff39b736a5c85f4e675a624df96b3336
Signed-off-by: Florent Benoit <fbenoit@redhat.com>
This commit is contained in:
Florent Benoit 2022-10-23 10:59:59 +02:00 committed by Florent BENOIT
parent 1b7feb6ddb
commit 73d235bb06

View file

@ -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/');