goinfinite / ez

From server to PaaS in no time. User-friendly, lightweight, free.
https://goinfinite.net/ez/
Other
10 stars 0 forks source link

feat: container status sync #91

Open ntorga opened 5 months ago

ntorga commented 5 months ago

As explained on goinfinite/ez#92:

Control does have a boot middleware to power on all the containers on the wrong state, but that didn't happen either.

Looking at the code I can see the problem. Since the container isn't stopped by Control, the database holds that the container is still up, thus it won't change the status of the container.

I could add a power off and power on into the boot logic, but that would power off containers that podman did manage to start. Instead, it would be beneficial to have a routine that runs on the start and every now and then to update the status of the containers according to podman cli. That way if a container stops and can't be restarted due to its restart policy, the failed state would reflect on the database.