fix: start all containers after all the replication

Change-Id: Iaf10beb50efef4fadca6d13964a6c93a282c09c1
Signed-off-by: Florent Benoit <fbenoit@redhat.com>
This commit is contained in:
Florent Benoit 2022-10-22 23:25:47 +02:00 committed by Florent BENOIT
parent c68c8aa768
commit 1b7feb6ddb

View file

@ -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