mirror of
https://github.com/podman-desktop/podman-desktop
synced 2026-05-24 10:18:53 +00:00
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:
parent
1b7feb6ddb
commit
73d235bb06
1 changed files with 7 additions and 5 deletions
|
|
@ -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/');
|
||||
|
|
|
|||
Loading…
Reference in a new issue