Setting a Restart Policy to a Container
As an example, we are going to add a Home Assistant container to an existing Pantavisor-enabled device claimed from my Pantacor Hub account:
First step will be to clone our device as usual, in this case, a Raspberry Pi 4
board with the Pantavisor 019 image installed:
pvr clone https://pvr.pantahub.com/anibal/home_rpi64_latest
cd home_rpi64_latest
To add the container with system restart policy, we have to explicitly set it in the pvr app add
command:
pvr app add --from homeassistant/raspberrypi3-homeassistant --restart-policy system homeassistant
pvr add .
pvr commit
pvr post -m "add a new homeassistant container with system restart policy"
The added container with system restart policy will trigger a full board reboot after we post the changes. A DONE status indicate the new update has been fully validated after a reboot and set as a checkpoint for potential rollbacks in the future:
If we prefer to only restart the container and perform a non-reboot transition, we can set the new container with the container restart policy:
rm -r homeassistant
pvr app add --from homeassistant/raspberrypi3-homeassistant --restart-policy container homeassistant
pvr add .
pvr commit
pvr post -m "add a new homeassistant container with container restart policy"
Posting this will make Pantavisor transition to the new revision without rebooting. Notice the UPDATED status which means that the revision was correctly transitioned to, but not set as a checkpoint for rollbacks:
Any further update that affects any of the artifacts associated with the homeassistant container will be transitioned to according to its restart policy.