Skip to content

Commit

Permalink
XXX serialize events
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpitt committed Jul 4, 2023
1 parent 9d6706a commit 0607a90
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class Application extends React.Component {
}

updateContainersAfterEvent(system, init) {
client.getContainers(system)
return client.getContainers(system)
.then(reply => Promise.all(
(reply || []).map(container =>
this.isContainerCheckpointPresent(container.Id, system)
Expand Down Expand Up @@ -292,7 +292,7 @@ class Application extends React.Component {
}

updateContainerAfterEvent(id, system, event) {
client.getContainers(system, id)
return client.getContainers(system, id)
.then(reply => Promise.all(
(reply || []).map(container =>
this.isContainerCheckpointPresent(container.Id, system)
Expand Down Expand Up @@ -391,14 +391,14 @@ class Application extends React.Component {
* now we 'll do a batch update
*/
case 'start':
// HACK: We don't get 'started' event for pods got started by the first container which was added to them
// https://github.com/containers/podman/issues/7213
if (event.Actor.Attributes.podId) {
this.updatePodAfterEvent(event.Actor.Attributes.podId, system);
} else {
this.updatePodsAfterEvent(system);
}
this.updateContainerAfterEvent(event.Actor.ID, system, event);
this.updateContainerAfterEvent(event.Actor.ID, system, event).then(() => {
// HACK: We don't get 'started' event for pods got started by the first container which was added to them
// https://github.com/containers/podman/issues/7213
if (event.Actor.Attributes.podId)
this.updatePodAfterEvent(event.Actor.Attributes.podId, system);
else
this.updatePodsAfterEvent(system);
});
break;
case 'checkpoint':
case 'create':
Expand All @@ -419,14 +419,14 @@ class Application extends React.Component {
this.updateContainerAfterEvent(event.Actor.ID, system, event);
break;
case 'remove':
// HACK: we don't get a pod event when a container in a pod is removed.
// https://github.com/containers/podman/issues/15408
if (event.Actor.Attributes.podId) {
this.updatePodAfterEvent(event.Actor.Attributes.podId, system);
} else {
this.updatePodsAfterEvent(system);
}
this.updateContainersAfterEvent(system);
this.updateContainersAfterEvent(system).then(() => {
// HACK: we don't get a pod event when a container in a pod is removed.
// https://github.com/containers/podman/issues/15408
if (event.Actor.Attributes.podId)
this.updatePodAfterEvent(event.Actor.Attributes.podId, system);
else
this.updatePodsAfterEvent(system);
});
break;
/* The following events need only to update the Image list */
case 'commit':
Expand Down

0 comments on commit 0607a90

Please sign in to comment.